<?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>Haiders WebSpace &#187; Networking</title>
	<atom:link href="http://blog.creativeitp.com/category/posts-and-articles/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.creativeitp.com</link>
	<description>Let&#039;s talk about IT</description>
	<lastBuildDate>Sat, 27 Feb 2010 13:15:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Exploring Idle Scan/Zombie Scan</title>
		<link>http://blog.creativeitp.com/posts-and-articles/networking/exploring-idle-scanzombie-scan/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/networking/exploring-idle-scanzombie-scan/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 17:19:10 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=328</guid>
		<description><![CDATA[Idle scan or Zombie scanning as it is referred to sometimes, is the newest and stealthiest TCP scanning technique supported by the famous Nmap. What makes it quite interesting, is that an attacker can use it to scan a target and blame it on an innocent Zombie machine. Before explaining how it can be done, [...]]]></description>
			<content:encoded><![CDATA[<p><b>Idle</b> scan or <b>Zombie</b> scanning as it is referred to sometimes, is the newest and stealthiest TCP scanning technique supported by the famous <b>Nmap</b>. What makes it quite interesting, is that an attacker can use it to scan a target and blame it on an innocent Zombie machine.<br />
Before explaining how it can be done, let me start with a brief explanation of the <b>Three-Way Handshake</b> used to start TCP connections between any two computers.</p>
<p><span id="more-328"></span></p>
<p><b>TCP Three-Way Handshake</b></p>
<p>Figure 1 illustrates how it works. Computer A sends a SYN asking computer B to establish a connection on port 80, if the port is open, then B acknowledges the SYN and send SYN in return as well. Third and final step is when A acknowledges that it also received the SYN from B.</p>
<p>If port 80 is closed, B will respond with RST.</p>
<p>Before proceeding to the following illustration, refresh your mind with the following list of <b>TCP Communication Flags</b>:</p>
<ul>
<li>Synchronize (<b>SYN</b>): Initiates connection between hosts.</li>
<li>Acknowledgment (<b>ACK</b>): Establish connection between hosts.</li>
<li>Push (<b>PSH</b>): System accepting requests and forwarding buffered data.</li>
<li>Urgent (<b>URG</b>): Instructs data contained in packets to be processed ASAP.</li>
<li>Finish (<b>FIN</b>): Communicates to the remote system of no more retransmissions.</li>
<li>Reset (<b>RST</b>): Reset a connection.</li>
</ul>
<div id="attachment_329" class="wp-caption aligncenter" style="width: 469px"><img src="http://blog.creativeitp.com/wp-content/uploads/2010/02/tcp-three-way-handshake.png" alt="" title="tcp-three-way-handshake" width="459" height="471" class="size-full wp-image-329" /><p class="wp-caption-text">TCP Three-Way Handshake</p></div>
<p>Port scanning is used to check which ports are open by sending and receiving packets directly between two computers. In SYN Stealth (Also known as Half Open Scan) for example Computer A sends SYN to B, If the port is Computer  B is open, the reply will be: SYN+ACK based on the Three-Way Handshake rules. Otherwise, if B respond with a RST, then the port is closed or not listening.<br />
SYN Stealth and other types of scaning expose the scanners IP to the targeted computer. To overcome that, Idle scan is used.</p>
<p><b>How Idle Scan works</b></p>
<p>Every IP packet on the internet has a fragment identification numer (IP ID), which is usually incremented by one by the operating system for every packet transmission. Hence, if we record the IP ID of a computer, we can compute the number of packets it sent after certain time.</p>
<p>Now, assume that Computer A wants to scan Computer B, while Computer C is being used as a Zombie.</p>
<ul>
<li> <b>A</b> will first ask to communicate with <b>C</b>, from<b> C</b>’s response, <b>A</b> knows that <b>C</b>’s IP ID is: 1445.</li>
<li> <b>A</b> sends SYN to one of<b> B</b>’s ports asking for a connection using <b>C</b>’s IP address.</li>
<li><b>B</b> respond to the relevant IP address, that is <b>C</b> with a SYN+ACK if the port is open, else if the port is closed, then it will send back a RST or nothing at all.</li>
<li><b>A</b> ask to communicate with <b>C</b> one more time to read its IP ID again.
<li> If the IP ID is 1447 (increased by two since the last transmission) then the port is open assuming that <b>B</b> responded with a SYN/ACK back to <b>C</b>, hence<b> C</b>  had to reply with a RST packet using IP ID = 1446.</li>
<li>Else  If the IP ID is 1446, (increased by one since the last transmission) then the port is close, assuming that <b>B</b> simply responded with a RST or nothing at all, hence <b>C</b> did not have to communicate back.</li>
</ul>
<p>You must have noticed that, to collect reliable data, it is important that computer C does not communicate with any other devices while running the scan, otherwise, its IP ID will increase dramatically anyway. This is why, the zombie device should be chosen carefully to be Idle, hence the name of the scan.</p>
<p>Also, as you must have noticed, the scan was performed by sending packets with spoofed IP to the target computer. Hence the spoofed IP is blamed for the scan, not yours!</p>
<p>In practice, the following Nmap command is an example of how to perform Idle scans:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nmap</span> <span style="color: #660033;">-PN</span> <span style="color: #660033;">-p20-25</span> <span style="color: #660033;">-sI</span> 192.168.1.152 192.168.0.131</pre></div></div>

<p><b>-sI</b>: is used to run Idle Scan.<br />
<b>-PN</b>: is necessary for stealth, otherwise packets would be sent to the target from your real addres.<br />
<b>-p20-25</b>: scan ports 20, 21, 23, 24 and 25.<br />
<b>192.168.1.152</b>: Zombie IP.<br />
<b>192.168.0.131</b>: Target IP.</p>
<p>At the end, here is a reminder that you should not scan any computer/network without permission. There are many known cases where using Nmap unethically caused serious legal issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/networking/exploring-idle-scanzombie-scan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Share Windows Internet Connection with Linux</title>
		<link>http://blog.creativeitp.com/posts-and-articles/windows/share-windows-internet-connection-with-linux/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/windows/share-windows-internet-connection-with-linux/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 20:16:37 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=301</guid>
		<description><![CDATA[This article is for you if you have internet connection in your Windows and would like to share it with a Linux box as well. To do that your windows machine should have two network cards connected, one for the internet service and the other one to connect to your other machine or to a [...]]]></description>
			<content:encoded><![CDATA[<p>This article is for you if you have internet connection in your Windows and would like to share it with a Linux box as well. To do that your windows machine should have two network cards connected, one for the internet service and the other one to connect to your other machine or to a hub/switch if you want to share it with more computers.</p>
<p><span id="more-301"></span><br />
Connect the cables. Once done, you should first enable Internet Connection Sharing on your Windows machine. To do that, right-click your Internet connection and select &#8220;<b>Properties</b>&#8220;. Then click the &#8220;<b>Advanced</b>&#8221; tab. Now simply put a tick on the following option:</p>
<p>&#8220;<i>Allow other network users to connect through this computer&#8217;s Internet connection</i>&#8221;</p>
<p>This should give your Network card the following static IP address: <b>192.168.0.1</b>. This address will represent the gateway address for the other computers in your LAN to connect to the Internet. </p>
<p>Now, move to your Linux box and use the following command to give it an IP address and a Subnet Mask:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0 192.168.0.131 netmask 255.255.255.0</pre></div></div>

<p>The following command is then used to set the default gateway</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">route add <span style="color: #660033;">-net</span> default gw 192.168.0.1</pre></div></div>

<p>Finally, you will need to update your Linux DNS servers file. Get the two DNS servers IPs by typing<br />
&#8220;<b>Ipconfig /all</b>&#8221; In the command prompt of your Windows machine, and then add them to &#8220;<b>/etc/resolv.conf</b>&#8221; in your Linux using your favorite editor. For instance, to open the file with nano use the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf</pre></div></div>

<p>That’s all, try to test the connection between the two computers by pinging their IP addresses and then test your DNS configuration with any of the following commands from your Linux box:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">host google.com
&nbsp;
nslookup google.com
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ping</span> google.com</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/windows/share-windows-internet-connection-with-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Traceroute</title>
		<link>http://blog.creativeitp.com/posts-and-articles/networking/visual-traceroute/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/networking/visual-traceroute/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 01:56:13 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=271</guid>
		<description><![CDATA[Traceroute is a famous program to draw the route taken by packets from your computer to any destination you chose. It uses UDP or ICMP echo packets with TTL value of one, then continuously increase it until it reaches the destination, this way it can get time exceeded responses from every hop in the pathway. [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_272" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.creativeitp.com/wp-content/uploads/2010/01/VisualRoute.png" target="_blank"><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/VisualRoute-300x162.png" alt="" title="VisualRoute" width="300" height="162" class="size-medium wp-image-272" /></a><p class="wp-caption-text">VisualRoute</p></div>
<p>Traceroute is a famous program to draw the route taken by packets from your computer to any destination you chose.  It uses UDP or ICMP echo packets with TTL value of one, then continuously increase it until it reaches the destination, this way it can get time exceeded responses from every hop in the pathway. </p>
<p><span id="more-271"></span><br />
There is also TCP Traceroute programs which can be useful to bypass some firewalls filtering.</p>
<p>Similar techniques like Dig, Host for UNIX-like systems and PathPing for Windows may also be used to achieve similar results, but all these are command based. Although, using the Terminal is great pleasure, but it is always nice when these locations are illustrated on a real world map in addition to different forms of diagrams. To get such results, I suggest two tools I have used: <a href="http://www.networkingfiles.com/neotrace/" target="_blank">NeoTrace Pro</a> and <a href="http://www.visualroute.com/" target="_blank">VisualRoute</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/networking/visual-traceroute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hubs, Bridges, Switches, Routers and Gateways</title>
		<link>http://blog.creativeitp.com/posts-and-articles/networking/hubs-switches-routers-and-bridges/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/networking/hubs-switches-routers-and-bridges/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 15:30:44 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=121</guid>
		<description><![CDATA[Hubs, Bridges, Switches and Routers are used to build networks. If you are trying to design your own LAN (Local Area Network) at home, then you probably need to know what they do and the main differences between them. I will try to cover all that in addition to some networking details to cultivate the [...]]]></description>
			<content:encoded><![CDATA[<p>Hubs, Bridges, Switches and Routers are used to build networks. If you are trying to design your own LAN (Local Area Network) at home, then you probably need to know what they do and the main differences between them. I will try to cover all that in addition to some networking details to cultivate the article and provide better understanding of how the internet works. After all, always remember that the internet as you know it is nothing more than a network of networks!</p>
<p><span id="more-121"></span><br />
<b>Hubs</b> are used to build a LAN by connecting different computers in a star/hierarchal network topology, the most common type on LANs now a day. A hub is a very simple (or dumb) device, once it gets bits of data sent from computer A to B, it does not check the destination, instead, it forwards that signal to all other computers (B, C, D…) within the network. B will then pick it up while other nodes discard it. This amplifies that the traffic is shared.</p>
<p>There are mainly two types of hubs: </p>
<p>1. Passive: The signal is forwarded as it is (so it doesn’t need power supply).<br />
2. Active: The signal is amplified, so they work as repeaters. In fact they have been called multiport repeaters. (use power supply) </p>
<p>Hubs can be connected to other hubs using an uplink port to extend the network.</p>
<p>OSI Model: Hubs work on the physical layer (lowest layer). That’s the reason they can’t deal with addressing or data filtering.</p>
<p><strong>Switches</strong> on the other hand are more advanced. Instead of broadcasting the frames everywhere, a switch actually checks for the destination MAC address and forward it to the relevant port to reach that computer only. This way, switches reduce traffic and divide the collision domain into segments, this is very sufficient for busy LANs and it also protects frames from being sniffed by other computers sharing the same segment.</p>
<p>They build a table of which MAC address belongs to which segment. If a destination MAC address is not in the table it forwards to all segments except the source segment. If the destination is same as the source, frame is discarded.</p>
<p>Switches have built-in hardware chips solely designed to perform switching capabilities, therefore they are fast and come with many ports. Sometimes they are referred to as intelligent bridges or multiport bridges.<br />
Different speed levels are supported. They can be 10 Mb/s, 100 Mb/s, 1 Gb/s or more.</p>
<p>Most common switching methods are:</p>
<p>1. Cut-through: Directly forward what the switch gets.<br />
2. Store and forward: receive the full frame before retransmitting it.</p>
<p>OSI: Switches are on the data link layer (just above physical layer) that’s why they deal with frames instead of bits and filter them based on MAC addresses. Switches are known to be used for their filtering capabilities.</p>
<p>VLANs (Virtual LANs) and broadcast domains: Switches do not control broadcast domains by default, however, if a VLAN is configured in a switch it will has its own broadcast domain.</p>
<p><strong>*</strong>VLAN is a logical group of network devices located on different LAN physical segments. However they are logically treated as if they were located on a single segment.</p>
<p><strong>Bridges</strong> are used to extend networks by maintaining signals and traffic.<br />
OSI: Bridges are on the data link layer so in principle they are capable to do what switches do like data filtering and separating the collision domain, but they are less advanced. They are known to be used to extend distance capabilities of networks. </p>
<p>In a comparison with switches, they are slower because they use software to perform switching. They do not control broadcast domains and usually come with less number of ports.</p>
<p><strong>Routers</strong> are used to connect different LANs or a LAN with a WAN (e.g. the internet). Routers control both collision domains and broadcast domains. If the packet’s destination is on a different network, a router is used to pass it the right way, so without routers the internet could not functions. </p>
<p>Routers use NAT (Network Address Translation) in conjunction with IP Masquerading to provide the internet to multiple nodes in the LAN under a single IP address. </p>
<p>Now a day, routers come with hub or switch technology to connect computers directly.</p>
<p>OSI: Routers work on the network layer so they can filter data based on IP addresses. They have route tables to store network addresses and forward packets to the right port.</p>
<p><strong>Gateways</strong> are very intelligent devices or else can be a computer running the appropriate software to connect and translate data between networks with different protocols or architecture, so their work is much more complex than a normal router. For instance, allowing communication between TCP/IP clients and IPX/SPX or AppleTalk.</p>
<p>OSI: Gateways operate at the network layer and above, but most of them at the application layer.</p>
<p>P.S. The term Gateway is used to refer to routers in some articles so beware. In this case, the router has gateway software. And Default Gateway is used to refer to the node (e.g. router) connecting the LAN to the outside (e.g. internet).</p>
<p><strong>Repeaters</strong> are simple devices that work at the physical layer of the OSI. They regenerate signals (active hubs does that too).</p>
<p>There is an important rule to obey while using repeaters/hubs to extend a local network and is called the 5-4-3 rule or the IEEE way. The rule forces that in a single collision domain there shouldn’t be more than 5 segments, 4 repeaters between any two hosts in the network and only 3 of the segments can be populated (contain user connections).<br />
This rule ensures that a signal sent over the network will reach every part of it within an acceptable length of time. <br />
If the network is bigger, the collision domain can be divided into two parts or more using a switch or a bridge.</p>
<p><strong>Conclusion</strong></p>
<p>What have been introduced so far are the main traditional devices used to build networks, understanding how they work helps to understand the logic behind networks designing, however, now that technology advance quickly, it is possible to find new products in the market combining two or more of these devices into one. </p>
<p>Examples are:</p>
<p>- Brouter: Works as a Bridge and as a Router.<br />
- IP Switch or MultiLayer Switch (MLS): New switches with routing capabilities, they forward data based on IP addresses, work at the network layer too.</p>
<p>References used are the following in addition to my previous readings and background study.</p>
<p>[1] <em>TCP IP in 24 hours</em> by SAMS<br />
[2] http://www.techexams.net/technotes/ccna/lan_technologies.shtml<br /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/networking/hubs-switches-routers-and-bridges/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
