<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>LINUX For You &#187; Security</title> <atom:link href="http://www.linuxforu.com/category/how-to/security/feed/" rel="self" type="application/rss+xml" /><link>http://www.linuxforu.com</link> <description>The Complete Magazine on Open Source</description> <lastBuildDate>Tue, 31 Jan 2012 17:22:40 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Cyber Attacks Explained: Packet Spoofing</title><link>http://www.linuxforu.com/2011/12/cyber-attacks-explained-packet-spoofing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cyber-attacks-explained-packet-spoofing</link> <comments>http://www.linuxforu.com/2011/12/cyber-attacks-explained-packet-spoofing/#comments</comments> <pubDate>Wed, 28 Dec 2011 13:03:23 +0000</pubDate> <dc:creator>Prashant Phatak</dc:creator> <category><![CDATA[Overview]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Sysadmins]]></category> <category><![CDATA[ARP]]></category> <category><![CDATA[CentOS]]></category> <category><![CDATA[cryptography]]></category> <category><![CDATA[cyber attacks]]></category> <category><![CDATA[data collector]]></category> <category><![CDATA[denial of service attack]]></category> <category><![CDATA[design flaws]]></category> <category><![CDATA[DNS]]></category> <category><![CDATA[Ethernet]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[http]]></category> <category><![CDATA[intrusion detection device]]></category> <category><![CDATA[ip datagram]]></category> <category><![CDATA[IPS]]></category> <category><![CDATA[LAN]]></category> <category><![CDATA[LFY December 2011]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[MAC address]]></category> <category><![CDATA[NAT]]></category> <category><![CDATA[network vulnerabilities]]></category> <category><![CDATA[osi layers]]></category> <category><![CDATA[packet-monitoring software]]></category> <category><![CDATA[packet-sniffing tool]]></category> <category><![CDATA[packets]]></category> <category><![CDATA[routers]]></category> <category><![CDATA[Spoofing attack]]></category> <category><![CDATA[SYN-ACK]]></category> <category><![CDATA[TCP]]></category> <category><![CDATA[TCP/IP]]></category> <category><![CDATA[TCP/IP protocol]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[Web requests]]></category> <category><![CDATA[Web servers]]></category><guid isPermaLink="false">http://www.linuxforu.com/?p=8494</guid> <description><![CDATA[Last month, we started this series to cover the important cyber attacks that impact critical IT infrastructure in organisations. The first was the denial-of-service attack, which we discussed in detail. This month, we...]]></description> <content:encoded><![CDATA[<p><img class="aligncenter size-large wp-image-8495" title="Marching packets" src="http://cdn.linuxforu.com/wp-content/uploads/2011/12/cyber-attacks-590x358.jpg?d9c344" alt="Marching packets" width="590" height="358" /><div class="introduction"><a href="http://www.linuxforu.com/2011/11/cyber-attacks-explained-dos-and-ddos/" title="Cyber Attacks Explained: DoS and DDoS">Last month</a>, we started this series to cover the important cyber attacks that impact critical IT infrastructure in organisations. The first was the denial-of-service attack, which we discussed in detail. This month, we will cover the packet-spoofing attack, which is found to be a favourite among hackers, and widely used in exploiting network vulnerabilities. We will also discuss how this type of attack affects Linux systems, and how to mitigate the risks.</div><p>Spoofing, by definition, means to imitate or trick someone. To understand the spoofing attack, we need to examine the IP packet structure in detail. Many cyber attacks stem from design flaws in the fundamental network designs; packet spoofing is no exception. Please refer to Figure 1.</p><div id="attachment_8496" class="wp-caption aligncenter" style="width: 590px"><a href="http://cdn.linuxforu.com/wp-content/uploads/2011/12/Fig1.png?d9c344"><img src="http://cdn.linuxforu.com/wp-content/uploads/2011/12/Fig1-590x442.png?d9c344" alt="Ethernet network packet" title="Ethernet network packet" width="590" height="442" class="size-large wp-image-8496" /></a><p class="wp-caption-text">Figure 1: Ethernet network packet</p></div><p>As we know, a basic Ethernet network packet is essentially a data chunk with various predefined fields such as source and destination MAC addresses, frame checksum code, preambles, etc. In the case of the TCP/IP protocol, the TCP frame encapsulates the IP datagram, and both piggyback on the basic Ethernet packet. The TCP provides the connection-oriented information, while the IP packet contains source and destination addresses and ports. It is the duty of various OSI layers to contribute their bit towards the formation of a complete packet.</p><p>As we learnt <a href="http://www.linuxforu.com/2011/11/cyber-attacks-explained-dos-and-ddos/" title="Cyber Attacks Explained: DoS and DDoS">last month the TCP/IP works on a three-way handshake (SYN, SYN-ACK and ACK)</a>,. This handshake establishes a connection between two different network interface cards, which then use the packet sequencing and data acknowledgements to send or receive data. The conversation is formally concluded by using a FIN/FIN-ACK handshake.</p><p>The source and IP address field values decide who is talking to whom, while the port fields decide which source application is talking to which destination application. IP address fields in the IP packet are filled up automatically by the upper layers; however, malicious users or programs can modify these fields &#8212; and this is exactly where the spoofing comes into the picture (refer to Figure 2).</p><div id="attachment_8497" class="wp-caption aligncenter" style="width: 590px"><a href="http://cdn.linuxforu.com/wp-content/uploads/2011/12/Fig2.png?d9c344"><img src="http://cdn.linuxforu.com/wp-content/uploads/2011/12/Fig2-590x277.png?d9c344" alt="Packet-spoofing attack" title="Packet-spoofing attack" width="590" height="277" class="size-large wp-image-8497" /></a><p class="wp-caption-text">Figure 2: Packet-spoofing attack</p></div><p>In a very simple packet-spoofing attack, the hacker creates IP packets targeting a destination, but the source IP field is modified so that it does not have the IP address of the hackers&#8217; computer, but in fact, of some other computer, which can be used as a data collector or a sniffer by the hackers.</p><p>By its design, the TCP/IP stack running on the destination computer is supposed to respond to the source IP of the received packet. On doing so, the sniffer computer receives the packet. Having said that, if a packet-monitoring software is run on the destination computer, it will show that the packets are coming from this sniffer computer, which in reality is not the case. Thus, the hackers are successful in hiding themselves, and at the same time collecting packet information from the sniffer computer, because their own real source IP is nowhere revealed in this process.</p><p>Now let&#8217;s understand why hackers prefer spoofing. While hiding on the network is the very first step, a hacker&#8217;s intention is always beyond that. By collecting packets on the sniffer computer, hackers can gain a lot of information about the target machine. Vital information, such as open ports, type of operating system, layer 7 applications, cryptography types used, etc, can be collected, while not revealing one&#8217;s identity.</p><p>Just as an example, a hacker can send a spoofed packet to find out if the target is running a Web server. Once the port information is revealed on the sniffer, another chunk of spoofed packets can be sent to the target to establish a telnet session, and check Web server headers, which would reveal OS information as well as the type of Web server and security support information.</p><p>Please note that the hackers need not always have access to the sniffer machine; in fact, using an advanced packet-sniffing tool can help the attackers use only their own machine, send spoofed packets, collect data on the same machine, and still be invisible on the network from an attack viewpoint.</p><p>Advanced hackers can use spoofing to find out the state of a firewall too. As we know, the firewall is a stateful packet-filtering process, which works on a set of configurable rules, to decide which packet should be allowed, and which dropped. When a source machine tries to connect to another machine that is protected behind a firewall, the source machine has to first establish a TCP handshake with the firewall.</p><p>If the connection is allowed, the firewall itself establishes another connection with the destination machine, and the data transfer occurs with the firewall as a catalyst in this whole process. Also, when the destination machine tries to send an acknowledgement to the source, the firewall is bound to intercept and check whether or not a corresponding request from the source is pending. If it is not, the packet is dropped. All this is true for modern stateful firewalls, but not for old or cheap firewalls, which tend to allow ACK packets, thus exposing spoofing possibilities.</p><p>There are three reasons worth mentioning here, which typically make a network vulnerable to spoofing attacks. The first is, the IP packets can be modified very easily using free utilities available. The second reason is that even today, many applications still use source and destination IP address combinations as a secure way of authenticating a packet.</p><p>Just as an example, there are Web servers that allow or disallow HTTP requests from a list of configurable IP addresses. Such systems prove to be useless if the packet is spoofed to reflect an IP address which is in the list of allowed IPs. The third reason is that the routers forward traffic based on the destination address, and by default do not care much about the source address.</p><h2>Packet spoofing types</h2><p>With this basic knowledge of how spoofing works, let us now dig a bit deeper. At a broad technical level, there are two basic types of spoofing: &#8220;blind&#8221; spoofing and &#8220;non-blind&#8221; spoofing. As we discussed earlier, the packet sequence number and acknowledgements help data transfer, so sensing those fields is an important requirement of a spoofing-based attack.</p><p>In the blind spoofing type of attack, the attacker sends multiple packets to the target to sample the sequencing numbers. Once the pattern is found out, it becomes easy for the attacker to create another set of spoofed packets, to collect the data being transferred. Whereas, in the non-blind type, the attackers must be on the same subnet as the target, to be able to easily see the sequencing numbers and acknowledgements. Once they get their hands on it, they can break the established connection between the target and the other computer to which it is talking, and re-establish the connection by modifying the sequence numbers to that of the attackers&#8217; own machine.</p><p>An extended version of this type of attack is the man-in-the-middle attack, whereby an entire session is stolen to decipher and steal data.</p><p>Now let&#8217;s take a look at how the basic concept of spoofing could be used by hackers to impact various TCP-based application services.</p><h3>IP port spoofing</h3><p>In this type, the source port is modified in order to cheat the NAT devices and firewalls, and also to hide deep in the network. A firewall that is not very well managed can end up leaving stale rules in action, which can potentially lead certain outgoing ports on certain IP addresses to be open. IP port spoofing attacks take advantage of this situation.</p><p>This is a serious attack, because the hacker can be outside the network, and still be able to look at internal traffic.</p><h3>ARP spoofing</h3><p>Since it is all about modifying or forging packets, modern attackers don&#8217;t restrict themselves to IP fields. In this type of attack, which is also known as ARP poisoning, the attackers send spoofed ARP packets on the local area network, to associate the attackers&#8217; own machine&#8217;s MAC address with the IP address of another host, which is the target.</p><p>Due to this, traffic for the target now reaches the attackers&#8217; machine, due to the binding between IP and MAC addresses. Thus this becomes a local man-in-the-middle attack. The attackers can further hide by forwarding received data to the actual destination, and since there is no data lost in this process, it is almost impossible to find the man-in-the-middle stealing the data.</p><h3>DNS spoofing</h3><p>Also known as a DNS poisoning attack, this is more serious. In this case, the domain name system server is spoofed to alter entries of domain names to reflect the attackers&#8217; IP address. This results in sending Web or email traffic to the attackers&#8217; machine. This attack is achieved by creating multiple forged packets wherein the IP, port and service type entries are modified to serve the purpose.</p><p>The repercussions of such an attack are very dangerous, whereby a website can be defaced, or email data can be stolen.</p><h3>Email and Web spoofing</h3><p>Speaking about Layer 7, the same technique of impersonation can be stretched to crafting fake email addresses, Web requests and hyperlinks. This is usually done to plant a Trojan or a virus and spread it across. Please remember that spoofing is a basic component in planting a denial-of-service attack, mainly because the attacker would always want to hide behind a curtain.</p><h2>Protecting FOSS systems</h2><p>While the spoofing attack is a difficult one to tackle, there are a few preventive mechanisms that all network administrators should adopt in their infrastructure. Since the spoofing starts at Layer 2, the real protection has to be implemented in the critical network components such as routers, firewalls, switches, etc.</p><p>Deploying the latest stateful firewall, and enabling features in it that fight against source packet spoofing, can be a first level of defense. As a daily chore, network logs from firewalls, routers and switches can be parsed using a script, to see if multiple duplicate ACK packets are being generated.</p><p>Also, if an unusual number of SYN packets are being observed, which are not being responded to, that could be a clue to spoofing. The real spoofing detection is to check a bunch of packets for a given set of source and destination IP addresses, and see that there is no other IP address involved in that communication session.</p><p>This is a difficult task for a script program to achieve, and for complex networks, deploying an intrusion detection device usually helps to a great extent. There is a thumb rule while inspecting packets, which says that in a network packet log, if an internal LAN IP address is being shown in the log file capturing data for an external interface, that indicates there is a problem.</p><p>Linux/FOSS systems come with a built-in, but usually less-known feature called source address verification. It is a kernel feature which, when turned on, starts dropping packets that appear to be arriving from the internal network, but in reality are not. Most of the latest kernels, such as Ubuntu and CentOS, do support it, but if your Linux distro does not, it is time to upgrade. Modifying the <code>hosts.conf</code> file to add <code>nospoof on</code> is another level of defense to try.</p><p>In terms of detection, for smaller Linux networks, a nice utility called <code>arpwatch</code> is very useful. This keeps track of MAC and IP addresses, records all changes, and can be scripted to alert administrators about a possible attack. Scripting can also be done to go through network interface logs and look for anomalies in terms of source address forging.</p><h2>Summary</h2><p>Packet spoofing is a difficult type of attack to tackle. It can result in serious data loss, and there are ways to detect it and stop it. Configuring firewalls, switches and routers is an important step to prevent networks from spoofing, and network administrators should know about it.</p><p>Finance firms are found to be common victims to this kind of attack, and their IT management teams should take the necessary steps to prevent financial losses or damage to their reputation. Implementing IPS devices certainly helps in getting control over the IT network infrastructure security.<div id="crp_related"><h5>Related Posts:</h5><ul><li><a href="http://www.linuxforu.com/2012/01/cyber-attacks-explained-network-sniffing/" rel="bookmark" class="crp_title">Cyber Attacks Explained: Network Sniffing</a></li><li><a href="http://www.linuxforu.com/2011/11/cyber-attacks-explained-dos-and-ddos/" rel="bookmark" class="crp_title">Cyber Attacks Explained: DoS and DDoS</a></li><li><a href="http://www.linuxforu.com/2011/10/syn-flooding-using-scapy-and-prevention-using-iptables/" rel="bookmark" class="crp_title">SYN Flooding using SCAPY and Prevention using iptables</a></li><li><a href="http://www.linuxforu.com/2010/08/nmap-basics/" rel="bookmark" class="crp_title">Learning Nmap: The Basics</a></li><li><a href="http://www.linuxforu.com/2010/11/advanced-nmap-some-scan-types/" rel="bookmark" class="crp_title">Advanced NMap: Some Scan Types</a></li></ul></div>Tags: <a href="http://www.linuxforu.com/tag/arp/" title="ARP" rel="tag">ARP</a>, <a href="http://www.linuxforu.com/tag/centos/" title="CentOS" rel="tag">CentOS</a>, <a href="http://www.linuxforu.com/tag/cryptography/" title="cryptography" rel="tag">cryptography</a>, <a href="http://www.linuxforu.com/tag/cyber-attacks/" title="cyber attacks" rel="tag">cyber attacks</a>, <a href="http://www.linuxforu.com/tag/data-collector/" title="data collector" rel="tag">data collector</a>, <a href="http://www.linuxforu.com/tag/denial-of-service-attack/" title="denial of service attack" rel="tag">denial of service attack</a>, <a href="http://www.linuxforu.com/tag/design-flaws/" title="design flaws" rel="tag">design flaws</a>, <a href="http://www.linuxforu.com/tag/dns/" title="DNS" rel="tag">DNS</a>, <a href="http://www.linuxforu.com/tag/ethernet/" title="Ethernet" rel="tag">Ethernet</a>, <a href="http://www.linuxforu.com/tag/firewall/" title="firewall" rel="tag">firewall</a>, <a href="http://www.linuxforu.com/tag/http/" title="http" rel="tag">http</a>, <a href="http://www.linuxforu.com/tag/intrusion-detection-device/" title="intrusion detection device" rel="tag">intrusion detection device</a>, <a href="http://www.linuxforu.com/tag/ip-datagram/" title="ip datagram" rel="tag">ip datagram</a>, <a href="http://www.linuxforu.com/tag/ips/" title="IPS" rel="tag">IPS</a>, <a href="http://www.linuxforu.com/tag/lan/" title="LAN" rel="tag">LAN</a>, <a href="http://www.linuxforu.com/tag/lfy-december-2011/" title="LFY December 2011" rel="tag">LFY December 2011</a>, <a href="http://www.linuxforu.com/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.linuxforu.com/tag/mac-address/" title="MAC address" rel="tag">MAC address</a>, <a href="http://www.linuxforu.com/tag/nat/" title="NAT" rel="tag">NAT</a>, <a href="http://www.linuxforu.com/tag/network-vulnerabilities/" title="network vulnerabilities" rel="tag">network vulnerabilities</a>, <a href="http://www.linuxforu.com/tag/osi-layers/" title="osi layers" rel="tag">osi layers</a>, <a href="http://www.linuxforu.com/tag/packet-monitoring-software/" title="packet-monitoring software" rel="tag">packet-monitoring software</a>, <a href="http://www.linuxforu.com/tag/packet-sniffing-tool/" title="packet-sniffing tool" rel="tag">packet-sniffing tool</a>, <a href="http://www.linuxforu.com/tag/packets/" title="packets" rel="tag">packets</a>, <a href="http://www.linuxforu.com/tag/routers/" title="routers" rel="tag">routers</a>, <a href="http://www.linuxforu.com/tag/spoofing-attack/" title="Spoofing attack" rel="tag">Spoofing attack</a>, <a href="http://www.linuxforu.com/tag/syn-ack/" title="SYN-ACK" rel="tag">SYN-ACK</a>, <a href="http://www.linuxforu.com/tag/tcp/" title="TCP" rel="tag">TCP</a>, <a href="http://www.linuxforu.com/tag/tcpip/" title="TCP/IP" rel="tag">TCP/IP</a>, <a href="http://www.linuxforu.com/tag/tcpip-protocol/" title="TCP/IP protocol" rel="tag">TCP/IP protocol</a>, <a href="http://www.linuxforu.com/tag/ubuntu/" title="ubuntu" rel="tag">ubuntu</a>, <a href="http://www.linuxforu.com/tag/web-requests/" title="Web requests" rel="tag">Web requests</a>, <a href="http://www.linuxforu.com/tag/web-servers/" title="Web servers" rel="tag">Web servers</a><br /> ]]></content:encoded> <wfw:commentRss>http://www.linuxforu.com/2011/12/cyber-attacks-explained-packet-spoofing/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Cyber Attacks Explained: DoS and DDoS</title><link>http://www.linuxforu.com/2011/11/cyber-attacks-explained-dos-and-ddos/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cyber-attacks-explained-dos-and-ddos</link> <comments>http://www.linuxforu.com/2011/11/cyber-attacks-explained-dos-and-ddos/#comments</comments> <pubDate>Mon, 31 Oct 2011 18:34:04 +0000</pubDate> <dc:creator>Prashant Phatak</dc:creator> <category><![CDATA[Overview]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Sysadmins]]></category> <category><![CDATA[ACK]]></category> <category><![CDATA[buffer overflow]]></category> <category><![CDATA[Cisco]]></category> <category><![CDATA[cyber attacks]]></category> <category><![CDATA[data packet]]></category> <category><![CDATA[DDoS]]></category> <category><![CDATA[DDoS attacks]]></category> <category><![CDATA[denial of service]]></category> <category><![CDATA[denial of service attack]]></category> <category><![CDATA[DNS]]></category> <category><![CDATA[DOS]]></category> <category><![CDATA[dos attacks]]></category> <category><![CDATA[Ethernet]]></category> <category><![CDATA[ethernet frames]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[http]]></category> <category><![CDATA[IP address]]></category> <category><![CDATA[IP-based protocols]]></category> <category><![CDATA[kernel hardening tools]]></category> <category><![CDATA[LFY November 2011]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Mac]]></category> <category><![CDATA[MAC address]]></category> <category><![CDATA[network interface card]]></category> <category><![CDATA[network monitoring tools]]></category> <category><![CDATA[network packet]]></category> <category><![CDATA[OSI model of network layers]]></category> <category><![CDATA[routers]]></category> <category><![CDATA[security infrastructure]]></category> <category><![CDATA[SSL]]></category> <category><![CDATA[SYN]]></category> <category><![CDATA[syn flood attack]]></category> <category><![CDATA[syn packet]]></category> <category><![CDATA[target system]]></category> <category><![CDATA[tcp ip protocol]]></category> <category><![CDATA[TCP port]]></category> <category><![CDATA[TCP/IP]]></category> <category><![CDATA[TCP/IP protocol]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[UDP]]></category> <category><![CDATA[UTM]]></category> <category><![CDATA[Web servers]]></category><guid isPermaLink="false">http://www.linuxforu.com/?p=5635</guid> <description><![CDATA[With this article, we begin a new series on the major kinds of cyber attacks that weaken the IT security infrastructure within organisations. With the rapid spread of Internet technologies and applications, the...]]></description> <content:encoded><![CDATA[<p><img class="aligncenter size-large wp-image-5636" title="Oops, am under attack, again!" src="http://cdn.linuxforu.com/wp-content/uploads/2011/11/DDoS-590x294.jpg?d9c344" alt="Oops, am under attack, again!" width="590" height="294" /></p><div class="introduction">With this article, we begin a new series on the major kinds of cyber attacks that weaken the IT security infrastructure within organisations. With the rapid spread of Internet technologies and applications, the number of those seeking to break into systems is also increasing &#8212; usually to gain fame, money, or to damage the target&#8217;s reputation. The first to be covered in this series is the Denial of Service attack (DoS) and the distributed version (DDoS). We will learn how these attacks work technically, and discuss ways to stop them at the network entry point.</div><p>The fundamental technique behind a DoS attack is to make the target system busy. In a computer server, when a network packet is being received, all components (right from the network interface card or NIC to the application running under the OS) are participating to ensure successful delivery of that packet. The NIC must monitor the Ethernet frames meant for it, align data and pass it to the network card driver, which then adds its own intelligence and passes it to the OS, which takes it to the application.</p><p>Each component involved can exhibit some form of vulnerability, and DoS attacks are devised to exploit one or more of these, to penetrate into the system.</p><p>Let&#8217;s now understand the basics of the TCP/IP protocol, which uses a handshake between the sender and receiver. Figure 1 shows how a healthy TCP handshake takes place, and how a SYN flood attack compares with it.</p><div id="attachment_5641" class="wp-caption aligncenter" style="width: 590px"><a href="http://cdn.linuxforu.com/wp-content/uploads/2011/11/DDoS-Fig01.jpg?d9c344"><img class="size-large wp-image-5641" title="A healthy TCP handshake" src="http://cdn.linuxforu.com/wp-content/uploads/2011/11/DDoS-Fig01-590x365.jpg?d9c344" alt="A healthy TCP handshake" width="590" height="365" /></a><p class="wp-caption-text">Figure 1: A healthy TCP handshake</p></div><p>When the sender wants to communicate, it sends a SYN packet with its own IP address as the source, and the receiver&#8217;s IP address as the destination. The receiver responds with a SYN-ACK packet. The sender confirms this by sending an ACK packet. Now, sender and receiver have a guarantee that they can communicate with each other.</p><p>The sender then starts sending the actual data in small chunks, and for each data packet received, the receiver sends an ACK back. When the sender sends the final data chunk, it sends a FIN signal, which is acknowledged by the receiver by sending a FIN-ACK back.</p><p>If a particular port is not supposed to respond to the request, the receiver responds with an RST packet, which means it is rejecting that request.</p><p>As you can see here, the TCP/IP stack software has to deal with complex communication, which does take some CPU and memory resources. To add to this, many handshakes are happening on a server for different source and destination addresses and for various TCP ports. All IP-based protocols such as ICMP ping, telnet, FTP, etc, actually piggyback on this framework to do their job, each working on a different dedicated socket or port.</p><p>At the application layers, the OS and the application receiving or transmitting data allocate internal memory buffers and a software process to keep track of what is being sent or received. The OS partially does this job itself, and leaves the rest to the network driver and protocol stack. Each process consumes some CPU time and memory resources.</p><p>A DoS attack exploits this situation, by tweaking TCP packets to make the server respond to malicious, fabricated network requests. TCP packets can be forged, or modified to disrupt the basic handshake process, in order to create unexpected network responses. This ultimately results in exhausting all the server resources, which when overwhelmed, stops responding.</p><p>There are various ways to do this, each using a different technical approach. Please refer to the following table &#8212; it shows you how various DoS techniques map to the OSI model of network layers.</p><table border="0"><tbody><tr><td>Application</td><td>Web DoS, Email Spam</td></tr><tr><td>Presentation</td><td>Malformed SSL Requests</td></tr><tr><td>Session</td><td>Telnet DDoS</td></tr><tr><td>Transport</td><td>SYN Flood, Smurf Attack</td></tr><tr><td>Network</td><td>ICMP Flooding</td></tr><tr><td>Data</td><td>MAC Flooding</td></tr><tr><td>Physical</td><td>Dummy Packet Attack</td></tr></tbody></table><p>We will now discuss each of these techniques in more detail.</p><h2>Network layer DoS attacks</h2><h3>The MAC flood</h3><p>This is a rare Layer 1 attack, in which the attacker sends multiple dummy Ethernet frames, each with a different MAC address. Network switches treat MAC addresses separately, and hence reserve some resources for each request. When all the memory in a switch is used up, it either shuts down or becomes unresponsive.</p><p>In a few types of routers, a MAC flood attack may cause these to drop their entire routing table, thus<br /> disrupting the whole network under its routing domain.</p><h3>The SYN flood</h3><p>The attacker sends multiple SYN packets; upon receiving SYN-ACK from the target, it does not send ACK, but instead sends more SYN packets. This leaves the TCP/IP stack on the target to conclude that there is a possible network congestion or disconnect, and it waits for a specific amount of time. Thus, multiple partially-open connections are maintained by the stack for some time, in anticipation of an ACK response.</p><p>In another SYN flooding type, the SYN is sent with a spoofed source address, which becomes the destination address for the target&#8217;s SYN-ACK packet. However, since the system at the spoofed IP never sent that SYN to begin with, it will never send an ACK to this packet, and will simply drop it. The target system is not aware of this, and keeps track of it in anticipation of an ACK.</p><p>In both examples, the connection tables and memory resources on the targeted network components are filled up with bogus entries. When the entire table is filled up, the device stops responding.</p><h3>The ping of death</h3><p>In this case, a malformed ping packet flood is sent to the target. Since the TCP stack responds only to a certain type of ping packet, it fails to respond to this, exhausting the system resources.</p><h3>TCP established connection attacks</h3><p>This is an extension to the SYN flood, the difference being that it uses a complete 3-way TCP handshake. It does not spoof addresses, nor strip the ACK responses, but just establishes a TCP connection and simply does not send any data. Due to this, connections are maintained till time-out; a flood of such connections results in a DoS on the targeted device.</p><p>Since the handshake is gracefully done, this attack is difficult to trace, and needs advanced techniques to detect and stop.</p><h3>Smurf attacks</h3><p>This is a famous, widely used Layer-3 attack in which the attacker sends ping traffic to IP broadcast addresses. However, the source address is spoofed, and is of the victims&#8217; machines. Thus, routers deliver replies to the victims, which send back with a ping response. On a larger and populated subnet, this can have a devastating effect, and can practically render the routing device non-responsive.</p><p>Similar to this is the Fraggle attack, wherein a UDP echo packet is sent instead of TCP</p><h3>TCP RST attacks</h3><p>In this new breed of DoS attack, the source IP is spoofed with the victim&#8217;s IP address, and this malformed packet is sent to a firewall. This forces the firewall to remember this connection for some time.</p><p>This attack is rarely used; its sole purpose is to fool the intrusion detection logic on cheaper firewalls. Unlike the host desktop, a firewall with UTM features works in promiscuous mode, and takes note of each and every packet. However, if the anomaly detection logic is not smart enough, it simply results in piling up connections and eventually rendering itself useless.</p><h2>Application layer DoS attacks</h2><p>Besides these network-layer attacks, there are a few that deal with the application layer directly. Such attacks are comparatively easy to detect and fix, but if ignored, can result in heavy downtime.</p><p>Application-layer attacks exploit vulnerabilities in the OS and the guest application. Listed below are a few such attacks.</p><h3>Buffer overflows</h3><p>This very well-known attack pushes the OS to consume resources to such an extent that it starts leaking memory, becomes sluggish or simply stops responding. It is a myth that a buffer overflow is observed only in Windows OS &#8212; in fact, it is very much true for Linux distros too. Applications such as a database, email and Web servers are found to have buffer overflow vulnerabilities.</p><h3>Web and DNS DoS attacks</h3><p>Web servers running on TCP port 80 are a common target for DoS attacks. Attackers usually send multiple HTTP requests (not malformed at all) targeted to retrieve enormous amounts of data from the backend database server.</p><p>Such request floods make the database server busy, keeping the Web server waiting for data. This creates a pile-up on both servers, which become unresponsive to further requests. This can happen unintentionally too, especially when breaking news is posted and everyone tries to access it at the same time. In case of DNS servers, the attack method is similar to Web servers, but it has serious consequences. If a DNS server becomes non-responsive, it can take down the firm&#8217;s entire network.</p><h2>Distributed DoS attacks</h2><p>In simple terms, a distributed DoS attack (DDoS) combines multiple attackers using the various techniques discussed above, and can result in catastrophic failure. Please refer to Figure 2 to understand how a typical DDoS attack is planned on a website.</p><div id="attachment_5644" class="wp-caption aligncenter" style="width: 590px"><a href="http://cdn.linuxforu.com/wp-content/uploads/2011/11/DDoS-Fig02-e1320464299717.jpg?d9c344"><img class="size-large wp-image-5644 " title="A typical DDoS attack" src="http://cdn.linuxforu.com/wp-content/uploads/2011/11/DDoS-Fig02-e1320464299717-590x355.jpg?d9c344" alt="A typical DDoS attack" width="590" height="355" /></a><p class="wp-caption-text">Figure 2: A typical DDoS attack</p></div><p>A lethal combination of spoofed SYN flood and old-style ping-of-death attacks is typically used to disrupt an IT network that is open to the Internet.</p><p>In a modern form of DDoS, the attacker injects malicious code into a virus and spreads it to millions of computers, making them zombie machines. On a specific day and time, all infected machines start executing that code, which is usually written to access a website or plant a network-level attack onto a targeted system. Since it is difficult to find out who injected the code into a virus, it is difficult to trace the real attacker.</p><p>In another non-hazardous form, a DDoS attack is modified to access the attacker&#8217;s website and click advertisements on it, which in turn helps the attacker earn money from ad clicks.</p><h2>Protecting FOSS systems</h2><p>Though DoS is one of the oldest and most commonly known attacks, unfortunately, there is no fool-proof solution to stop it because practically, it is difficult to decide which network connection is legitimate, and which one is initiating an attack.</p><p>While there are specific tools for a particular type of DoS attack, it boils down to cyber-security design and monitoring to strengthen the network.</p><p>Typical symptoms of a DoS attack on a Linux server are a sluggish system or a slow website, sudden and prolonged increase in processor and memory utilisation, excessive disk thrashing without any business activity, slower file transfers, etc.</p><p>On a network monitoring system, there could be a large number of TCP packet drops, abnormal TCP resets, broken TCP SYN packets being received, or duplicate ACK packets being sent. Usually, the first-level component impacted is a router, followed by a firewall and other components like switches. Firewalls cannot protect the router, but the firmware of modern routers (e.g., Cisco 7600 or X443) contain patches to protect against DoS attacks. Though modern firewalls have many features to combat DoS attacks, they don&#8217;t always help.</p><p>Firewalls can certainly protect against network layer-based attacks, but usually fail to protect systems from application-layer attacks like on port 80 (HTTP). Here, an application-level firewall is needed to filter each request and ensure its legitimacy.</p><p>For Ubuntu and RHEL, an APF (Advanced Policy Firewall) is a great tool that can help mitigate DoS attacks. Linux FOSS systems are blessed with fantastic network drivers, as well as many built-in features such as a packet-filtering firewall, packet monitoring, network monitoring tools, kernel hardening tools, etc.</p><p>For smaller Linux networks, a nice script can be written to SYN Trap open connections and to stop bogus TCP RST connections, as a first line of defence.</p><p>For mission-critical corporate Linux networks, deploying an Intrusion Prevention System device (IPS) is the best choice. IPS devices sit on a network in promiscuous mode and use built-in anomaly detection algorithms to intercept and decode each and every packet. Since its intelligence ranges from Layer 2 to Layer 7, it can gauge which packet is legitimate, and which isn&#8217;t. It has a great alerting mechanism<br /> to proactively inform and stop DoS and DDoS attacks.</p><p>A good combination of IPS devices, UTM firewalls and application layer security can help stop these dreaded attacks.<div id="crp_related"><h5>Related Posts:</h5><ul><li><a href="http://www.linuxforu.com/2011/12/cyber-attacks-explained-packet-spoofing/" rel="bookmark" class="crp_title">Cyber Attacks Explained: Packet Spoofing</a></li><li><a href="http://www.linuxforu.com/2011/10/syn-flooding-using-scapy-and-prevention-using-iptables/" rel="bookmark" class="crp_title">SYN Flooding using SCAPY and Prevention using iptables</a></li><li><a href="http://www.linuxforu.com/2012/01/cyber-attacks-explained-network-sniffing/" rel="bookmark" class="crp_title">Cyber Attacks Explained: Network Sniffing</a></li><li><a href="http://www.linuxforu.com/2011/04/securing-apache-part-8-dos-ddos-attacks/" rel="bookmark" class="crp_title">Securing Apache, Part 8: DoS &#038; DDoS Attacks</a></li><li><a href="http://www.linuxforu.com/2010/11/advanced-nmap-some-scan-types/" rel="bookmark" class="crp_title">Advanced NMap: Some Scan Types</a></li></ul></div>Tags: <a href="http://www.linuxforu.com/tag/ack/" title="ACK" rel="tag">ACK</a>, <a href="http://www.linuxforu.com/tag/buffer-overflow/" title="buffer overflow" rel="tag">buffer overflow</a>, <a href="http://www.linuxforu.com/tag/cisco/" title="Cisco" rel="tag">Cisco</a>, <a href="http://www.linuxforu.com/tag/cyber-attacks/" title="cyber attacks" rel="tag">cyber attacks</a>, <a href="http://www.linuxforu.com/tag/data-packet/" title="data packet" rel="tag">data packet</a>, <a href="http://www.linuxforu.com/tag/ddos/" title="DDoS" rel="tag">DDoS</a>, <a href="http://www.linuxforu.com/tag/ddos-attacks/" title="DDoS attacks" rel="tag">DDoS attacks</a>, <a href="http://www.linuxforu.com/tag/denial-of-service/" title="denial of service" rel="tag">denial of service</a>, <a href="http://www.linuxforu.com/tag/denial-of-service-attack/" title="denial of service attack" rel="tag">denial of service attack</a>, <a href="http://www.linuxforu.com/tag/dns/" title="DNS" rel="tag">DNS</a>, <a href="http://www.linuxforu.com/tag/dos/" title="DOS" rel="tag">DOS</a>, <a href="http://www.linuxforu.com/tag/dos-attacks/" title="dos attacks" rel="tag">dos attacks</a>, <a href="http://www.linuxforu.com/tag/ethernet/" title="Ethernet" rel="tag">Ethernet</a>, <a href="http://www.linuxforu.com/tag/ethernet-frames/" title="ethernet frames" rel="tag">ethernet frames</a>, <a href="http://www.linuxforu.com/tag/firewall/" title="firewall" rel="tag">firewall</a>, <a href="http://www.linuxforu.com/tag/http/" title="http" rel="tag">http</a>, <a href="http://www.linuxforu.com/tag/ip-address/" title="IP address" rel="tag">IP address</a>, <a href="http://www.linuxforu.com/tag/ip-based-protocols/" title="IP-based protocols" rel="tag">IP-based protocols</a>, <a href="http://www.linuxforu.com/tag/kernel-hardening-tools/" title="kernel hardening tools" rel="tag">kernel hardening tools</a>, <a href="http://www.linuxforu.com/tag/lfy-november-2011/" title="LFY November 2011" rel="tag">LFY November 2011</a>, <a href="http://www.linuxforu.com/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.linuxforu.com/tag/mac/" title="Mac" rel="tag">Mac</a>, <a href="http://www.linuxforu.com/tag/mac-address/" title="MAC address" rel="tag">MAC address</a>, <a href="http://www.linuxforu.com/tag/network-interface-card/" title="network interface card" rel="tag">network interface card</a>, <a href="http://www.linuxforu.com/tag/network-monitoring-tools/" title="network monitoring tools" rel="tag">network monitoring tools</a>, <a href="http://www.linuxforu.com/tag/network-packet/" title="network packet" rel="tag">network packet</a>, <a href="http://www.linuxforu.com/tag/osi-model-of-network-layers/" title="OSI model of network layers" rel="tag">OSI model of network layers</a>, <a href="http://www.linuxforu.com/tag/routers/" title="routers" rel="tag">routers</a>, <a href="http://www.linuxforu.com/tag/security-infrastructure/" title="security infrastructure" rel="tag">security infrastructure</a>, <a href="http://www.linuxforu.com/tag/ssl/" title="SSL" rel="tag">SSL</a>, <a href="http://www.linuxforu.com/tag/syn/" title="SYN" rel="tag">SYN</a>, <a href="http://www.linuxforu.com/tag/syn-flood-attack/" title="syn flood attack" rel="tag">syn flood attack</a>, <a href="http://www.linuxforu.com/tag/syn-packet/" title="syn packet" rel="tag">syn packet</a>, <a href="http://www.linuxforu.com/tag/target-system/" title="target system" rel="tag">target system</a>, <a href="http://www.linuxforu.com/tag/tcp-ip-protocol/" title="tcp ip protocol" rel="tag">tcp ip protocol</a>, <a href="http://www.linuxforu.com/tag/tcp-port/" title="TCP port" rel="tag">TCP port</a>, <a href="http://www.linuxforu.com/tag/tcpip/" title="TCP/IP" rel="tag">TCP/IP</a>, <a href="http://www.linuxforu.com/tag/tcpip-protocol/" title="TCP/IP protocol" rel="tag">TCP/IP protocol</a>, <a href="http://www.linuxforu.com/tag/ubuntu/" title="ubuntu" rel="tag">ubuntu</a>, <a href="http://www.linuxforu.com/tag/udp/" title="UDP" rel="tag">UDP</a>, <a href="http://www.linuxforu.com/tag/utm/" title="UTM" rel="tag">UTM</a>, <a href="http://www.linuxforu.com/tag/web-servers/" title="Web servers" rel="tag">Web servers</a><br /> ]]></content:encoded> <wfw:commentRss>http://www.linuxforu.com/2011/11/cyber-attacks-explained-dos-and-ddos/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Rootkits: The Enemy Within</title><link>http://www.linuxforu.com/2011/09/rootkits-the-enemy-within/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rootkits-the-enemy-within</link> <comments>http://www.linuxforu.com/2011/09/rootkits-the-enemy-within/#comments</comments> <pubDate>Wed, 31 Aug 2011 18:37:27 +0000</pubDate> <dc:creator>Prashant Phatak</dc:creator> <category><![CDATA[Overview]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Sysadmins]]></category> <category><![CDATA[anti-virus software]]></category> <category><![CDATA[bad intentions]]></category> <category><![CDATA[business data]]></category> <category><![CDATA[chkrootkit]]></category> <category><![CDATA[compromise]]></category> <category><![CDATA[confidential data]]></category> <category><![CDATA[credit card numbers]]></category> <category><![CDATA[data theft]]></category> <category><![CDATA[detection tool]]></category> <category><![CDATA[detection tools]]></category> <category><![CDATA[finance data]]></category> <category><![CDATA[intrusion-detection systems]]></category> <category><![CDATA[IP addresses]]></category> <category><![CDATA[key logger]]></category> <category><![CDATA[LAN]]></category> <category><![CDATA[LFY September 2011]]></category> <category><![CDATA[linsniffer]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[malicious software]]></category> <category><![CDATA[McAfee]]></category> <category><![CDATA[netstat]]></category> <category><![CDATA[port NATing]]></category> <category><![CDATA[privacy]]></category> <category><![CDATA[Red Hat]]></category> <category><![CDATA[removal mechanisms]]></category> <category><![CDATA[Rootkit Hunter]]></category> <category><![CDATA[rootkits]]></category> <category><![CDATA[sole idea]]></category> <category><![CDATA[spyware software]]></category> <category><![CDATA[Symantec]]></category> <category><![CDATA[tripwire]]></category> <category><![CDATA[Trojans]]></category> <category><![CDATA[vulnerable systems]]></category><guid isPermaLink="false">http://www.linuxforu.com/?p=5391</guid> <description><![CDATA[While it was assumed in the past that viruses only targeted Windows, hackers targeting the FOSS world proved this wrong. A rootkit on a Linux distribution makes it vulnerable to programmatic and manual...]]></description> <content:encoded><![CDATA[<p><img src="http://cdn.linuxforu.com/wp-content/uploads/2011/09/rootkits-590x384.jpg?d9c344" alt="Rootkits: The Enemy Within" title="Rootkits: The Enemy Within" width="590" height="384" class="aligncenter size-large wp-image-5616" /><div class="introduction">While it was assumed in the past that viruses only targeted Windows, hackers targeting the FOSS world proved this wrong. A rootkit on a Linux distribution makes it vulnerable to programmatic and manual attacks, which calls for serious detection methods and removal mechanisms. As Linux is becoming a de-facto standard in data centres, it&#8217;s crucial that sysadmins gain knowledge about rootkit problems and resolutions to secure their infrastructure. This article hopes to create the necessary awareness, and should be helpful to systems administrators and IT management teams.</div><p>In today’s world, IT is used almost everywhere, to automate routine tasks and add value to our lives, right from purchasing stocks on the Internet to withdrawing money from an ATM. With its benefits, there are bound to be problems as well. Practically every computer user knows about the threat of viruses. Even the partially computer-literate learn the hard way that their data is not safe but can be corrupted, deleted or stolen &#8212; hence, good backups are essential.</p><p>While there are many anti-virus software available, there is another category of malicious software called rootkits, which are more dangerous by nature. These are created by some of the world&#8217;s smartest programmers, but unfortunately, with bad intentions, hence creating a problem for users.</p><p>Malicious software could run as an application, in user-space, or as part of the operating system. Rootkits are typically in the second category, making them powerful, dangerous, tough to detect, and very difficult to get rid of. An unknown person gaining control of your machine and working on it, probably at the same time you are using it, could be dangerous, and invades your privacy. Key-logger kits can steal passwords, credit card numbers, personal details, finance data stored in spreadsheets, confidential business data, etc.</p><p>Rootkits are essentially small collections of tools, utilities and scripts. The sole idea behind installing this collection is to be able to gain administrator-level access on the target machine, so that it can either be remotely controlled to harvest secret data, or used to attack other vulnerable machines, to replicate the rootkit on those, and subsequently &#8220;own&#8221; those systems too.</p><p>A rootkit typically contains a combination of network sniffers, log parsers, log-cleaning scripts, scripts to change user privileges, core systems utilities to detect IP addresses, netstat, utilities to kill running processes, scripts to hide code, and a zipped copy of the whole kit, for replication.</p><h2>How rootkits differ from viruses</h2><p>Let&#8217;s quickly look at the symptoms of both first.</p><table border="0"><thead><tr><td>Virus</td><td>Rootkit</td></tr></thead><tbody><tr><td>Primarily runs as an application process</td><td>Primarily runs as a part of OS/kernel</td></tr><tr><td>Usually gains user level access</td><td>Gains root/admin level access</td></tr><tr><td>Does not open backdoors</td><td>Opens backdoors &#8212; viz., port, IP, etc.</td></tr><tr><td>Does not provide any remote access</td><td>Provides remote access to attacker</td></tr><tr><td>Fairly easy to detect and remove</td><td>Extremely difficult to detect and remove</td></tr><tr><td>Is meant to create nuisance and data damage</td><td>Is meant to cause privacy/data theft</td></tr></tbody></table><p>As you can see in the above table, while the dividing line between viruses/Trojans and rootkits is becoming blurred (with the common purpose of causing data loss, or capturing/harvesting confidential data like user names, passwords, email addresses, etc), there are still some distinct differences between them. Although a virus normally runs in &#8220;stealth mode&#8221;, hiding itself by infecting executables and system files, it still typically runs as an application &#8212; which is why anti-virus software can detect and remove it. A Trojan, which is an advanced virus, is meant to hide in a more sophisticated fashion.</p><p>A rootkit, on the other hand, subverts part of the operating system to hide itself and gain the maximum control possible. Due to this, it is capable of monitoring as well as performing all activities on a system. It can act as a vehicle for other rootkits and viruses as well. Rootkits turn a computer into a remotely controllable victim, often also making it a spambot to send out unsolicited commercial email.</p><h2>Infection/installation</h2><p>Rootkits follow virus-like methods to compromise the system; however, since they need OS-level privileges, installation methods differ a bit. Typically, attackers try the following ways to get access to a system:</p><ul><li>With physical access to the system, attackers try guessing non-complex passwords. If it&#8217;s possible to boot the computer from the attacker&#8217;s media (CD, USB drive), then the attacker can also try various techniques to recover the root password from the installed OS on the hard disk.</li><li>Attackers can remotely detect OS or network application vulnerabilities that have not been patched by security fixes, and run attacks against these.</li><li>Over the Web, attackers use embedded scripts that sneak into a system via the browser.</li><li>Many spyware software act as easy and sure-fire vehicles to propagate rootkits to systems connected to the Internet.</li></ul><p>Usually, a rootkit is packaged as a compressed self-extracting zip file that extracts its contents once it gets on a system. Often, a small kit installer is also packaged, which ensures the health of an installation, gains administrative rights and does what&#8217;s needed to run in stealth mode.</p><p>A few advanced rootkits are also capable of detecting anti-virus and anti-spyware software, and accordingly change their way of working, or modify their outputs, to avoid being detected. For example, some rootkits copy the kit tools to the root of the file system, but a simple directory listing does not show those files since the rootkit modifies the output of the OS directory listing commands.</p><p>Since attackers make every attempt to optimise the kit&#8217;s code size, it takes little time to install and activate a rootkit. Rootkits are expected to spread as much as possible, and so almost all contain a distributable copy of themselves. When in action, they use all possible means to scan the local network and find other vulnerable systems.</p><p>If LAN security is not properly designed, gaining administrative rights on one system is often enough for a rootkit to easily propagate to other systems on the LAN. Modern kits are designed to detect Internet access, fetch the latest rootkit update, copy it to all infected machines, and then try to propagate over the Internet to other vulnerable or poorly configured systems.</p><h2>Detection</h2><p>As mentioned earlier, detecting a rootkit is a seriously difficult job, which requires administrators to go an extra mile when compared to detecting viruses and Trojans. While a few rootkits can be blocked by the latest anti-virus tools, most can still bypass these. Since the rootkit becomes part of the operating system, seemingly rudimentary methods such as booting from an emergency disk or USB drive are very useful in loading a fresh and known &#8220;good copy&#8221; of the OS, to run a detection tool without interference from the rootkit. Even then, many detection tools only detect, and still cannot remove these, which requires a manual cleanup process.</p><p>Detection tools need to adopt a different methodology rather than simple file checks or process checks, because if the rootkit is active, it may fool these legacy detection methods or algorithms. A better approach is to take a snap of different views of a system, and compare those with a baseline snap captured when the detection tool was first installed on a newly-built system.</p><p>Newer tools use artificial-intelligence algorithms to detect variations in the system&#8217;s status, and hence don&#8217;t require any baseline benchmark. There are various detection algorithms, such as signature-based, which are similar to detecting a virus, or integrity-based, wherein files, processes and kernel modules are checked for their binary integrity. There is another effective method, where a memory dump is taken by the tool, and then parsed for anomalies, signatures or trends which are either directly or symptomatically related to a rootkit.</p><p>There are many commercial and open source rootkit detection software; let&#8217;s take a look at a few popular tools.</p><p>McAfee and Symantec provide some protection against letting rootkits get installed, and also provide some level of detection. However, detecting rootkits needs dedicated specialised tools.</p><p>In the FOSS world, a famous tool called <a href="http://www.chkrootkit.org/" target="_blank">chkrootkit</a> takes precedence over other tools. It can perform detailed binary checks, file modification validations, and check kernel modules. It works smoothly over a wide range of Linux distributions, making it a must-have tool in the administrator&#8217;s toolbox.</p><p>Similarly, <a href="http://www.tripwire.org/" target="_blank">Tripwire</a> is an important open source tool, which can perform extensive MD5 hash checking, and detect anomalies such as back-door process checks and other local exploits.</p><p><a href="http://www.rootkit.nl/projects/rootkit_hunter.html" target="_blank">Rootkit Hunter</a> is another such famous tool &#8212; an elaborate script capable of checking multiple rootkits. It can also check for wrong file permissions and kernel modules, which can be incorporated into a daily scanning job. Upon arrival of a new rootkit, an efficient systems administrator can study it and write a script to detect it.</p><p>It is important to note that malware creators often study these detection mechanisms too, and make necessary changes in the newer versions of their rootkits, to make them undetectable by detection tools.</p><h2>Rootkit examples and the damage they cause</h2><p>Similar to viruses, there are unfortunately a lot of rootkits for Windows, for commercial-grade Red Hat Enterprise Linux, as well as all open source distributions. In many of these, since the kernel does not change drastically over a period of time, it&#8217;s often simple for attackers to write kits that would easily propagate.</p><p>Although there are a few hundred dangerous rootkits impacting the FOSS world, we will look at just a few commonly found ones.</p><p>Let&#8217;s start by mentioning the LRK kit first, because it is one of the oldest, and still active (first detected in 1997, but still found today on vulnerable systems). It has multiple versions, and is known to install very commonly used binaries such as <code>netstat</code>, <code>linsniffer</code>, <code>inetd</code>, <code>ifconfig</code>, etc.</p><p>Knark is a kit that is very difficult to detect, as it resides entirely in the kernel. It is very notorious because once active, it hides ports, files and processes from the administrator.</p><p>Beastkit is of a fairly new variety, written to target Red Hat distributions, while another dangerous variety, called Illogic, is known to start a process on port 901, which lets attackers telnet into the system and do practically anything that an administrator can with physical access.</p><p>It is worth mentioning the rootkits that have caused significant damage to Linux systems: Sneakin, Kitko, Ajakit and Devil. All these kits are capable of using advanced techniques, such as detecting the OS and modifying the kernel on the fly, port NATing to decipher information, key-logging to steal passwords and sneakily emailing them to the attacker&#8217;s email address, optimising actions to take least amount of system resources, etc. These kits are also known to spread quickly, and convert infected machines into zombies that participate in spreading the infection further.</p><p>As noted earlier, rootkits also open backdoors in the form of ports, IP addresses or kernel processes, which allow attackers to take complete control of the system remotely, even over the Internet.</p><p>There are a few &#8220;friendly&#8221; rootkits that work with each other. If a rootkit trying to invade a system sees that there is already a friendly kit present, it helps by updating older binaries to make it stronger. A few rootkits are known to act as gateways to install viruses and Trojans on a LAN; the rootkit goes in first, makes room, sets user privileges, takes control of the file system, disables any anti-virus that&#8217;s running, opens backdoors for viruses, and goes into stealth mode.</p><p>A new generation of rootkits is known to install fake SSL certificates to try deciphering HTTPS communications to gain credit card information, which is usually sent over a secure channel. There are some kits that use compromised systems for man-in-the-middle attacks on other systems&#8217; communications, which makes it difficult for cyber security investigators to find the actual attacker.</p><p>Designing a continuously improving security infrastructure is very essential to stop the spread of, and damage caused by rootkits. The latest intrusion-detection systems (IDS) <em>can</em> stop rootkits effectively at the doorstep. Senior IT management should be aware of these serious problems, and take aggressive action to secure their networks.<div id="crp_related"><h5>Related Posts:</h5><ul><li><a href="http://www.linuxforu.com/2011/10/chkrootkit-eliminate-enemy-within/" rel="bookmark" class="crp_title">Chkrootkit &#8212; Eliminate the Enemy Within</a></li><li><a href="http://www.linuxforu.com/2012/01/cyber-attacks-explained-network-sniffing/" rel="bookmark" class="crp_title">Cyber Attacks Explained: Network Sniffing</a></li><li><a href="http://www.linuxforu.com/2011/01/the-importance-of-intrusion-prevention-systems/" rel="bookmark" class="crp_title">The Importance of Intrusion-Prevention Systems</a></li><li><a href="http://www.linuxforu.com/2011/12/cyber-attacks-explained-packet-spoofing/" rel="bookmark" class="crp_title">Cyber Attacks Explained: Packet Spoofing</a></li><li><a href="http://www.linuxforu.com/2011/05/securing-database-servers/" rel="bookmark" class="crp_title">Securing Database Servers</a></li></ul></div>Tags: <a href="http://www.linuxforu.com/tag/anti-virus-software/" title="anti-virus software" rel="tag">anti-virus software</a>, <a href="http://www.linuxforu.com/tag/bad-intentions/" title="bad intentions" rel="tag">bad intentions</a>, <a href="http://www.linuxforu.com/tag/business-data/" title="business data" rel="tag">business data</a>, <a href="http://www.linuxforu.com/tag/chkrootkit/" title="chkrootkit" rel="tag">chkrootkit</a>, <a href="http://www.linuxforu.com/tag/compromise/" title="compromise" rel="tag">compromise</a>, <a href="http://www.linuxforu.com/tag/confidential-data/" title="confidential data" rel="tag">confidential data</a>, <a href="http://www.linuxforu.com/tag/credit-card-numbers/" title="credit card numbers" rel="tag">credit card numbers</a>, <a href="http://www.linuxforu.com/tag/data-theft/" title="data theft" rel="tag">data theft</a>, <a href="http://www.linuxforu.com/tag/detection-tool/" title="detection tool" rel="tag">detection tool</a>, <a href="http://www.linuxforu.com/tag/detection-tools/" title="detection tools" rel="tag">detection tools</a>, <a href="http://www.linuxforu.com/tag/finance-data/" title="finance data" rel="tag">finance data</a>, <a href="http://www.linuxforu.com/tag/intrusion-detection-systems/" title="intrusion-detection systems" rel="tag">intrusion-detection systems</a>, <a href="http://www.linuxforu.com/tag/ip-addresses/" title="IP addresses" rel="tag">IP addresses</a>, <a href="http://www.linuxforu.com/tag/key-logger/" title="key logger" rel="tag">key logger</a>, <a href="http://www.linuxforu.com/tag/lan/" title="LAN" rel="tag">LAN</a>, <a href="http://www.linuxforu.com/tag/lfy-september-2011/" title="LFY September 2011" rel="tag">LFY September 2011</a>, <a href="http://www.linuxforu.com/tag/linsniffer/" title="linsniffer" rel="tag">linsniffer</a>, <a href="http://www.linuxforu.com/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.linuxforu.com/tag/malicious-software/" title="malicious software" rel="tag">malicious software</a>, <a href="http://www.linuxforu.com/tag/mcafee/" title="McAfee" rel="tag">McAfee</a>, <a href="http://www.linuxforu.com/tag/netstat/" title="netstat" rel="tag">netstat</a>, <a href="http://www.linuxforu.com/tag/port-nating/" title="port NATing" rel="tag">port NATing</a>, <a href="http://www.linuxforu.com/tag/privacy/" title="privacy" rel="tag">privacy</a>, <a href="http://www.linuxforu.com/tag/red-hat/" title="Red Hat" rel="tag">Red Hat</a>, <a href="http://www.linuxforu.com/tag/removal-mechanisms/" title="removal mechanisms" rel="tag">removal mechanisms</a>, <a href="http://www.linuxforu.com/tag/rootkit-hunter/" title="Rootkit Hunter" rel="tag">Rootkit Hunter</a>, <a href="http://www.linuxforu.com/tag/rootkits/" title="rootkits" rel="tag">rootkits</a>, <a href="http://www.linuxforu.com/tag/security/" title="Security" rel="tag">Security</a>, <a href="http://www.linuxforu.com/tag/sole-idea/" title="sole idea" rel="tag">sole idea</a>, <a href="http://www.linuxforu.com/tag/spyware-software/" title="spyware software" rel="tag">spyware software</a>, <a href="http://www.linuxforu.com/tag/symantec/" title="Symantec" rel="tag">Symantec</a>, <a href="http://www.linuxforu.com/tag/tripwire/" title="tripwire" rel="tag">tripwire</a>, <a href="http://www.linuxforu.com/tag/trojans/" title="Trojans" rel="tag">Trojans</a>, <a href="http://www.linuxforu.com/tag/vulnerable-systems/" title="vulnerable systems" rel="tag">vulnerable systems</a><br /> ]]></content:encoded> <wfw:commentRss>http://www.linuxforu.com/2011/09/rootkits-the-enemy-within/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Best Practices in Network Security Monitoring</title><link>http://www.linuxforu.com/2011/06/best-practices-network-security-monitoring/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=best-practices-network-security-monitoring</link> <comments>http://www.linuxforu.com/2011/06/best-practices-network-security-monitoring/#comments</comments> <pubDate>Tue, 31 May 2011 18:36:56 +0000</pubDate> <dc:creator>Prashant Phatak</dc:creator> <category><![CDATA[Overview]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Sysadmins]]></category> <category><![CDATA[anti-virus software]]></category> <category><![CDATA[anti-virus solution]]></category> <category><![CDATA[Cisco]]></category> <category><![CDATA[corporate network]]></category> <category><![CDATA[Ethernet]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[IBM]]></category> <category><![CDATA[IDS]]></category> <category><![CDATA[intelligence algorithms]]></category> <category><![CDATA[intrusion-detection devices]]></category> <category><![CDATA[intrusion-detection systems]]></category> <category><![CDATA[LFY June 2011]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[monitoring tools]]></category> <category><![CDATA[network]]></category> <category><![CDATA[network administrators]]></category> <category><![CDATA[network architecture]]></category> <category><![CDATA[network monitoring]]></category> <category><![CDATA[network performance]]></category> <category><![CDATA[networking model]]></category> <category><![CDATA[packet-capturing software]]></category> <category><![CDATA[security monitoring]]></category> <category><![CDATA[security monitoring solution]]></category> <category><![CDATA[security solutions]]></category> <category><![CDATA[Siem-Live]]></category> <category><![CDATA[software policies]]></category> <category><![CDATA[threat management systems]]></category> <category><![CDATA[UTMs]]></category><guid isPermaLink="false">http://www.linuxforu.com/?p=4713</guid> <description><![CDATA[This article details the best practices organisations can follow to strengthen their network monitoring procedures, and also talks about a few FOSS products that help achieve this. It is imperative for an IT...]]></description> <content:encoded><![CDATA[<p><img class="alignright size-full wp-image-8397" title="The place for Network Security Monitoring" src="http://cdn.linuxforu.com/wp-content/uploads/2011/06/network-monitoring.jpg?d9c344" alt="The place for Network Security Monitoring" width="350" height="404" /></p><div class="introduction">This article details the best practices organisations can follow to strengthen their network monitoring procedures, and also talks about a few FOSS products that help achieve this. It is imperative for an IT management team to know these techniques and the related products, in order to have a network infrastructure that is strong enough to cater to critical business.</div><p>Network administrators usually rely on generic and built-in monitoring tools for network security. Ideally, the network infrastructure is supposed to have carefully designed strategies to scale up monitoring tools and techniques as the network grows, over time. Without this, there can be network performance challenges, downtimes due to failures, and most importantly, penetration attacks. These can lead to monetary losses as well as loss of reputation. Thus, there is a need for best practices to monitor network infrastructure in an agile manner.</p><h2>Network monitoring challenges</h2><p>For starters, each of the seven layers of the OSI networking model has its own responsibilities, which call for separate methods of monitoring and security for each layer. Network monitoring is seemingly simple &#8212; but in reality, it&#8217;s a very complex process. Mixing traditional network monitoring with security monitoring further complicates things from the design perspective, for network architects, network operations teams, and the systems administrators who manage it.</p><p>While there are multiple challenges in network monitoring, the most important one is the vast amount of data gathered by the monitoring tool, and the amount of time required to assimilate the information and apply intelligence to it, in order to achieve actionable decisions.</p><p>For example, a simple promiscuous packet capture on a network card for barely ten minutes provides us with a few megabytes of data. Finding out which HTTP request failed, and why, is like finding a needle in a haystack. Another important consideration is to identify key areas, often called choke points. The incorrect selection of a choke point can result in erroneous data that doesn&#8217;t accurately reflect the current performance scenario. This leads to incorrect capacity planning and security mapping.</p><p>One challenge worth mentioning is caused by the unprecedented growth of a network, a result of the organisation&#8217;s growth due to business expansion or company mergers. The bigger the network, the tougher it is to visualise the scale of network infrastructure. This can result in performance bottlenecks as well as security vulnerabilities. Finally, failure to incorporate proper monitoring tools is also a challenge to be addressed by senior IT management staff. It has been observed that relying purely on commercial products actually limits a firm&#8217;s ability to bring diversification into the network monitoring process.</p><p>The use of appropriate FOSS tools and products is highly recommended wherever applicable. As an example, there is hardly any single commercial tool that can relate Layer 7 network monitoring to the underlying Layer 2 packet and help troubleshoot a performance problem.</p><h2>Network security challenges</h2><p>From the infrastructure scaling point of view, irrespective of the size of an organisation, network security is often a complex area to deal with. Since network infrastructure contains components like firewalls, routers, managed switches, etc., the configurations and settings for each of these components further add to the complexity.</p><p>Also, when faced with the choices of multiple devices offered by many vendors, it is easy for a network architect to get distracted from considering an appropriate solution customised to the network. As the network grows, it can be more prone to vulnerabilities and loopholes, needing tight security policies and careful designs, using cutting-edge technology devices and solutions.</p><p>From the security point of view, a new breed of viruses and spyware has emerged recently, which exploits the operating system as well as the networking device&#8217;s vulnerabilities, and can take control to cause enough damage. Though there are multiple security solutions available, hackers are often one step ahead of the cybercops.</p><p>It is often the case that an organisation is more prone to internal attacks than to attacks originating from outside the firms network infrastructure. Preventing such attacks needs the latest techniques, such as the deployment of intrusion detection systems, unified threat management systems (UTMs), etc.</p><h2>Devices involved</h2><p>Network monitoring is the term used for health monitoring, whereby monitoring utilities keep a watch on various networking components, to ensure their uptime and overall performance. Network security monitoring is at a level further down the networking layers, whereby utilities capture each and every traffic packet in a promiscuous mode, correlate it with known and unknown attacks and hacking styles, store the log for further &#8220;deep-dive&#8221; analysis, and report the alerts.</p><p>While there are known components such as intrusion-detection devices, UTMs and firewalls, there are multiple software solutions, both off-the-shelf or FOSS-based, which extend the functionalities of these components, and work on the extensive log data gathered by monitoring appliances and devices. We will discuss these solutions in more detail shortly.</p><h2>Best practices in network security monitoring</h2><p>Network security monitoring involves collecting network packet data, segregating it among all the 7 OSI layers, and applying intelligent algorithms to get answers to security-related questions. The purpose is to know in real-time what is happening on the network at a detailed level, and strengthen security by hardening the processes, devices, appliances, software policies, etc.</p><p>While there is no single list of practices that can cover all possible situations, we can still enumerate some best practices to implement and follow for any network infrastructure:</p><ol><li>Perform network performance measurement before deploying the security monitoring solution. This is essential because security monitoring can have its own footprint on the network, especially if the monitoring solution is software-based, running on the servers.</li><li>If possible and affordable, deploy more than one anti-virus solution. Many anti-virus software solutions don&#8217;t offer spyware detection, or don&#8217;t do it right; hence, a combination is always helpful.</li><li>Deploy at least one FOSS packet-capturing software on the network. Though the IDS systems do this job partially, there can be situations where the IDS could be too busy to be used as a packet viewer, and a FOSS utility can come in handy for daily chores.</li><li>Gather monitoring data at a secure place. It is often a mistake to gather security data on a desktop or a server which is easily accessible, making the network vulnerable at that point. Since security applies to the monitoring process too, the data captured must be stored in a secure manner.</li><li>Monitor all layers; don&#8217;t leave anything to chance. Usually, the data link layer is omitted from monitoring; however, since a new wave of attacks can exploit Ethernet frames too, it is important to take this layer into account. The same applies to the network layer, as most internal attacks can easily use it to exploit vulnerabilities.</li><li>Deploy the IDS behind the firewall, since the firewall filters out everything that is not meant to enter the LAN. This improves the IDS efficiency by keeping the clutter away.</li><li>Capture VLANs separately. Since VLANs are separate TCP broadcast domains, separately gathering and analysing data for each can help detect internal and external security problems quickly.</li><li>Consider all protocols. Many firms still use NetBIOS internally along with TCP/IP; such a situation demands monitoring all protocols on the wire. There are a few legacy types of attacks based on the NetBEUI protocol, which could be captured.</li><li>Enable optimal auditing levels on the monitoring devices. Setting up too many audit event captures can easily confuse monitoring solutions while detecting an anomaly, whereas having very few audit logs can render security monitoring useless.</li></ol><p>It is a best practice to have an update in the monitoring process whenever a device is added to the network, removed or changed. Also, even if there is no change in the design, monitoring processes should be reviewed in a timely manner, in order to remove errors, and keep pace with changing security scenarios.</p><h2>Monitoring network security using FOSS solutions</h2><p>It is worth mentioning a few commercial products used in network security monitoring, before we talk about the FOSS solutions.</p><p>Cisco Security Monitoring, Analysis, and Response System (MARS) is a famous solution that falls in the category of Security Threat Mitigation systems (STM). MARS gathers and stores raw network data, and correlates it with intelligence algorithms. IBM Proventia IDS devices fall under the same category, providing richer features and customisable alerts. All these threat monitoring and mitigation appliances enable us to centralise detection, mitigation and reporting on priority threats by leveraging the network and security devices already deployed in a network.</p><p>In the FOSS world, the Backtrack Linux distribution is famous among cyber-security groups, as it allows one to write easy, effective and yet industry-standard utilities quickly. <a href="http://www.snorby.org/">Snorby</a> is an open source suite of network security monitoring utilities, which interacts seamlessly with open source IDS solutions such as Snort, Suricata, etc. Snorby contains the necessary binaries to run on various operating systems, including Microsoft platforms.</p><p>Siem-Live is another such distribution gaining support and momentum. A good thing about this distribution is that it comes on a bootable CD, relies on generic IDS systems and log collectors, and applies intelligence on it to create customised reports. The event correlation engine of Siem-Live makes it fit for small- and mid-scale networks.</p><p>This article will be incomplete if a famous tool called SGuel is not mentioned here. While maintaining the quality of the intelligence engine, this tool comes with a nice GUI and essential bells and whistles, such as real-time event gathering, raw packet capturing, reporting, etc.</p><h2>Summary</h2><p>While there are numerous tools and practices available for monitoring the security of a network infrastructure, it is important to apply the industry&#8217;s best practices. It is imperative for IT management teams to know what is happening on the network, in real-time, and accordingly introduce the latest technologies. Since cyber security is a process of continuous improvement, there cannot be a single list of best practices, as the quality of practices evolves with network architecture and design, as well as the devices in use.</p><p>Network security monitoring is essential for the IT health of an organisation, and a rock-solid monitoring mechanism can help reduce damages to the business. While there are commercial solutions available for this, FOSS also provides real-time monitoring software and cutting-edge intelligence engines. Senior IT management personnel need to form a security monitoring group within the organisation to deploy the best practices and strengthen the corporate network.<div id="crp_related"><h5>Related Posts:</h5><ul><li><a href="http://www.linuxforu.com/2011/05/securing-database-servers/" rel="bookmark" class="crp_title">Securing Database Servers</a></li><li><a href="http://www.linuxforu.com/2011/01/the-importance-of-intrusion-prevention-systems/" rel="bookmark" class="crp_title">The Importance of Intrusion-Prevention Systems</a></li><li><a href="http://www.linuxforu.com/2011/06/zenoss-core-network-monitoring/" rel="bookmark" class="crp_title">Quick Setup Guide to Network Monitoring using Zenoss Core</a></li><li><a href="http://www.linuxforu.com/2012/01/cyber-attacks-explained-network-sniffing/" rel="bookmark" class="crp_title">Cyber Attacks Explained: Network Sniffing</a></li><li><a href="http://www.linuxforu.com/2011/11/cyber-attacks-explained-dos-and-ddos/" rel="bookmark" class="crp_title">Cyber Attacks Explained: DoS and DDoS</a></li></ul></div>Tags: <a href="http://www.linuxforu.com/tag/anti-virus-software/" title="anti-virus software" rel="tag">anti-virus software</a>, <a href="http://www.linuxforu.com/tag/anti-virus-solution/" title="anti-virus solution" rel="tag">anti-virus solution</a>, <a href="http://www.linuxforu.com/tag/cisco/" title="Cisco" rel="tag">Cisco</a>, <a href="http://www.linuxforu.com/tag/corporate-network/" title="corporate network" rel="tag">corporate network</a>, <a href="http://www.linuxforu.com/tag/ethernet/" title="Ethernet" rel="tag">Ethernet</a>, <a href="http://www.linuxforu.com/tag/firewall/" title="firewall" rel="tag">firewall</a>, <a href="http://www.linuxforu.com/tag/ibm/" title="IBM" rel="tag">IBM</a>, <a href="http://www.linuxforu.com/tag/ids/" title="IDS" rel="tag">IDS</a>, <a href="http://www.linuxforu.com/tag/intelligence-algorithms/" title="intelligence algorithms" rel="tag">intelligence algorithms</a>, <a href="http://www.linuxforu.com/tag/intrusion-detection-devices/" title="intrusion-detection devices" rel="tag">intrusion-detection devices</a>, <a href="http://www.linuxforu.com/tag/intrusion-detection-systems/" title="intrusion-detection systems" rel="tag">intrusion-detection systems</a>, <a href="http://www.linuxforu.com/tag/lfy-june-2011/" title="LFY June 2011" rel="tag">LFY June 2011</a>, <a href="http://www.linuxforu.com/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.linuxforu.com/tag/microsoft/" title="Microsoft" rel="tag">Microsoft</a>, <a href="http://www.linuxforu.com/tag/monitoring-tools/" title="monitoring tools" rel="tag">monitoring tools</a>, <a href="http://www.linuxforu.com/tag/network/" title="network" rel="tag">network</a>, <a href="http://www.linuxforu.com/tag/network-administrators/" title="network administrators" rel="tag">network administrators</a>, <a href="http://www.linuxforu.com/tag/network-architecture/" title="network architecture" rel="tag">network architecture</a>, <a href="http://www.linuxforu.com/tag/network-monitoring/" title="network monitoring" rel="tag">network monitoring</a>, <a href="http://www.linuxforu.com/tag/network-performance/" title="network performance" rel="tag">network performance</a>, <a href="http://www.linuxforu.com/tag/networking-model/" title="networking model" rel="tag">networking model</a>, <a href="http://www.linuxforu.com/tag/packet-capturing-software/" title="packet-capturing software" rel="tag">packet-capturing software</a>, <a href="http://www.linuxforu.com/tag/security-monitoring/" title="security monitoring" rel="tag">security monitoring</a>, <a href="http://www.linuxforu.com/tag/security-monitoring-solution/" title="security monitoring solution" rel="tag">security monitoring solution</a>, <a href="http://www.linuxforu.com/tag/security-solutions/" title="security solutions" rel="tag">security solutions</a>, <a href="http://www.linuxforu.com/tag/siem-live/" title="Siem-Live" rel="tag">Siem-Live</a>, <a href="http://www.linuxforu.com/tag/software-policies/" title="software policies" rel="tag">software policies</a>, <a href="http://www.linuxforu.com/tag/threat-management-systems/" title="threat management systems" rel="tag">threat management systems</a>, <a href="http://www.linuxforu.com/tag/utms/" title="UTMs" rel="tag">UTMs</a><br /> ]]></content:encoded> <wfw:commentRss>http://www.linuxforu.com/2011/06/best-practices-network-security-monitoring/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Securing Database Servers</title><link>http://www.linuxforu.com/2011/05/securing-database-servers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=securing-database-servers</link> <comments>http://www.linuxforu.com/2011/05/securing-database-servers/#comments</comments> <pubDate>Sat, 30 Apr 2011 18:34:38 +0000</pubDate> <dc:creator>Prashant Phatak</dc:creator> <category><![CDATA[Overview]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Sysadmins]]></category> <category><![CDATA[application layer]]></category> <category><![CDATA[backup services]]></category> <category><![CDATA[corporate network]]></category> <category><![CDATA[cryptography]]></category> <category><![CDATA[database administrators]]></category> <category><![CDATA[database products]]></category> <category><![CDATA[database server]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[intrusion-detection devices]]></category> <category><![CDATA[LFY May 2011]]></category> <category><![CDATA[M&A]]></category> <category><![CDATA[MAC addresses]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[Microsoft SQL Server]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[NAT]]></category> <category><![CDATA[network layer]]></category> <category><![CDATA[Oracle]]></category> <category><![CDATA[osi]]></category> <category><![CDATA[OSI model]]></category> <category><![CDATA[security solution]]></category> <category><![CDATA[server farm]]></category> <category><![CDATA[SQL injections]]></category> <category><![CDATA[SSL]]></category> <category><![CDATA[surveillance systems]]></category> <category><![CDATA[Sybase]]></category> <category><![CDATA[web applications]]></category> <category><![CDATA[Web-server connections]]></category><guid isPermaLink="false">http://www.linuxforu.com/?p=4489</guid> <description><![CDATA[With the ever-expanding data requirements for Web applications, database administrators often configure security parameters at the OS and database layer. Unfortunately, administrators seldom consider implementing security at a network layer to protect the...]]></description> <content:encoded><![CDATA[<p><img src="http://cdn.linuxforu.com/wp-content/uploads/2011/05/identifying-security-issues-common-to-all-server-roles.jpg?d9c344" alt="Securing Database Servers" title="Securing Database Servers" width="300" height="299" class="alignright size-full wp-image-8878" /><div class="introduction">With the ever-expanding data requirements for Web applications, database administrators often configure security parameters at the OS and database layer. Unfortunately, administrators seldom consider implementing security at a network layer to protect the data from prying eyes. Recent cases of hacking into the IT infrastructure of finance firms show us that an increasing level of security awareness is required in this space, and this article aims to address this issue. It is targeted at systems and database administrators, as well as senior IT management staff, featuring case studies from a few popular open source databases.</div><p>For starters, there are seven layers that form the OSI networking model. Beginning at the physical layer, it goes up to the data-link, network, transport, session, presentation, and the application layers. While the physical-layer security is taken care of by surveillance systems, the application-layer security is handled by code instrumentation, which is the job of the developers. In the wake of overall security awareness in the IT world, responsible product managers incorporate code security as a mandated practice in their code-deployment release cycles.</p><p>All the intermediate five layers of the OSI model do require security measures too, by some means or the other, irrespective of the software component to which they are catering. Let&#8217;s take a look at these layers, which are usually not taken too seriously by security administrators. It is important to note that these layers actually need to be more secure than the layers at the top and bottom, because there are such a variety of attacks on the interim layers that there is no single means, tool or process to control them.</p><p>The initial levels of compromising vulnerabilities usually start at the data-link and network layers (alternatively called Layer-2 and Layer-3 attacks). Layer-2 security is susceptible to MAC address spoofing, Layer-2 to flooding attacks, whereas Layer-3 security is subject to IP address-spoofing attacks. Similarly, Layers 4, 5 and 6 are prone to packet-crafting, session-stealing and cryptography-based attacks, respectively.</p><p>To understand this better, please refer to Figure 1, which shows various security methodologies and how each of these maps into the OSI layers of networking.</p><div id="attachment_8879" class="wp-caption aligncenter" style="width: 590px"><a href="http://cdn.linuxforu.com/wp-content/uploads/2011/05/OSI-Security-Methodology-Map.jpg?d9c344"><img src="http://cdn.linuxforu.com/wp-content/uploads/2011/05/OSI-Security-Methodology-Map-590x373.jpg?d9c344" alt="Security methodologies for various layers" title="Security methodologies for various layers" width="590" height="373" class="size-large wp-image-8879" /></a><p class="wp-caption-text">Figure 1: Security methodologies for various layers</p></div><p>While there is no such thing as 100 per cent security, the security design can incorporate carefully thought-out, customised security mechanisms, which can lead to a total security solution in an IT infrastructure. There is a wide range of devices from the security view-point, such as firewalls, intrusion-detection devices, content firewalls, etc., covering each layer, and also overlapping multiple network layers.</p><h2>Why is typical security not enough for database servers?</h2><p>Securing database servers needs administrators to go the extra mile in terms of technical design efforts. It is a job to be carried out by sysadmins as well as database admins, to cover all the network layers. Often, the practice is to assume that using OS-level user administration and leveraging the product&#8217;s built-in security is enough to protect databases.</p><p>Unfortunately, this is not true. While the user- and role-based models with strong passwords for SA accounts, etc., are essential, they exist only at the application layer; relying on them alone defeats the purpose of securing databases.</p><p>The technical reason behind why legacy methods fail is because a database is a widely and continuously accessible component, which makes it more vulnerable and susceptible to attacks. Database security requirements touch all networking layers, and hence, need careful design.</p><p>As an example, consider a database server that accepts connections from within the corporate network as well as from outside. It is accessed programmatically by the frontend software, as well as directly by admin and development staff to run queries, etc. It is accessed by backup services, anti-virus servers, and other maintenance-based utilities, and thus is widely accessible.</p><p>Any of these human or automated means of accessing the database server make it vulnerable to possible attacks originating at various networking touch-points. The latest spyware, and vulnerabilities that revolve around the infamous SQL-injection method, prove that something needs to be done beyond these legacy methods.</p><p>This is exactly where the security mechanisms and solutions that span the lower layers in the networking model come into the picture. Let us look at a few moderately advanced methods to secure database servers, followed by some serious solutions.</p><h2>Securing database servers</h2><h3>NAT and PAT</h3><p>Using network address translation and port address translation is the first recommended step. Since database products use predefined default ports, it is the first thing hackers look for, and hence should be changed. Even though the database IP address and port is not exposed to the outside world, it is a best practice to change it, to keep spyware and viruses away. Any standard firewall nowadays provides NAT and PAT features.</p><h3>A demilitarised zone (DMZ)</h3><p>Please refer to Figure 2, which shows a typical database server farm in a corporate IT infrastructure, hosting mission-critical databases and data-warehousing services.</p><div id="attachment_8877" class="wp-caption aligncenter" style="width: 321px"><img src="http://cdn.linuxforu.com/wp-content/uploads/2011/05/DMZ.jpg?d9c344" alt="Database server farm" title="Database server farm" width="321" height="566" class="size-full wp-image-8877" /><p class="wp-caption-text">Figure 2: Database server farm</p></div><p>As we can see, the database server is not exposed to the Internet, but is separated from it by an additional firewall. This design method is well-known, and is called a demilitarised zone (DMZ). In earlier days, it was a practice to keep database servers in the same network as the frontend/Web application servers, making them prone to attacks. An additional layer of security is now achieved by the second firewall, which opens up only the database port for the frontend servers, and not the IP addresses of the entire Internet. If the database carries mission-critical datasets of sensitive information, this method can be clubbed together with the NAT-PAT method, making it even harder for malware to breach the database server.</p><h3>Content-based firewalls</h3><p>The latest firewall products are equipped with the capability to look into the data packets flowing in either direction, and provide systems administrators a means to configure actions based on the intercepted content. These firewalls, sometimes called Layer-7 firewalls, are capable of reading SQL queries, query data, validation data, XML data, etc. Deploying such a firewall can certainly reduce virus attacks drastically, because data packets pertaining to ill-behaved operations are dropped and reported.</p><h3>SSL connections</h3><p>While SSL technology is commonly used to secure Web-server connections to browsers, it can also be used between frontend servers and the backend database server. SSL uses public-key and private-key cryptography to encrypt all connections between caller and listener. While this solution is a bit costly and takes a toll on data-transfer speeds, it is worth the effort to alleviate man-in-the-middle attacks.</p><h3>IPSec security</h3><p>The real challenge while securing a database server is to figure out who should access it. In terms of people, it is as simple as deploying user-ID and password-based access. However, if the network is compromised by a hacker, this won&#8217;t help much. A further step, in such a case, would be to deploy IPSec security, whereby each server will connect to the database server using an IPSec token, making it a unique and non-crackable connection.</p><h2>Securing open source databases</h3><p>A database administrator always carries out the essential chores to secure a database; however, for Linux-based open source solutions, a little extra effort is required. While there is no single solution to cover all open source database distributions, there are a few good tools for each.</p><p>A popular open source database is MySQL, which is used by many commercial websites as their backend. MySQL comes with the necessary scripts to harden the server from the security perspective, such as scripts to remove test databases, lower system and database privileges, enable the built-in Linux firewall to configure default database ports and block others, etc.</p><p>MongoDB and CouchDB are two famous database servers running on Apache distributions. Both come equipped with the great feature of IP binding, whereby the database kernel services are bound to one single IP. Adding an open source content firewall or a NAT-PAT solution can help create a very cost-effective and, yet, secure database farm.</p><p>The Hypertable open source database, which is modelled after Google&#8217;s BigTable DB structure, provides an extensive library of API calls that are used exclusively for adding security features. It is easy to write scripts using those API calls, to securely deploy and configure Hypertable distributions in a big server farm.</p><p>Unlike Microsoft SQL Server, Oracle and Sybase products, while designing security for open source products, it is important to incorporate a combination of network security methods, as well as the database product&#8217;s application-layer security.</p><h2>Summary</h2><p>While much effort goes into securing a database, due diligence is required to secure the server hosting the database too. The security measures taken for the application layer as well as the network layer must go hand-in-hand to keep mission-critical data safe from hackers. A rock-solid change-control process needs to be in place to tighten the IP stack, the patch-management solutions, as well as the physical security.</p><p>It is often found that Layer-2 security is not designed adequately, or in some cases is simply absent, which makes all the application-layer security measures futile. Senior IT management and database administrators need to work with systems administrators to amicably formulate an end-to-end security solution. This applies to all database-centric solutions, irrespective of whether they are off-the-shelf or FOSS-based.<div id="crp_related"><h5>Related Posts:</h5><ul><li><a href="http://www.linuxforu.com/2011/06/best-practices-network-security-monitoring/" rel="bookmark" class="crp_title">Best Practices in Network Security Monitoring</a></li><li><a href="http://www.linuxforu.com/2012/01/cyber-attacks-explained-network-sniffing/" rel="bookmark" class="crp_title">Cyber Attacks Explained: Network Sniffing</a></li><li><a href="http://www.linuxforu.com/2011/07/media-organisation-keeps-its-data-safe-with-postgresql/" rel="bookmark" class="crp_title">A Media Organisation Keeps Its Data Safe with PostgreSQL</a></li><li><a href="http://www.linuxforu.com/2011/01/the-importance-of-intrusion-prevention-systems/" rel="bookmark" class="crp_title">The Importance of Intrusion-Prevention Systems</a></li><li><a href="http://www.linuxforu.com/2009/08/safentrix-its-time-to-kill-e-mail-spam-for-free/" rel="bookmark" class="crp_title">SAFENTRIX: It’s Time to Kill e-mail Spam, for Free!</a></li></ul></div>Tags: <a href="http://www.linuxforu.com/tag/application-layer/" title="application layer" rel="tag">application layer</a>, <a href="http://www.linuxforu.com/tag/backup-services/" title="backup services" rel="tag">backup services</a>, <a href="http://www.linuxforu.com/tag/corporate-network/" title="corporate network" rel="tag">corporate network</a>, <a href="http://www.linuxforu.com/tag/cryptography/" title="cryptography" rel="tag">cryptography</a>, <a href="http://www.linuxforu.com/tag/database-administrators/" title="database administrators" rel="tag">database administrators</a>, <a href="http://www.linuxforu.com/tag/database-products/" title="database products" rel="tag">database products</a>, <a href="http://www.linuxforu.com/tag/database-server/" title="database server" rel="tag">database server</a>, <a href="http://www.linuxforu.com/tag/firewall/" title="firewall" rel="tag">firewall</a>, <a href="http://www.linuxforu.com/tag/google/" title="Google" rel="tag">Google</a>, <a href="http://www.linuxforu.com/tag/intrusion-detection-devices/" title="intrusion-detection devices" rel="tag">intrusion-detection devices</a>, <a href="http://www.linuxforu.com/tag/lfy-may-2011/" title="LFY May 2011" rel="tag">LFY May 2011</a>, <a href="http://www.linuxforu.com/tag/ma/" title="M&amp;A" rel="tag">M&amp;A</a>, <a href="http://www.linuxforu.com/tag/mac-addresses/" title="MAC addresses" rel="tag">MAC addresses</a>, <a href="http://www.linuxforu.com/tag/microsoft/" title="Microsoft" rel="tag">Microsoft</a>, <a href="http://www.linuxforu.com/tag/microsoft-sql-server/" title="Microsoft SQL Server" rel="tag">Microsoft SQL Server</a>, <a href="http://www.linuxforu.com/tag/mysql/" title="MySQL" rel="tag">MySQL</a>, <a href="http://www.linuxforu.com/tag/nat/" title="NAT" rel="tag">NAT</a>, <a href="http://www.linuxforu.com/tag/network-layer/" title="network layer" rel="tag">network layer</a>, <a href="http://www.linuxforu.com/tag/oracle/" title="Oracle" rel="tag">Oracle</a>, <a href="http://www.linuxforu.com/tag/osi/" title="osi" rel="tag">osi</a>, <a href="http://www.linuxforu.com/tag/osi-model/" title="OSI model" rel="tag">OSI model</a>, <a href="http://www.linuxforu.com/tag/security-solution/" title="security solution" rel="tag">security solution</a>, <a href="http://www.linuxforu.com/tag/server-farm/" title="server farm" rel="tag">server farm</a>, <a href="http://www.linuxforu.com/tag/sql-injections/" title="SQL injections" rel="tag">SQL injections</a>, <a href="http://www.linuxforu.com/tag/ssl/" title="SSL" rel="tag">SSL</a>, <a href="http://www.linuxforu.com/tag/surveillance-systems/" title="surveillance systems" rel="tag">surveillance systems</a>, <a href="http://www.linuxforu.com/tag/sybase/" title="Sybase" rel="tag">Sybase</a>, <a href="http://www.linuxforu.com/tag/web-applications/" title="web applications" rel="tag">web applications</a>, <a href="http://www.linuxforu.com/tag/web-server-connections/" title="Web-server connections" rel="tag">Web-server connections</a><br /> ]]></content:encoded> <wfw:commentRss>http://www.linuxforu.com/2011/05/securing-database-servers/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Sniff! Sniff!! Who Clogs My Network?</title><link>http://www.linuxforu.com/2009/01/who-clogs-my-network/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=who-clogs-my-network</link> <comments>http://www.linuxforu.com/2009/01/who-clogs-my-network/#comments</comments> <pubDate>Thu, 01 Jan 2009 11:55:05 +0000</pubDate> <dc:creator>Sitaram Chamarty</dc:creator> <category><![CDATA[Overview]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Sysadmins]]></category> <category><![CDATA[ifconfig]]></category> <category><![CDATA[iftop]]></category> <category><![CDATA[iptraf]]></category> <category><![CDATA[mtr]]></category> <category><![CDATA[Networking]]></category> <category><![CDATA[ping]]></category> <category><![CDATA[traceroute]]></category><guid isPermaLink="false">http://www.linuxforu.com/?p=167</guid> <description><![CDATA[Some network connectivity and troubleshooting tools.]]></description> <content:encoded><![CDATA[<p>What do you do when you’ve just set up a network and the basic stuff is all fine, but something is still wrong. For instance, you’re able to ping one host, but not another? Or connectivity to some sites is slow, though to most other sites it appears to be fast enough, and your ISP say it’s not their headache?</p><p>In this article, we’ll run through some of my favourite tools for network troubleshooting. If you’re a network admin, you might find these tools useful. However, I have tried, as usual, to favour concepts and description over detailed command information, so even a normal home user might find this article interesting as a casual read. I expect anyone with a serious interest in one of the tools to check out the man pages or other documentation anyway.</p><h2>All at sea</h2><p>I’m an avid quizzer, as I’m sure some of you are. I sometimes conduct quizzes too, and one of my favourite questions is: what is the connection between the Sonar equipment used in a submarine and modern networking? Of course, it’s the humble <code>ping</code> command, which was named after the sound that a Sonar makes in a submarine. If you’ve seen <em>Hunt for Red October</em> you’ll know :-) So, continuing the marine theme, ping is the first port of call when you have a network problem, and naturally, everyone knows how to use it to check if some host is up.</p><div id="attachment_294" class="wp-caption alignright" style="width: 300px"><a href="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-1.png?d9c344"><img class="size-medium wp-image-294" title="lfy-netts-1" src="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-1-300x120.png?d9c344" alt="Figure 1: The output of a ping command" width="300" height="120" /></a><p class="wp-caption-text">Figure 1: The output of a ping command</p></div><p>But is that all <code>ping</code> can do? Even in the normal run, there’s important information. Figure 1 shows a typical <code>ping</code> output.</p><p>There’s a very important number that ping shows, called the ‘round trip time’ (RTT). RTT is a measure of how close a host is to you, based on how long it takes a packet to go out and come back again. RTT on a LAN tends to be less than a millisecond, while 2-3 milliseconds (as in Figure 1) is more typical of a wireless network. RTTs on WAN links are more in the 200-600 millisecond range, reflecting the number of routers that they have to go through.</p><p><code>ping</code> can also get you clued into an unreliable connection, by showing a packet loss in the status line (the last line but one above). For instance, it might say “50 packets transmitted, 47 received, 6% packet loss, time 44754ms,” which would indicate a pretty bad connection.</p><p>But this information only shows up at the end, after you kill <code>ping</code>. What if you want to keep the ping running for a while and continuously see how reliable the connection is? Well, you can watch the ICMP sequence number to make sure it increases exactly by one and doesn’t skip a few, but that’s too tedious to keep up for a long time. I mean, that’s what computers are for, right—to do the tedious stuff? So can the humble <code>ping</code> command do anything more?</p><p>Turns out it can, and in a very imaginative and simple way! The command to use is <code>ping -f -i 1 host</code>. With the <code>-f</code> option, ping prints a “.” for every outgoing packet and a back-space for every reply. Thus the number of dots on the display is the number of ping packets that have not yet been acknowledged by the remote side. A fast and reliable connection will not show you a single dot—every dot will be cancelled by a back-space well before the next dot appears, so the cursor sits on the left of the screen and nothing seems to be happening.</p><p>If you see the number of dots increasing gradually, you know there are packet losses happening on the link. It’s actually a pretty cool display, but in order to see it, you have to test it against an unreliable server or an unreliable network. For most home users, the best way to do this is to use a laptop to ping a wireless router, and gradually move the laptop further and further away from the access point.</p><p>When you use <code>-f</code>, don’t forget the 1-second interval flag (<code>-i 1</code>). Otherwise, you get what is called a ‘flood ping’, which can look like a Denial of Service attack to the target host, and they might complain (or worse, retaliate). In fact, a fast machine on a fast network can bring down a network using a &#8216;flood ping&#8217; without an interval specified! However, if the target host is yours or you have permission to do so, it can be fun to try something like <code>ping -f -c 500 -s 1400 host</code>. The laptop + wireless method of simulating a flaky connection is really useful to see this in action. Also, try different values for the packet size (the <code>-s</code> option).</p><p>This is not just fun—you’ll start to recognise that this simple dot pattern can clue you into troublesome connections very quickly, although once again, I must repeat that <code>-f</code> without <code>-i 1</code> should be used very carefully and sparingly, and only on your own hosts.</p><h2>Who’s dropping the ball?</h2><p>So you have a flaky connection to your office network…and your VPN keeps dropping off. Or your YouTube feed is constantly stopping to buffer; I mean, we know which is more likely, right?</p><p>A &#8216;flood ping&#8217; tells you there are lots of dropped packets but doesn’t tell you where or who’s responsible. If you’ve ever done a <code>traceroute</code>, you know there are multiple hosts in between yourself and the target, and it may be useful to know where among these hops the packet loss is occurring.</p><div id="attachment_296" class="wp-caption alignright" style="width: 300px"><a href="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-2.png?d9c344"><img class="size-medium wp-image-296" title="lfy-netts-2" src="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-2-300x116.png?d9c344" alt="Figure 2: An example mtr output" width="300" height="116" /></a><p class="wp-caption-text">Figure 2: An example mtr output</p></div><p>This is what <code>mtr</code> shows you: it shows where the packet loss is happening, in real time, using ICMP ECHO requests (i.e., ping packets). It’s one of the best tools for figuring out where the problems are, with a simple but really useful display, including a quick online help screen. The default screen looks like Figure 2, once it’s started up, though, of course, it’s continuously updating.</p><p>You can quickly see which intermediate router is losing the most packets, as well as which ones are taking the most amount of time to reply. An even more useful display is obtained by hitting <em>j</em>, which shows you packet loss in absolute numbers instead of percentages. More importantly, it also shows you something called ‘jitter’, which means inconsistency in response times. You can also think of jitter as a measure of transient or occasional congestion in that link, causing only delays for now, though if the quality degrades further, there may be packet loss too. Seasoned travellers know that when too many flights show a ‘delayed’ status, sooner or later some will go from ‘delayed’ to ‘cancelled’—this is pretty much the same thing.</p><div id="attachment_298" class="wp-caption alignright" style="width: 300px"><a href="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-3.png?d9c344"><img class="size-medium wp-image-298" title="lfy-netts-3" src="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-3-300x133.png?d9c344" alt="Figure 3: Display mode in mtr shows actual timing from the last 50 ping sequences" width="300" height="133" /></a><p class="wp-caption-text">Figure 3: Display mode in mtr shows actual timing from the last 50 ping sequences</p></div><p>The best feature of <code>mtr</code> can be seen by cycling the display mode (by pressing <em>d</em>). This is a very interesting display, showing the actual timing results from the last 50 ping sequences (or more, if your screen is wider). A “.” means a reply was received, a “&gt;” means it was received but took a long time, and a “?” means it has not been received yet. If you cycle the display mode again, the display changes to show 6 levels of granularity in the RTT, and a scale at the bottom to say what these levels mean. For example, in Figure 3, a “1” means a reply was received more than 5 but less than 14 ms later, and a “&gt;” means a response packet was received more than 222 ms later.</p><p>This is a very cool display—and I can tell you from personal experience that it never fails to impress when you’re trying to prove to someone that the problem is on <em>their</em> router! Most Windows-type admins are left speechless—although that’s probably because they are trying to digest the fact that you don’t need a bloated GUI framework to get useful work done!</p><h2>Moving up a layer or two</h2><p>However, it often happens that the system we are trying to trace does not accept ICMP (pings) or UDP (traceroute)—most security conscious admins disable everything that is not absolutely needed, and if it’s a public Web server, it may only allow HTTP/HTTPS (ports 80/443). For times like this, you could just use the <code>traceroute</code>’s <code>-T</code> option, which uses TCP instead of UDP. It works pretty well, although this is not a continuously running program, so it tells you about connectivity and RTT for one round only.</p><div id="attachment_295" class="wp-caption alignright" style="width: 300px"><a href="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-4.png?d9c344"><img class="size-medium wp-image-295" title="lfy-netts-4" src="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-4-300x182.png?d9c344" alt="" width="300" height="182" /></a><p class="wp-caption-text">Figure 4: lft shows what&#39;s in between and who owns what</p></div><p><a href="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-4.png?d9c344"><br /> </a>However, we may want to find out who owns a particular network. When you need that, <code>lft</code> (Layer Four Trace) is pretty useful. Above and beyond what <code>traceroute</code> can do, <code>lft</code> can show if there are any firewalls in between, as well as what organisation owns those gateways or routers, as you can see in Figure 4.</p><h2>Thinking local; iftop and iptraf</h2><p>So let’s say you’ve figured out who or what is slowing down your packets and (hopefully) got someone to fix it. Your traffic is moving pretty smoothly, and everyone is happy.</p><p>Actually, some people are too happy—they’re hogging all the bandwidth! You need to find out who they are and have a quick word with them. The only question is: who is hitting the net so badly and what site are they hitting?</p><p>Even if you’re not a Simon Travaglia, and you have only your own machine to worry about, perhaps you suddenly noticed a lot of activity on the network monitor (you do use one, right? I suggest <code>conky</code> for low-end machines and <code>gkrellm</code> for all others!) and you’re wondering what program is doing it and why.</p><p>While <code>netstat</code> can certainly be used to give you this sort of information, there is another tool that has become a very useful part of my toolkit now, which is called <code>iftop</code>. It’s a pretty old tool, and it hasn’t been updated in a couple of years, but don’t let that stop you from trying it.</p><div id="attachment_299" class="wp-caption alignright" style="width: 300px"><a href="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-5.png?d9c344"><img class="size-medium wp-image-299" title="lfy-netts-5" src="http://cdn.linuxforu.com/wp-content/uploads/temp-uploads/2009/05/lfy-netts-5-300x240.png?d9c344" alt="Figure 5: iftop -nNPB on a lightly-loaded system" width="300" height="240" /></a><p class="wp-caption-text">Figure 5: iftop -nNPB on a lightly-loaded system</p></div><p><code>iftop</code> is an interactive program with a number of cool features, all of them accessible by typing some key, and it has a quick one-screen online help in case you forget the keys. Running <code>ifopt -nNPB</code> on a lightly-loaded system might look like the output shown in Figure 5.</p><p>The display is quite self-explanatory, except for the last three columns in the main display. These are averages of the data transferred over the previous 2, 10 and 40 seconds, respectively.</p><p>The black bars are important. Across the very top is the ‘scale’ for all the bars, and the bars actually represent the 10-second average (the middle column) by default, although pressing “B” will cycle between 2, 10, and 40-second averages. This way you get a visual indication of what hosts and ports are hogging the traffic.</p><p>You can do some cool things here—you can choose to look only at outgoing or incoming traffic or perhaps the sum of the two (press <em>t</em> to cycle between these modes). You can aggregate all traffic for each source into one line by pressing s, and for each destination by pressing <em>d</em>. Be sure to read the online help as well as the man page—it’s worth it.</p><p>What’s even more cool is that there are two filters to limit the output. Typing l enables a ‘display filter’—the pattern or string you enter will be applied to the host+port field and used to filter lines appearing in the display. This is a literal match: for example, if you type “pop3” as the search filter, then use “N” to disable port number resolution, you’ll have to change the search string to “:110” in order for it to match. The same goes for host names versus IP addresses.</p><p>Using <em>l</em> only affects the display; the totals still count all the traffic. On the other hand, you can use f to set a packet filter condition that will stop traffic that does not match, from even coming into the program. For instance, you can type “f” then “port 25” to see only SMTP traffic. This filter can take quite complex conditions, using the same syntax that popular tools like <code>tcpdump</code>, etc, use. Plus, this filter can be specified from the command line too, like:</p><pre>iftop -nBP -f ‘port 22’</pre><p>All in all, this is a pretty nice tool to keep an eye on things once in a while or perhaps when someone complains things are a little slow.</p><p><code>iptraf</code> is also a very nice and easy-to-use tool, with a very neat curses GUI. It actually has a lot more features than <code>iptraf</code>—the IP interface monitor shows you TCP and UDP separately, and for TCP it shows you packet flags (making it easy to identify connection attempts that are not succeeding, for instance). Overall statistics for each interface are also available in a separate screen, and on the whole it’s almost a real GUI (using curses), with menus and sub-menus, etc. It also has a very slick filter specification GUI, if you’re not the command line type.</p><p>Despite all this, however, I find myself using <code>iftop</code> for day to day use, because <code>iptraf</code> lacks the aggregation, multiple averages, quick and easy filtering, etc, that <code>iftop</code> does. Plus, most of the filters I want are much easier to type into <code>iftop</code> or at the command line.</p><h2>Some last words</h2><p>I don’t use these tools every day, but when I needed them, they were really useful. Could I have gotten by without knowing them? Maybe… but that’s not how we think, is it? A workman needs as many tools as he can get his hands on, and these are some of mine.</p><p>Among these, <code>iftop</code> remains the one I use more often than the others. It’s actually closer to monitoring than troubleshooting, but they’re all great tools, and exploring them gives you an understanding of what’s happening under the hood as your machine goes about its daily business.<div id="crp_related"><h5>Related Posts:</h5><ul><li><a href="http://www.linuxforu.com/2010/12/advanced-nmap-scanning-techniques-continued/" rel="bookmark" class="crp_title">Advanced Nmap: Scanning Techniques Continued</a></li><li><a href="http://www.linuxforu.com/2009/08/dabble-with-netkit-to-sandbox-a-network/" rel="bookmark" class="crp_title">Dabble with Netkit to Sandbox a Network</a></li><li><a href="http://www.linuxforu.com/2010/11/advanced-nmap-some-scan-types/" rel="bookmark" class="crp_title">Advanced NMap: Some Scan Types</a></li><li><a href="http://www.linuxforu.com/2010/08/nmap-basics/" rel="bookmark" class="crp_title">Learning Nmap: The Basics</a></li><li><a href="http://www.linuxforu.com/2011/05/advanced-nmap-a-recap/" rel="bookmark" class="crp_title">Advanced Nmap: A Recap</a></li></ul></div>Tags: <a href="http://www.linuxforu.com/tag/ifconfig/" title="ifconfig" rel="tag">ifconfig</a>, <a href="http://www.linuxforu.com/tag/iftop/" title="iftop" rel="tag">iftop</a>, <a href="http://www.linuxforu.com/tag/iptraf/" title="iptraf" rel="tag">iptraf</a>, <a href="http://www.linuxforu.com/tag/mtr/" title="mtr" rel="tag">mtr</a>, <a href="http://www.linuxforu.com/tag/networking/" title="Networking" rel="tag">Networking</a>, <a href="http://www.linuxforu.com/tag/ping/" title="ping" rel="tag">ping</a>, <a href="http://www.linuxforu.com/tag/security/" title="Security" rel="tag">Security</a>, <a href="http://www.linuxforu.com/tag/traceroute/" title="traceroute" rel="tag">traceroute</a><br /> ]]></content:encoded> <wfw:commentRss>http://www.linuxforu.com/2009/01/who-clogs-my-network/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Content Delivery Network via cdn.linuxforu.com

Served from: www.linuxforu.com @ 2012-02-08 09:39:26 -->
