<?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>TAZ: TheTAZZone Network &#187; networking tutorials</title>
	<atom:link href="http://www.thetazzone.com/category/security-tutorials/networking-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetazzone.com</link>
	<description>Welcome to Internet Chaos: 960+ Games; Security, Networking, and General Tutorials; IRC Chat; and an Active Forum Community</description>
	<lastBuildDate>Sun, 22 Nov 2009 02:06:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tutorial &#8211; How Networks and Network Attacks Work</title>
		<link>http://www.thetazzone.com/tutorial-how-networks-and-network-attacks-work/</link>
		<comments>http://www.thetazzone.com/tutorial-how-networks-and-network-attacks-work/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 01:17:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[exploits]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=792</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=473">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<p><span style="text-decoration: underline;"><span style="font-weight: bold;">How Networks and Network Attacks Work </span></span></p>
<p>To attack a network there is a need to understand fully, the rules and protocols that a network follows.<br />
Once you have a good understanding of these, you can start to understand how various attacks work.</p>
<p>When the time comes that you know how these attacks work, then and only then, can you go about securing it, with a confident<br />
knowledge that you know what it is you are defending against.</p>
<p>The aim of this paper is to help explain how a network operates and how various attacks work.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>For a network to operate effectively, there is a requirement for a set of rules that everything on that network must follow.</p>
<p>It must have its own language that everything on it understands and it must have it own way of transmitting things in this<br />
language to other parts of its network. However as there are many networks in many different countries this standard needs to<br />
be a universal one, to allow networks to talk to other networks across the world.</p>
<p>If someone from England was to phone up someone in Russia the chances are they wouldn’t be able to communicate too well.<br />
But if a network were to send a data packet to a network in Russia, it would be received and processed in the correct way.</p>
<p>This is because all networks follow protocols defined by what is known as the Open Systems Interconnection model (OSI)</p>
<p><span style="font-weight: bold;">The OSI Model: </span></p>
<p>The OSI model provide a set of rules and protocols that enable any network following them to talk to any other network that<br />
also follows them.</p>
<p>The rules that make up the OSI are arranged into seven different layers that are all interconnected with each other.</p>
<p>These are:</p>
<p>1) Physical Layer</p>
<p>2) Data Link Layer</p>
<p>3) Network Layer</p>
<p>4) Transport Layer</p>
<p>5) Session Layer</p>
<p>6) Presentation Layer</p>
<p>7) Application Layer</p>
<p>I’ve always found it easier to look on these as different stages a data packet must pass through, at each stage something<br />
is added to the packet and when it is received the same thing is taken away from it by the corresponding stage in the other<br />
network</p>
<p><span style="font-weight: bold;"><br />
Physical Layer: </span></p>
<p>As its name suggests this is the physical connection between two pieces of hardware. So we are talking about the actual Ethernet cable and Network Interface Card (NIC) &#8211; hubs are also considered layer one devices. Its major function is to<br />
communicate raw bit streams (The Ones and Zeros). It is responsible for the activation and deactivation of these bit stream<br />
communications. It is also responsible for the defining of the actual cable attachments to the NIC&#8217;s and how they work.<br />
This is the lowest layer.</p>
<p><span style="font-weight: bold;">Data Link:</span></p>
<p>This layer is what deals with the transfer of the data between two points on the network. If the Physical layer<br />
is what is used to pass the raw bits, this is what actually sends them on their way. It also provides error and flow control<br />
of the data packets that are sent and received. MAC addressing is found here &#8211; layer 2 switches are also found here &#8211; funnily enough. (A MAC address is commonly called a Layer 2 address due to where is sits in the OSI model)</p>
<p><span style="font-weight: bold;">Network Layer: </span></p>
<p>I will go into more depth on this later on. This layer provides the addressing and routing of the data and acts as a<br />
kind of middle ground between the upper layers and the lower layers.</p>
<p><span style="font-weight: bold;">Transport Layers:</span></p>
<p>Again this will be explained in more detail later. This is where TCP comes into the process by providing a reliable<br />
and stable method of passing the data packet.</p>
<p><span style="font-weight: bold;">Session Layer: </span></p>
<p>This is what actually establishes the connections between network applications and then maintains that connection. It also keeps the sessions separate. (A session loosely refers to a connection, so if you are viewing a web page via IE and also sending an email via Outlook then there will be two separate sessions. This layer will ensure data from one session will not end up in the other session.)</p>
<p><span style="font-weight: bold;">Presentation Layer: </span></p>
<p>This is what translates the data provided by the application in use, into a format that the rest of the<br />
OSI model understands and can work with and vice versa when the data is received, it translates it back into a language<br />
for the application to work with. So to go back to our web page an email example, data is sent in binary over a network, however, if this was displayed in IE and Outlook in this format you would be pretty confused, so something needs to translate the data into an email or a web page and pass it up to the correct application. This layer also handles encryption<br />
and compression.</p>
<p><span style="font-weight: bold;">Application Layer: </span></p>
<p>This is used for applications that can support and use network services such as, DNS, FTP, TELNET, SMTP<br />
and NetBIOS type applications</p>
<p>So when you send a data packet it starts at the application layer, then the presentation layer wraps its bit of information<br />
around the packet, then the session layer does the same and so on until the packet reaches the Physical layer where it<br />
is passed to where ever it needs to go.</p>
<p>This whole process is known as Encapsulation.</p>
<p>That’s the seven layers of the OSI model.</p>
<p>Now that we know about the methods used to pass data, lets talk about what it actually is that gets passed around.</p>
<p>When information is getting passed around the network it is transmitted in small chunk of data called a Packet.( In truth the terminology changes depending on where in the OSI model the data is &#8211; at layers 7, 6, 5 and 4 it is simply called Data, at layer 3 it is called a Packet, at layer 2 it is called a Frame and then at layer one it is referred to a bits (binary bits that is). To avoid confusion data in transit is generically called a Datagram or a Packet.</p>
<p>As the packet passes through each layer small bits of data are added to it or taken away from it depending on if the<br />
packet is being transmitted or received.</p>
<p>A data packet has both a body and a header. The Body obviously contains the message that is being passed, whilst the<br />
header contains things like: The Source IP address, the destination IP address, the total data length, what protocols<br />
are being used, checksum information. See here for more info on headers:</p>
<p><!-- m --><a class="postlink" href="http://www.networksorcery.com/enp/protocol/ip.htm">http://www.networksorcery.com/enp/protocol/ip.htm</a></p>
<p><!-- m --></p>
<p><span style="font-weight: bold;">Network Attacks: </span></p>
<p>To understand how most network attacks operate it is necessary to go into more detail about some of the layers used.</p>
<p><span style="font-weight: bold;">Network layer: </span></p>
<p>The rules that govern this layer to ensure that the addressing is correct and efficient is what’s called Internet Protocol (IP)</p>
<p>Everything That is connected to the internet has an IP address. An IP address is made up of four bytes that can be no<br />
greater than 255. E.g. 100.100.100.100.</p>
<p>They can be no bigger that 255 as this is the highest number that binary goes to in one byte and all numbers are converted to binary as far as computers are concerned.</p>
<p>128 &#8212;- 64&#8212;- 32&#8212;- 16&#8212;- 8&#8212;- 4&#8212;- 2&#8212;- 1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8211;1&#8212;&#8212;- 1&#8212;&#8211; 1&#8212;&#8211; 1&#8212;&#8211; 1&#8212;&#8211; 1&#8212;- 1&#8212;- 1</p>
<p>This number 11111111 would be the highest number in binary for one byte as 1 byte long (8 bits make a byte, so eight 1&#8217;s make the byte)</p>
<p>If you add the numbers above the ones up, you will see it comes to 255</p>
<p>128 +64 + 32 + 16 + 8 + 4 + 2 + 1 = 255</p>
<p>128 &#8212;- 64&#8212;- 32&#8212;- 16&#8212;- 8&#8212;- 4&#8212;- 2&#8212;- 1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8211;0&#8212;&#8212;- 0&#8212;&#8211; 0&#8212;&#8211; 0&#8212;&#8211; 0&#8212;&#8211; 0&#8212;- 0&#8212;- 1</p>
<p>This would equal the number 1. If there is a zero under the number it is discounted, only where there is a 1 is the value<br />
added.</p>
<p>128 &#8212;- 64&#8212;- 32&#8212;- 16&#8212;- 8&#8212;- 4&#8212;- 2&#8212;- 1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8211;0&#8212;&#8212;- 0&#8212;&#8211; 0&#8212;&#8211; 0&#8212;&#8211; 1&#8212;&#8211; 1&#8212;- 1&#8212;- 1</p>
<p>So this would equal 15. 8 + 4 + 2 + 1 = 15</p>
<p>A bit off topic there but that is how binary works; hence that is how an IP address is looked at by your computer.<br />
If you need a number bigger that 255 that is where hex comes in. Hex will be explained later when we talk about MAC addresses</p>
<p>Anyway, in the network layer, both IP packets and Internet Control Messaging Protocol (ICMP) packets exist.</p>
<p>IP packets are used for the actual sending of data, whilst the ICMP packets are there for diagnostic and messaging/notification purposes.<br />
If there is a problem with the delivery or receipt of an IP packet, an ICMP packet can be sent to tell the other system that<br />
there has been a problem.</p>
<p>ICMP can also be used to test the connectivity of something on the network in the form of an Echo Request commonly known as<br />
a Ping. This is a quick and easy way to test if a host is up and running and how latent the connection is between you.<br />
If you send an Echo Request get an Echo Reply the host has to be alive and reachable. If you send an Echo request and if you don’t get anything back then it generally (but not always) means the host is down. Unlike TCP there doesn’t have to<br />
be an established connection to allow ICMP packets to transmit, so systems can be configured to ignore ICMP packets<br />
as a security measure.</p>
<p>The final thing to mention on this topic is IP fragmentation.</p>
<p>Most networks have a limit on the size of IP packet that can be transmitted, so the network layer can break the packet down</p>
<p>A normal packet may look like this:</p>
<p>______________________<br />
| Header | DATA DATA DATA |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>This may be too big to be transmitted, so the network layer will break it down like so:</p>
<p>______________<br />
| Header | Data 1 |<br />
&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>______________<br />
| Header | Data 2 |<br />
&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>______________<br />
| Header | Data 3 |<br />
&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>It is a simplified explanation of it as in real life Offsets are used instead of 1 2 and 3.<br />
To reconstruct the packet at the receiving station the network layer will  put them back in order 1,2 and 3 and<br />
pass it on up to the Transport Layer.</p>
<p>Which, strangely enough, brings us nicely on to the transport layer.</p>
<p><span style="font-weight: bold;">The Transport Layer: </span></p>
<p>The two major set of rules in this layer are the TCP (Transport Control Protocol) and UDP (User Datagram Protocol) protocols</p>
<p>Most services on a network and on the internet will use the TCP protocol, these include things such as; HTTP, FTP, SMTP.<br />
Although each one of these is a protocol in its own right, to actually transfer the data it is being asked to, it will use TCP.</p>
<p>The reason for this is because TCP provides a very reliable, two-way connection between hosts on a network or Internet.</p>
<p>TCP will ensure that all the data is received and in the correct order, if packets are missing or corrupted<br />
it will hold on to these packets until they have been re-sent and only then will it pass it up to the next layer.</p>
<p>To be able to do all this TCP uses a system known as flags.</p>
<p>There are 6 flags in total, they are:</p>
<p>URG&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..Urgent&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..Used for priority data</p>
<p>ACK&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..Acknowledgment&#8230;.Acknowledges a connection and is usually turned on</p>
<p>PSH&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..Push&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;Tell the recipient to push the data through rather than<br />
buffer it</p>
<p>RST&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..Reset&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;Resets the connection</p>
<p>SYN&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..Synchronize&#8230;&#8230;&#8230;&#8230;..Synchronizes sequence numbers at the beginning of the<br />
connection (REMEMBER THIS)</p>
<p>FIN&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..Finish&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.Closes a connection</p>
<p>What makes TCP such a reliable connection is that, unlike UDP it establishes a connection before sending the data packet.<br />
It does this by way of a three-way handshake using the flag described above.</p>
<p>Say we have computer &#8216;A&#8217; and &#8216;B&#8217;. &#8216;A&#8217; wants to send something to &#8216;B&#8217;, here is what happens:</p>
<p>First,&#8217;A', will send a packet with the SYN flag turned on to &#8216;B&#8217;</p>
<p>&#8216;B&#8217; will then send a packet back with the SYN and ACK flags turned on</p>
<p>Then &#8216;A&#8217; will send another packet back with just the ACK flag turned on.</p>
<p>(After this has been completed every packet will have the ACK flag turned on.)</p>
<p>This is basically computer &#8216;A&#8217; saying to &#8216;B&#8217;, &#8220;Hi, I have a message for you, do you want it?&#8221;<br />
Then &#8216;B&#8217; says &#8221; OK, im ready send it&#8221;<br />
Then &#8216;A&#8217; says&#8221; OK, here it comes&#8221;</p>
<p>There is a little bit more to it than that which we will look at next.</p>
<p>The reason that the packets had the SYN flag turned on was to enable the two machines to Synchronize sequence numbers.</p>
<p><span style="font-weight: bold;">Sequence Numbers: </span></p>
<p>Sequence numbers are used to ensure that the packets arrive in the correct order and to determine if any packets have gone missing somewhere along the line. This is what makes TCP so good. They also allow data from an established and authenticated sessoon to be accepted.</p>
<p>The First SYN packet that is sent to open a connection, will look like this:</p>
<p>SYN Packet<br />
Syn = On<br />
Ack = Off<br />
Seq#000001<br />
Ack# 0</p>
<p>Notice the Sequence number (Seq#) is 000001 and the Acknowledgment Number (Ack#) is 0</p>
<p>So this arrives at &#8216;B&#8217; and &#8216;B&#8217; now send a SYN/ACK Packet back to &#8216;A&#8217;, so called because both the SYN flag and the ACK flag will be turned on.</p>
<p>SYN/ACK Packet<br />
Syn = On<br />
Ack = On<br />
Seq#111111<br />
Ack# 000002</p>
<p>Now, this bit can get a bit confusing.</p>
<p>The original sequence number from &#8216;A&#8217; now becomes &#8216;B&#8217;s Acknowledgment number (Ack#) as it is acknowledging the data sent, it will also increment it accordingly.</p>
<p>Computer &#8216;A&#8217; knows that he sent a packet with a sequence number of 000001 to &#8216;B&#8217;, so now when the next packet is received from &#8216;B&#8217; he will be expecting it to have and Ack# of 000002 &#8211; he gets this as expected and knows that it is authentic and from B. Also he now has the sequence number &#8216;B&#8217; is using &#8211; 111111, so the next packet that he sends to &#8216;B&#8217; he knows that he needs to increment it and place this in the ack# field.</p>
<p>So the third and last part of the handshake will be like this:</p>
<p>ACK Packet<br />
Syn = Off<br />
Ack = On<br />
Seq# 00002<br />
Ack# 111112</p>
<p>When &#8216;B&#8217; sent back the second packet, he had increased it by 1- that now becomes &#8216;A&#8217;s sequence number for the third packet.</p>
<p>Now that both station are aware of each others sequence numbers the mail data that needs to be sent can safely be transmitted safe in the knowledge that error and missing packets will be detected.</p>
<p>I hope that wasn’t to confusing. It is important to understand the sequence number concept for when I move onto TCP/IP Hijacking later on.</p>
<p>The last layer (and what is used in our first attack) is the Data Link Layer.</p>
<p><span style="font-weight: bold;">The Data Link Layer </span></p>
<p>This is where Ethernet comes into the network layers. This layer provides a standard method of addressing for all Ethernet connected devices on the network. These address are commonly known a Media Access Control addresses or MAC addresses.</p>
<p>Every single Ethernet device is assigned a unique MAC address in the factory where it is made.</p>
<p>Usually the address is in Hex format, i.e. 00-30-BD-07-AC-32</p>
<p>Sometimes the address is also referred to as the Hardware address as it is unique to each piece of hardware.</p>
<p>The reason for this is so that any hardware on a network will have an address that will never change, unlike an IP address, which can change very regularly.</p>
<p>When a data packet is sent over Ethernet it will have in its header the source address and the destination address.</p>
<p>There is a special address that can be used with Ethernet to broadcast to all Ethernet devices on the network, this is all the 1&#8217;s in binary, 11111111 which as we now converts to 255 but remember IP address have 4 bytes in them so the broadcast address will be 255.255.255.255.</p>
<p>On the layer above (the network layer) the addressing system used there is IP but on this layer we use MAC addresses for local transmission. There is a requirement to know someones MAC address before we can send data to it providing the destination host is on the same LAN segment &#8211; if it is not then the requirement is to know the MAC address of the default gateway.</p>
<p>This is where a protocol know as the Address Resolution Protocol (ARP) comes into effect.</p>
<p>This protocol designs a table know as an ARP table to link MAC address to IP addresses and looks (in an edited version) something similar to this</p>
<p>192.168.2.2&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&gt; 00-30-BD-07-CA-37<br />
192.168.2.3&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&gt; 00-20-CA-24-BD-12<br />
192.168.2.4&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&gt; 00-30-00-33-30-BD</p>
<p>and so on.</p>
<p>To establish this table ARP messages need to be sent around the network via the broadcast address 255.255.255.255.</p>
<p>There are two main ARP messages &#8211; ARP request and ARP reply.</p>
<p>When a packet comes to this layer, it looks at the header and to see what the destination IP address is. It will now send out an ARP request message saying, &#8221; Who does the IP address 192.168.2.2 belong to?&#8221;<br />
The computer that is on that network who has that IP address, will receive the ARP request via the broadcast IP, know it has got the IP that it is looking for and reply with an ARP reply message, saying &#8220;Yep I have the IP 192.168.2.2, here is my MAC address 00-30-BD-07-CA-37&#8243;</p>
<p>This will now get cached in the ARP table and next time a data packet comes down with the destination IP of 192.168.2.2, it will know the correct MAC address to send it to and send it using this straight away.</p>
<p>The ARP broadcast happens at very regular intervals to keep the table up to date.</p>
<p>If an ARP reply message comes in with a new MAC address for a certain IP address, it will overwrite it there and then (unless it has been marked as permanent) &#8211; Even if it didn’t send out an ARP request message&#8230;</p>
<p>Can anyone see the security flaw here and potential for a possible exploit? If not keep reading.</p>
<p><span style="font-weight: bold;">Switched/Unswitched Networks </span></p>
<p>On the data link layer also exists a method to distinguish between switched and unswitched networks.</p>
<p>The definition of an unswitched network is that &#8211; Every Ethernet packet will pass to every host on the network as a Hub will broadcast all traffic out of all ports except for the port the traffic was received on. All the hardware on this network is expected to only look at the destination address to see if it is meant for them or not. If it is, it will read the data part of the packet and the layer process will begin. If it is not meant for it, it should just ignore it.</p>
<p>Again, can anyone see the security flaw here?</p>
<p>If you set a computer on a network to promiscuous mode it will look at the data part of all packets whether it is addresses to it or not</p>
<p>This is what programs such as TCPDump and Ethereal/Wireshark utilize.</p>
<p>This method of attacking a network is known, as Sniffing and it can be a very useful way of gathering information such as Passwords, user names etc especially with services that don’t use encryption by default &#8211; Telnet, POP3 and FTP for example.</p>
<p>The security implications are quite obvious here and the way to fix them is to get a switched network.</p>
<p><span style="font-weight: bold;">Switched Networks:</span></p>
<p>The idea of a switched network is to ensure that only the packet addresses to a certain computer is sent to it.</p>
<p>This is done by the switch knowing what MAC address is plugged into which port on the switch and only sending data addressed to it out on that port</p>
<p>So say the switch has 3 ports, three computers are plugged into it with three different MAC address, I will use 1 2 and 3 to represent the Mac’s here.</p>
<p>The switch receives a data packet addressed to the MAC address of 1.<br />
(If it were an unswitched network it would now send this data packet out of all ports to all computers.)</p>
<p>But this switch knows that computer with the MAC address of 1 is plugged into port 2, so it will only send the data packet out of port 2.</p>
<p>(Technically the switch will initially flood the traffic out of all ports until it finds out which port the MAC address is on, and then from here on in it will only send it out of the relevant port &#8211; this is not too much of a concern though as the first packets destined for the host are likely to be ARP requests anyway &#8211; which are broadcast packets&#8230;.)</p>
<p>Seems like a foolproof way to send data packets, doesn’t it? Well there is a way around it.</p>
<p><span style="font-weight: bold;">Spoofing: </span></p>
<p>So far the security measures have been concerned with the destination IP/MAC address, what they cant verify is if the source address is correct.</p>
<p>This type of spoofing is simply fooling the switch into thinking that a data packet has come from somewhere it didn’t &#8211; normally a device it trusts.</p>
<p>So if you can send a data packet out and make a switch think it has come from somewhere else, you have successfully spoofed its source address.</p>
<p>To spoof an address we need to let the network know that the address you are going to use, is alive and well on the network and let it know an IP and MAC address.</p>
<p>Where are these kept? Yep, the ARP table. You may recall me saying earlier that when an ARP reply arrives with a known IP address but a different MAC address all it will do is overwrite the old MAC address with the new one! Even if it has not sent out an ARP request broadcast..</p>
<p>This is called ARP poisoning.</p>
<p>Say we have two computers on a network, old faithful &#8216;A&#8217; and &#8216;B&#8217;.</p>
<p>They will each have an ARP cache; &#8216;A&#8217; will have &#8216;B&#8217;s IP address and Mac address and in return &#8216;B&#8217; will have &#8216;A&#8217;s IP and MAC address.</p>
<p>Think back to the three-port switch, we will be the third computer on that switch.<br />
For the sake of simplicity we will have the MAC addresses of 1,2 and 3 belonging to computers A, B and C respectively. So we will be C with the MAC of 3.</p>
<p>We will have used a program such as TCPDump to capture all the ARP messages that have been sent and we can know see the IP addresses and MAC addresses of &#8216;A&#8217; and &#8216;B&#8217;. (Failing this, the results of a ping will add the MAC and IP address to your ARP table, providing you are on the same network)</p>
<p>What we now need to do now, is make &#8216;A&#8217; think we are &#8216;B&#8217; and also make &#8216;B&#8217; think we are &#8216;A&#8217;.<br />
So now matter what, the switch will send all the data packets to us.</p>
<p>So, we send an ARP reply out to &#8216;A&#8217; saying that we are &#8216;B&#8217; and have a MAC address of 3 (remember our actual MAC is 3, so the switch will send all packets out to us) So now any packets that &#8216;A&#8217; wants to send to &#8216;B&#8217;, he will now address to the MAC of 3. (aka us) as per his ARP cache.</p>
<p>The beauty of this attack is that at this exact point of the attack &#8216;B&#8217; can still send traffic as normal to all other hosts &#8211; all we are doing is making host &#8216;A&#8217; address the packets to us instead of host &#8216;B&#8217;. The switch is not attacked or exploited in anyway &#8211; it carries on doing what it is meant to do and sends the packets to the MAC address host &#8216;A&#8217; has addressed them too..It is a good idea to keep a constant stream of forged ARP replies running to host &#8216;A&#8217; as if host &#8216;B&#8217; was to send a packet to host &#8216;A&#8217; then its ARP cache would be updated to reflect the true ARP information.</p>
<p>There are a few tools that will do this for us DSniff and Nemesis are two of the most common.</p>
<p>We still have an issue though in that the data that &#8216;A&#8217; is sending to &#8216;B&#8217; is not getting there as it is coming to us. We need to turn IP forwarding on to allow the data to reach &#8216;B&#8217;. Obviously this will only allow us to sniff half of the traffic &#8211; traffic from &#8216;A&#8217; that is being sent to &#8216;B&#8217; &#8211; host B still has the correct MAC address for host A so it will not be sent to us&#8230;</p>
<p>We now need to do the same thing to B and send him a fake ARP Reply informing him that host &#8216;A&#8217; has the MAC address of 3. This will ensure we get the return traffic and as long as we have IP Forwarding enabled and have fired Ethereal/TCPDump up we will have a log of all traffic sent between the two hosts and neither of them will be aware that there is a &#8216;Man in the Middle&#8217; sniffing their traffic.</p>
<p>We need to ensure the regular sending of the ARP replies to the two hosts to ensure that the relevant ARP caches always have our MAC address in them.</p>
<p>You can do this for every computer on the network should you so wish, as far as they are concerned they are sending a data packet addressed to 3, and the switch will duly oblige and send the data straight to you.</p>
<p>This site has a very good example of ARP poisoning:</p>
<p><!-- m --><a class="postlink" href="http://www.oxid.it/downloads/apr-intro.swf">http://www.oxid.it/downloads/apr-intro.swf</a></p>
<p><!-- m --></p>
<p>Imagine what you could do if one of the computers was a gateway for that sites Internet traffic?</p>
<p><span style="font-weight: bold;">Hijacking a TCP/IP Connection. </span></p>
<p>For this attack you will need to understand how the sequence numbers work, so if you didn’t understand it before, go back and re-read it!</p>
<p>For this to work it is essential the attacker is on the same network as the victim.</p>
<p>When a packet is received after a connection has been established, it has to have the correct sequence number, if the number has already been used the packet will be dropped. If it is higher than what was expected but still within the defined limits then it will be stored in case it was from a message that has been fragmented and may need to be put back together.</p>
<p>If the sending stations sequence number is not what the receiving station expected and vice versa, all data packets are not passed up through the layers and you have a form of denial of service. If this happens the connection will still remain established.</p>
<p><span style="text-decoration: underline;">Here’s how this attack works: </span></p>
<p>We will use hosts &#8216;A&#8217; and &#8216;B&#8217; again for this.</p>
<p>We need to sniff all packets coming from the victim computer (&#8217;A') with a utility such as TCPDump.<br />
From these sniffed packets we can get the sequence number that &#8216;A&#8217; is up to.</p>
<p>Now we send a packet with the source address spoofed to make it looked like it came from &#8216;A&#8217; to &#8216;B&#8217; with the correct sequence number. (TCPDump again)</p>
<p>When &#8216;B&#8217; receives this packet, believing it cam from &#8216;A&#8217; he will respond to this data packet, after increasing the sequence number.</p>
<p>Now &#8216;A&#8217; didn’t send the packet, we did, so when the packet from &#8216;B&#8217; arrives with the wrong sequence number it will keep it for reconstruction purposes as the sequence number will be higher but to all intents and purposes he will ignore it.</p>
<p>But what will happen now, if &#8216;A&#8217; sends a packet to &#8216;B&#8217;? His sequence number will be one that has already been used (by us) so &#8216;B&#8217; will drop the packet. So no matter what &#8216;A&#8217; sends now, it will always be ignored. And everything B sends to A will be stored for later use, as the sequence number will be too high.</p>
<p>But as we sent out the first packet that caused all this, we have the correct sequence number that &#8216;B&#8217; is expecting, so we have in effect hijacked the connection because we can carry on talking to &#8216;B&#8217; and whatever &#8216;A&#8217; sends will be ignored! And we have caused a denial of service (DoS) between two computers on this network.</p>
<p>There is another similar method whereby you sniff a connection, spoof get the relevant sequence numbers, spoof the source address and send a packet with the RST (reset) flag turned on, when you send this you will reset the connection. Again causing a DoS state that can be hijacked as long as you have the correct sequence number.</p>
<p>I hope this has been an informative paper and helps people to understand network protocols and very basic attacks a bit more thoroughly.</p>
<p>Nokia.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-how-networks-and-network-attacks-work/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; NMAP Lesson 1 &#8211; The Basics</title>
		<link>http://www.thetazzone.com/tutorial-nmap-lesson-1-the-basics/</link>
		<comments>http://www.thetazzone.com/tutorial-nmap-lesson-1-the-basics/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 01:15:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=790</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=684">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=684#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>NMAP v3.48 tutorial lesson 1 of ? rev 1.0 by TheHorse13</p>
<p>PREFACE<br />
======================<br />
I&#8217;d like to start by saying that I will be covering many of the basic functions along with examples and explanations why you would want to use the tool in each scenario. In addition, I will hit on several advanced features for those who are familiar with the tool but not to the point where advanced knowledge of the application is grasped.</p>
<p>I will be borrowing verbage (in some cases) from the developer because I feel that the developer has worded things in such ways that I cannot improve upon. By no means is this a cut &amp; paste tutorial but I would like to make everyone aware that I will be borrowing info where it makes sense.</p>
<p>NMAP<br />
=====================<br />
NMAP is designed to allow system administrators and curious individuals to scan large networks to determine which hosts are up and what services they are offering. nmap supports a large number of scanning techniques such as: UDP, TCP connect(), TCP SYN (half open), ftp proxy (bounce attack), Reverse-ident, ICMP (ping sweep), FIN, ACK sweep, Xmas</p>
<p>Tree, SYN sweep, IP Protocol, and Null scan. See the Scan Types section for more details.</p>
<p>Nmap also offers a number of advanced features such as remote OS detection via TCP/IP fingerprinting, stealth scanning, dynamic delay and retransmission calculations, parallel scanning, detection of down hosts via parallel pings, decoy scanning, port filtering detection, direct (non-portmapper) RPC scanning, fragmentation scanning, and flexible target and port specification.</p>
<p>NMAP supported platforms<br />
=====================<br />
Linux, Microsoft Windows, FreeBSD, OpenBSD, Solaris, IRIX, Mac OS X, HP-UX, NetBSD, Sun OS,</p>
<p>Amiga. You&#8217;ll find RPMs, binaries and so on, thus, installation is very flexible.<br />
You&#8217;ll find all installation details and downloads here:</p>
<p><a class="postlink" href="http://www.insecure.org/nmap/nmap_download.html">http://www.insecure.org/nmap/nmap_download.html</a></p>
<p>NMAP OPTIONS<br />
=====================<br />
A simple nmap -h will reveal all of the supported switches. These will vary slightly on</p>
<p>older builds.</p>
<p>* -sS TCP SYN stealth port scan (default if privileged (root))<br />
-sT TCP connect() port scan (default for unprivileged users)<br />
* -sU UDP port scan<br />
-sP ping scan (Find any reachable machines)<br />
* -sF,-sX,-sN Stealth FIN, Xmas, or Null scan (experts only)<br />
-sV Version scan probes open ports determining service &amp; app names/versions<br />
-sR/-I RPC/Identd scan (use with other scan types)<br />
Some Common Options (none are required, most can be combined):<br />
* -O Use TCP/IP fingerprinting to guess remote operating system<br />
-p &lt;range&gt; ports to scan. Example range: &#8216;1-1024,1080,6666,31337&#8242;<br />
-F Only scans ports listed in nmap-services<br />
-v Verbose. Its use is recommended. Use twice for greater effect.<br />
-P0 Don&#8217;t ping hosts (needed to scan</p>
<p><!-- w --><a class="postlink" href="http://www.microsoft.com/">www.microsoft.com</a></p>
<p><!-- w -->and others)<br />
* -Ddecoy_host1,decoy2[,...] Hide scan using many decoys<br />
-6 scans via IPv6 rather than IPv4<br />
-T &lt;Paranoid|Sneaky|Polite|Normal|Aggressive|Insane&gt; General timing policy<br />
-n/-R Never do DNS resolution/Always resolve [default: sometimes resolve]<br />
-oN/-oX/-oG &lt;logfile&gt; Output normal/XML/grepable scan logs to &lt;logfile&gt;<br />
-iL &lt;inputfile&gt; Get targets from file; Use &#8216;-&#8217; for stdin<br />
* -S &lt;your_IP&gt;/-e &lt;devicename&gt; Specify source address or network interface<br />
&#8211;interactive Go into interactive mode (then press h for help)<br />
&#8211;win_help Windows-specific features</p>
<p>EXAMPLES oF BASIC SCANS<br />
=====================</p>
<p>Example 1 (NOTE: You must have root priviledges to run the SYN stealth scan, which is the</p>
<p>-sS switch)</p>
<p>Let&#8217;s say that you want to know what ports are open on a host and you want to know what OS is running on the host. This can be done by typing the following NMAP command. (NOTE: the position of switches makes no difference. You can order switches any way you like.)</p>
<p>[root@locahost]#nmap -v -sS -O -p 1-65535 192.168.1.100</p>
<p>nmap &#8211; the command to run it<br />
-v for verbose<br />
-sS for SYN stealth scan<br />
-p for ports you want to scan (I used all IANA ports)<br />
-O OS detection<br />
192.168.1.100 &#8211; the host</p>
<p>Here is the output from this command. Let&#8217;s take a closer look at what is returned in addition to what we have asked for.</p>
<p>Starting nmap 3.48 (</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/nmap">http://www.insecure.org/nmap</a></p>
<p><!-- m -->) at 2003-10-25 19:20 Eastern Daylight</p>
<p>Time<br />
Host IS~TOWER (192.168.1.101) appears to be up &#8230; good.<br />
Initiating SYN Stealth Scan against IS~TOWER (192.168.1.101) at 19:20<br />
Adding open port 445/tcp<br />
Adding open port 5800/tcp<br />
Adding open port 21/tcp<br />
Adding open port 5900/tcp<br />
Adding open port 1025/tcp<br />
Adding open port 135/tcp<br />
Adding open port 1027/tcp<br />
Adding open port 139/tcp<br />
The SYN Stealth Scan took 13 seconds to scan 65535 ports.<br />
For OSScan assuming that port 21 is open and port 1 is closed and neither are firewalled<br />
Interesting ports on IS~TOWER (192.168.1.101):<br />
(The 65527 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
21/tcp open ftp<br />
135/tcp open msrpc<br />
139/tcp open netbios-ssn<br />
445/tcp open microsoft-ds<br />
1025/tcp open NFS-or-IIS<br />
1027/tcp open IIS<br />
5800/tcp open vnc-http<br />
5900/tcp open vnc<br />
Device type: general purpose<br />
Running: Microsoft Windows 95/98/ME|NT/2K/XP<br />
OS details: Microsoft Windows Millennium Edition (Me), Windows 2000 Professional or Advanced</p>
<p>Server, or Windows XP<br />
TCP Sequence Prediction: Class=random positive increments<br />
Difficulty=8231 (Worthy challenge)<br />
IPID Sequence Generation: Incremental</p>
<p>Nmap run completed &#8212; 1 IP address (1 host up) scanned in 14.851 seconds</p>
<p>The first thing you&#8217;ll notice is that NMAP will resolve the hostname of the box you scan if possible. In this case, the host, 192.168.1.101 is named &#8220;IS~TOWER&#8221;.<br />
The next line we see is the type of scan we have performed. The switch -sS is a SYN Stealth scan and the duration of the scan, which is what we have done.<br />
You may also notice that NMAP has posted what appears to be redundant information. This is intentional. The first section is the port scan where ports will appear in no particular order, the second is the service scan, where the ports are arranged in ascending order along with what NMAP feels is the associated service.<br />
It also tells you that the other ports that you specified for scanning are closed, thus, they have been omitted. This is a good thing because you don&#8217;t need to see 65,535 closed port statements wiz down your screen.</p>
<p>Additionally, NMAP is telling you that it is making some assumptions while trying to identify the remote OS. Look closely at the output and you will see that it assumes that port 21 (FTP typically) is open and port 1 (TCP/UDP port service multiplexer) is closed and there is no firewall in place.</p>
<p>But what if port 21 is closed and there is a firewall in place?</p>
<p>NMAP will then select the first port you select as the port that it will assume is closed (example scan ports 400-500 it will assume 400 is closed) and it will pick the first open port it comes across as the open port used in OS identification.<br />
Now, with a firewall in place, NMAP will not be able to properly fingerprint the OS (in most cases) so it will warn of this fact by stating that the OS identification will be less accurate and in some cases, if it cannot indentify the OS, it will output an NMAP &#8220;fingerprint&#8221; which we will examine very closely in later lessons.</p>
<p>The Device type field is attempting to tell you what the device is used for such as a router, etc but I have found this field less than accurate many times.</p>
<p>The OS indentifier field is the footprint match that NMAP has returned for the target machine. Notice that when a windows OS is identified that it gives you a number of possibilies and not an exact match. This is because the stack on these OSes respond the same way, thus it is difficult to pinpoint the exact MS OS in use. The OS Details line is the one to be concerned with when looking at your results, not &#8220;Running:&#8221;</p>
<p>The TCP Sequence prediction is run to see how each IP sequence number is handled during the connection (or how NMAP feels this happens). The theory being that if you can predict the sequence, you can poison the connection be injecting your own packets into the stream.<br />
A good OS will always have random sequence numbers. NMAP also tells you what it feels the difficulty is in penetrating the box. The difficulty number will be accompanied with a small blurp which ranges from easy to good luck.</p>
<p>The last thing it tells you is how the IPID sequence generation is handled. Give the Nmap arguments -v -O&#8221; against a host and it should say &#8220;IPID Sequence Generation: whatever&#8221;. IPID classes Nmap understands include &#8220;incremental&#8221; (most machines), &#8220;duplicated IPID&#8221; (mostly stupid devices like printers), &#8220;Broken little-endian incremental&#8221; (Windows), &#8220;Randomized&#8221; (OpenBSD), and &#8220;Random positive increments&#8221;.</p>
<p>Well that is the end of lesson one which covers a basic scan and what the results mean. By no means is this supposed to be perfect so if you feel I missed something or failed to explain something with enough detail, please let me know. Also, add anything you like. <img title="Smile" src="http://tazforum.thetazzone.com/images/smilies/icon_smile.gif" alt=":-)" /></p>
<p>Next lesson will deal exclusively with scanning options and how to form the proper syntax for specific scans.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-nmap-lesson-1-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; VLANS, what they are and how they work</title>
		<link>http://www.thetazzone.com/tutorial-vlans-what-they-are-and-how-they-work/</link>
		<comments>http://www.thetazzone.com/tutorial-vlans-what-they-are-and-how-they-work/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 01:12:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=788</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=1891">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<div class="content"><span style="text-decoration: underline;"><span style="font-weight: bold;">Virtual Local Area Network (VLAN)</span></span></p>
<p>What is a VLAN?</p>
<p>Well Cisco defines a VLAN as:</p>
<p>A switched network that is logically segmented on an organizational basis, by functions, project teams, or applications rather than on a physical or geographical basis.</p>
<p>What this is saying is that a VLAN is not defined by any physical restrains or needs, it can span an entire country or can be in the same floor in an office. VLANs are formed for administrative purposes and not geographical purposes.</p>
<p><span style="text-decoration: underline;"><span style="font-weight: bold;">So what are they?</span></span></p>
<p>Well, in a nut shell a VLAN is a LAN that functions separately from the physical LAN it is located in.</p>
<p>Take this following example:</p>
<p>You have an office in London and an office in Manchester and you need to put a small network in place between both of them.<br />
You find out there is already a Fibre Optic network linking the two of them up but this network needs to be completely separate from yours.</p>
<p>Do you buy your own fibre, routers, firewalls, switches etc and have a completely separate network? &#8230;..You could but it’s not a very cost effective solution for a small network.</p>
<p>What about ‘piggy backing’ on the existing network? It would cut cost’s down considerably and would make use of a network that is already in place and working perfectly. However you have been told the networks must remain separate from start to finish and not interfere with each other in anyway.</p>
<p>The simple solution is to designate a port on each switch to a VLAN – say VLAN 30 in this case.</p>
<p>Say your new network is a 192.168.200.0 network and the existing network is a 10.0.0.0 network. You speak to the network engineer who runs the existing one and ask him very nicely, whilst placing a crate of Fosters on his desk, if he can put a port on each switch in to VLAN 30.</p>
<p>Obviously he agrees and drops everything to do this for you.</p>
<p>Now in essence, there is as good as two different networks linking the two buildings together but in reality there is only one ‘set’ of hardware in place. The 10.0.0.0 network is completely separate from the 192.168.200.0 network as far a routing is concerned; they just share the same switches is all.</p>
<p>Or a smaller problem maybe you have different departments in your office that need to be segregated from each other. Say a finance dept and a sales dept.</p>
<p>The finance department deals with sensitive data that should not be seen by anyone in other dept’s. One way to get around this problem is to place the finance department in to their own VLAN. That way anyone not in this VLAN will not be able to have access to it without first going through a router – on the router you place Access Control Lists (ACL’s) to restrict who can use this VLAN and who can’t.</p>
<p>“In switched networks, routers perform broadcast management, route processing and distribution, and provide communications between VLANs. Routers provide VLAN access to shared resources and connect to other parts of the network that are either logically segmented with the more traditional subnet approach or require access to remote sites across wide-area links.”</p>
<p>Before switches the only way to have this functionality was with routers using different interfaces for different networks, now we can use ports on a switch to virtually place it in a different network!</p>
<p>Hopefully by now you get the gist of why we have VLANS, so now let’s take a look at how they work!</p>
<p><span style="font-weight: bold;"><span style="text-decoration: underline;">How VLANs Operate</span></span></p>
<p>So we know that we can assign a switch port in to a VLAN and this will keep all the data separate from other VLANS but how does this work?</p>
<p>This works by what is called <span style="font-weight: bold;">VLAN Frame Tagging.</span></p>
<p>As we all know, once data has got to Layer 2 on the OSI Model it is known as a <span style="font-style: italic;">frame</span> – switches live at layer two and switch <span style="font-style: italic;">frames</span> – VLANs are defined at layer 2 on a switch – so Frames are what get routed by switches and what we need to route between VLANs.</p>
<p>To accomplish this fames are tagged with a ‘tag’ or a VLAN ID (VID, vID, V-id) This VLAN ID allows any switch that is may pass through to make the correct decision about which port to forward it out of.</p>
<p>So our frame gets tagged with the VLAN 30 ID as soon as it arrives at the first switch in the VLAN in, say, London.</p>
<p>That switch than takes a look to what port is in VLAN 30, if any. If there are no ports in VLAN 30 the frame is dropped. If there are frames in VLAN 30, the usual MAC address process takes place and the frame is forwarded out of the correct port accordingly, as long as the port is in VLAN 30. Notice this was done on a MAC level basis, which is why we can switch different IP addresses from different networks without the aid of a router.</p>
<p>From a Cisco point on view:</p>
<p><span style="font-style: italic;">“The VLAN ID allows VLAN switches and routers to selectively forward packets to ports with the same VLAN ID. The switch that receives the frame from the source station inserts the VLAN ID and the packet is switched onto the shared backbone network. When the frame exits the switched LAN, a switch strips header and forwards the frame to interfaces that match the VLAN colour. If you are using a Cisco network management product such as VlanDirector, you can actually colour code the VLANs and monitor VLAN graphically.”</span></p>
<p>So this is how switches keep track of the frames, what VLAN they belong to and why they can switch packets from different networks.</p>
<p>If a frame arrives for a VLAN that has not been configured it is dropped. If a frame arrives for a VLAN that <span style="font-style: italic;">is</span> configured it is only sent out of a port that is in the matching VLAN as what is in the header of the frame.</p>
<p>A port can be configured to allow only frames with a VLAN ID tag, frames with no VLAN ID tag or both. If a frame is received that is not what the port has been configured for, it is simply dropped.</p>
<p>A switch port can be statically assigned to a VLAN therefore no matter what is plugged in to the port it will always be in the relevant VLAN. This is known as a Static VLAN and is beneficial in a properly administered network where moves are properly planned and conducted.</p>
<p>Or you can populate a MAC table on a switch and tell it which MAC address belongs to which VLAN – know as a Dynamic VLAN, the benefit of this is that you can place a work station anywhere on the LAN and the switch will always place it in the correct VLAN – no further configuration of the switch is required.</p>
<p>So that’s a very basic look at how a VLAN operates.</p>
<p>Let’s take a brief look at one of the most significant side effects of a VLAN – Security.</p>
<p>Contrary to popular belief VLANs where not invented to improve network security – the added security is a bonus to implementing a VLAN.</p>
<p>Although I have said earlier that the only way to talk between two VLANS is via a router – like everything IT related someone will find a way to get around any security restriction sooner or later. <span style="font-style: italic;">It must be noted that this only works on older switches.</span></p>
<p>The following is knows as a &#8216;Temporary VLAN Cut-Through After VLAN Change&#8217; and is taken from the Cisco web site:</p>
<p>“If systems have established TCP/IP communications on the same VLAN, then the switch gets configured so that one system&#8217;s port now belongs to a different VLAN. Communications continues between the two systems because each has the MAC address of the other in its ARP cache, and the bridge knows which destination MAC addresses gets directed to which port.</p>
<p>In the second example, someone wishing to hop VLANs manually enters a static ARP entry for the desired system. Doing so requires that the person somehow learns the MAC address of the target system, perhaps through physical access to the target system.</p>
<p>Each of these two examples can be blocked by using switch software that removes the information necessary for passing packets between VLANs. In higher end Cisco switches, separate spanning trees, the tables that map MAC addresses to ports, exist for each VLAN. Other switches either have similar features, or can use configuration to filter the bridging information available to members of each VLAN.”</p>
<p>As we all now spoofing an IP source addresses has been around for many years, and spoofing VLAN tags is no different. The 2.4 Linux kernels have support for acting as VLAN switches, and can generate any VLAN tag that the user wants to. Other software exists for spoofing VLAN tags such as Sniffer Pro v.2.0.01.<br />
More information about VLAN ID spoofing with Linux here:<br />
<!-- m --><a class="postlink" href="http://www.candelatech.com/%7Egreear/vlan.html">http://www.candelatech.com/~greear/vlan.html</a><!-- m --></p>
<p>Certain conditions have to be meet for VLAN Hopping to be successful:</p>
<p>The MAC addresses of the target system have to be known in advance.<br />
The attacker must belong to the same VLAN as the trunk used to connect the switches.</p>
<p>You can easily prevent VLAN hopping by configuring trunk ports so their VLANs do not match the VLAN ID of any other VLANs that you have configured.</p>
<p>By default, the native VLAN for a trunk will be VLAN ID one, the default for any VLAN. You can choose to set the native VLAN for trunks to be 99, or any value that your switch supports and is not used for any other VLAN to prevent VLAN Hopping.</p>
<p>Well that is a very basic overview of VLANs – what they are and how they work. There is more to VLANs and I have left a lot out as this did seem to get rather lengthy very quickly!</p>
<p>I may do a more advanced one in the upcoming months!</p>
<p>Enjoy.  <img title="Very Happy" src="http://tazforum.thetazzone.com/images/smilies/icon_biggrin.gif" alt=":D" /> <img title="Very Happy" src="http://tazforum.thetazzone.com/images/smilies/icon_biggrin.gif" alt=":D" /></div>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-vlans-what-they-are-and-how-they-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &amp; Update:Nessus server setup and NASL modding</title>
		<link>http://www.thetazzone.com/tutorial-updatenessus-server-setup-and-nasl-modding/</link>
		<comments>http://www.thetazzone.com/tutorial-updatenessus-server-setup-and-nasl-modding/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 01:10:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=786</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=697">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=697#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>BEFORE WE BEGIN<br />
==========================<br />
The tutorial below is a prerequisite for this mini tutorial. It does have outdated information so I will give you the updated content now. Please read all the new content here all the info in the old tutorial. Life will be much easier for you.<br />
<a class="postlink" href="http://tazforum.thetazzone.com/viewtopic.php?t=691">http://tazforum.thetazzone.com/viewtopic.php?t=691</a></p>
<p>In the Getting The Software Section of the old tut…<br />
==========================<br />
Go to</p>
<p><!-- w --><a class="postlink" href="http://www.nessus.org/">www.nessus.org</a></p>
<p><!-- w -->and follow the instructions for downloading the installation script. This is done in place of using the FTP method mentioned in the tutorial.</p>
<p>For the NessusWX client, the windows front-end to the Nessus engine, go to</p>
<p><!-- m --><a class="postlink" href="http://nessuswx.nessus.org/">http://nessuswx.nessus.org</a></p>
<p><!-- m -->and download the windows binary. As of this writing 1.4.5b is the latest release.</p>
<p>In the Installation of Nessus Engine Section<br />
==========================<br />
Tennable has gone to a licensing model which means that at the end of the installation, it will ask you for a serial number that you must register to receive via e-mail.</p>
<p>Note that the SharUtils RPM must be installed before Nessus will compile properly. Do an rpm –qi sharutils before you attempt to install the engine to verify that you have the RPM installed.</p>
<p>Ignore step 3. The Nessus daemon is added in such a way that you can now enable/disable it from the service menu when you type setup at the command line. If at any time you want to fire up Nessus without enabling it to start at boot (it takes the service a long time to fire up because it loads the plugins when you start the process) simply go to /usr/local/sbin and type nessusd –D. This will start the process and load the plugins and will not load Nessus the next time you boot. Personally, this is how I do it as I don’t need to use Nessus continuously on my lab host.</p>
<p>Mini tut starts here:<br />
==================================<br />
Sometimes you may want to tweak or run nasls from the the command line. There are several ways you can go about doing this. We’re going to assume you simply want to run a single nasl.</p>
<p>/usr/local/lib/nessus/plugins is where my .nasl files are stored on the Nessus server. In most cases, this is where you will find them unless you used an RPM build of Nessus for installation. There are close to 8,000 plugins in this directory. If you “ls” this directory, be prepared to see a whole lot of stuff fly by. It’s not very practical. I typically use the W32 NessusWX GUI to find a plugin that I want to run/modify and then jump over to the Nessus server to run it at the command prompt. Please do not confuse what I’m about to demonstrate as a scheduling a Nessus job on the console.</p>
<p>[root@localhost]#nasl –h</p>
<p>nasl &#8212; Copyright (C) 2002 &#8211; 2004 Tenable Network Security</p>
<p>Usage : nasl [-vh] [-p] [ -t target ] [-T trace_file] [-SX] script_file &#8230;<br />
-h : shows this help screen<br />
-p : parse only &#8211; do not execute the script<br />
-D : run the &#8216;description part&#8217; only<br />
-L : &#8216;lint&#8217; the script (extended checks)<br />
-t target : Execute the scripts against the target(s) host<br />
-T file : Trace actions into the file (or &#8216;-&#8217; for stderr)<br />
-s : specifies that the script should be run with &#8217;safe checks&#8217; enabled<br />
-v : shows the version number<br />
-S : sign the script<br />
-X : Run the script in &#8216;authenticated&#8217; mode.</p>
<p>As you can see, there are just a hand full of options. Most are self explanatory.</p>
<p>We are going to do assume that you want to run the HALO server detection NASL. This is a very simple NASL used to find a HALO game server.</p>
<p>NOTE: Some NASLs have dependencies and may not fire properly when run individually. Keep this in mind when selecting individual NASLs for testing or modifying.</p>
<p>code:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;[root@localhost]#pico halo_detection.nasl<br />
#<br />
# Copyright (C) 2004 Tenable Network Security<br />
#</p>
<p>if(description)<br />
{<br />
script_id(12117);<br />
script_version (&#8221;$Revision: 1.1 $&#8221;);</p>
<p>name["english"] = &#8220;HALO Network Server Detection&#8221;;<br />
script_name(english:name["english"]);</p>
<p>desc["english"] = &#8221;<br />
The remote host is running a version of HALO Network Server.<br />
The Server is used to host Internet and Local Area Network (LAN)<br />
games.</p>
<p>Solution: Ensure that this sort of network gaming is in alignment<br />
with Corporate and Security Policies.</p>
<p>Risk Factor: Low&#8221;;</p>
<p>script_description(english:desc["english"]);<br />
summary["english"] = &#8220;Detects HALO Tournament Server&#8221;;<br />
script_summary(english:summary["english"]);<br />
script_category(ACT_GATHER_INFO);</p>
<p>script_copyright(english:&#8221;This script is Copyright (C) 2004 Tenable Network Security&#8221;);</p>
<p>family["english"] = &#8220;General&#8221;;<br />
script_family(english:family["english"]);<br />
exit(0);<br />
}</p>
<p># start script<br />
port = 2302;</p>
<p>sock = open_sock_udp(port);<br />
if ( ! sock ) exit(0);</p>
<p>send (socket:sock, data:raw_string(0&#215;5C, 0&#215;73, 0&#215;74, 0&#215;61, 0&#215;74, 0&#215;75, 0&#215;73, 0&#215;5C) );</p>
<p>r = recv(socket:sock, length:512, timeout:3);</p>
<p>if ( ! r ) exit(0);</p>
<p># OK, there are two modes&#8230;mode 1 is when the server is actively serving up a game<br />
# in which case you&#8217;ll get a long verbose reply from the server<br />
# in mode 2, the server is in IDLE state and is not actively serving a game<br />
# in mode 2, the server will just send back a quick 5 byte error msg to client</p>
<p># mode 1<br />
if (egrep(string:r, pattern:&#8221;hostname.*gamever.*maxplayers&#8221;)) {<br />
security_note(port);<br />
}</p>
<p># mode 2<br />
if ( (strlen(r) == 5) &amp;&amp; (ord(r[0]) == 0xFE) &amp;&amp; (ord(r[0]) == 0xFE) ) security_note(port);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>For those familiar with PERL regular expressions, you’ll notice similarities in the NASL (Nessus Attack Scripting Language) language. Looking at this example we can see that it checks port 2302 and establishes a connection. Once connected it sends the string of data expecting a certain response. Within that response the script looks for static values seen in the mode 1 section (hostname, maxplayers, etc.) if the server is in use. In mode 2, if the server is sitting idle, the plugin looks for the error message via raw data strings and the value of 5.</p>
<p>When modifying NASLs to suit a custom need, you must change a few things. The first is the plugin ID. Typically when I modify a NASL, I change the Plugin ID to something in the 50,000 range. If you submit your NASL to Tennable and they publish it, they will assign it a plugin ID typically in the 10,000 – 19,000 range. Second, the name must obviously change so you don’t harm the original (the name field within the NASL and the actual file name). Next, change the script revision number. This is more for completeness rather than need. Make a note to the NASL that you modified it under the copyright section. DO NOT remove the original copyright. You can (and should) modify the plugin description to reflect what it does now. You can also edit the family the plugin belongs to so it can be used as a safe check, destructive test, etc.. All of these values are listed in the above NASL.</p>
<p>Now for some fun:<br />
=========================<br />
Let’s say that we have reports that someone is running a bunch of HALO gaming servers and an NMAP scan (or whatever scanner) shows that some hosts have something unusual running on port 5400 instead of the default halo port. Simply change the port values as such:</p>
<p>port = 2302;</p>
<p>should read</p>
<p>port = 5400;</p>
<p>and your nasl will now search for halo on port 5400. You can save your nasl as halo_detect_5400.nasl and you can now test it by typing the following on the Nessus server:</p>
<p>[root@localhost]#nasl –t 10.10.10.10 halo_detect_5400.nasl –T –</p>
<p>This tells Nessus to scan host 10.10.10.10 with your modified halo NASL and report the result to the screen. You can send the output to a file if you wish but this is a little quicker.</p>
<p>Now, let’s say that you like the results and want to use this NASL in the NessusWX W32 client. Two things must be done. The first is that you must restart the Nessus service so it reads your plugin for use. I typically HUP the service as such:</p>
<p>[root@localhost]#ps –ef | grep nessus</p>
<p>root 23875 1 0 04:29? 00:00:00 nessusd:waiting for incoming connections<br />
[root@localhost]# kill –HUP 23875</p>
<p>The Nessus service will now restart (takes some time on older hosts) and your plugin will be ready to use.</p>
<p>On the NessusWX client, you must reconnect to the Nessus server once it returns to a normal state. You can search for your plugin using the description or expanding the tree where you identified the family. I simply search for the plugin ID I assigned it and enable it when I get the search results.</p>
<p>At this point you can configure the scan range within the NessusWX client that you wish to let your NASL loose on. Running a single NASL will be fast as all hell (usually) and your results can be seen and manipulated a number of ways.</p>
<p>I hope this mini tut gives you an idea of how to modify, run and include custom NASLs using the nasl command and the NessusWX client.</p>
<p>Any errors, comments, etc., please let me know.</p>
<p>&#8211;TH13</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-updatenessus-server-setup-and-nasl-modding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; Step-by-step setup of Nessus</title>
		<link>http://www.thetazzone.com/tutorial-step-by-step-setup-of-nessus/</link>
		<comments>http://www.thetazzone.com/tutorial-step-by-step-setup-of-nessus/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 01:08:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=784</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=691">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=691#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>Nessus Installation on Red Hat Linux</p>
<p>BEFORE WE BEGIN<br />
===============================<br />
I understand that there are many ways to install and configure Nessus. This tutorial covers only one of them. This tutorial makes several assumptions:<br />
1. You are competent with Windows, Linux and basic networking. If you don’t know how to use command line FTP for example, then this tutorial will be of no use to you.<br />
2. You have 2 computers, one with a Windows and the other with Red Hat, both in good working order. It also assumes that you have at least one supported compiler such as GCC installed on your Red Hat Box.<br />
3. This tutorial is written by me with no references or “borrowed” material. If something doesn’t work or something isn’t clear, yell at me because I am 100% responsible.</p>
<p>GETTING THE SOFTWARE<br />
===============================<br />
First, go to</p>
<p><!-- m --><a class="postlink" href="http://nessuswx.nessus.org/archive/...4.4-install.exe">http://nessuswx.nessus.org/archive/&#8230;4.4-install.exe</a></p>
<p><!-- m -->and download the NessusWX client on to your Windows box. The current version as of this writing is 1.4.4.</p>
<p>Now, on your Red Hat box, from the directory of your choice, ftp to ftp.nessus.org and login anonymously. Once there, path to /pub/nessus/nessus-2.0.7/nessus-installer/ and download nessus-installer.sh</p>
<p>INSTALLATION OF THE NESSUS ENGINE<br />
===============================<br />
Now that you have all of the software, it’s time to install. Let’s begin with the Nessus engine because it requires most of the work.</p>
<p>1. From the directory where you downloaded nessus-installer.sh, simply type: sh nessus-installer.sh. The Nessus installation script will tell you that you need root priviledges to complete the install, press ENTER to continue if you are logged in as root already.<br />
2. Nessus will ask where you want it installed. /usr/local is the default so just hit ENTER when you see the prompt. At this point, Nessus will tell you that it is ready to compile. Hit ENTER and sit back while it compiles. It will take a little while. When it is finished, you’ll see a screen detailing the next steps. Hit ENTER.<br />
3. Now, at this point you have to decide if you want Nessus to start up each time you boot your box or if you just want to start it when you feel like it. To start it when you feel like it, use /usr/local/sbin/nessusd –D. If you want to start it automatically when your box boots up, add /usr/local/sbin/nessusd –D &amp; to /etc/rc.local.<br />
4. Now, decide how you want to handle updating the plugins. You can do it each time the box boots by adding /user/local/sbin/nessus-update-plugins &amp; to /etc/rc.local. You can also copy the nessus-update-plugins script to /etc/cron.daily and it will go out each day and grab the updates.<br />
5. OK, we now have to generate a certificate so go to /usr/local/sbin/ and type nessus-mkcert. This will prompt you for a bunch of information that you would see when generating any SSL certificate. Answer all the questions.<br />
6. Now you have to add a user by running nessus-adduser from /usr/local/sbin. When run, provide a login ID of your choice. When it asks for pass or cert, hit ENTER to accept pass as the auth method. When asked for a password, provide it one. Next you will see a blurb about user rules. Simply hit Ctrl – d and Nessus will verify your input. Type in “y” and Nessus will inform you that the user has been added.</p>
<p>Well now all you have to do is reboot the box to launch Nessus or you need to start the deamon manually as shown in step 3.</p>
<p>INSTALLATION OF NESSUSWX CLIENT<br />
===============================<br />
OK, now all you have to do is run the installer. On the first screen, click next to continue. Next click the checkbox if you agree to the license, then hit next to continue. The next screen shows the install path, click next to continue. Select Binaries Only, then click next. The next screen names the program group, hit next to continue. It now has all the info to begin installation. Hit next and it will begin. Once this is done, look for the eyeball icon on your desktop. Launch it. It will ask about a nessusdb and all you need to do is say yes to create it.</p>
<p>OK, now you need to configure a session:<br />
1) Form the mune pulldowns, select COMMUNICATIONS, then CONNECT. Enter the IP address of your Nessus server then enter the username you created on the Nessus server. You need to use password authentication and it is your choice to save the password or not. Once you do that, hit CONNECT. Accept the certificate however you like (I always do perminant because I trust the source).<br />
2) From the menu pulldowns, select SESSION then NEW.<br />
3) This will open a window to enter your list of target hosts. Add your hosts in here.<br />
4) Now, each tab has tons of options so I will hit on the key ones for now. Hit the portscan tab and enter the range 1-65535.<br />
5) Hit the plug-ins tab and check “use session specific plugin set”, then hit the select plugins button, then select either all plug-ins (bad idea for a production box that you want to scan) or Non-DOS. Click OK.<br />
6) Now, right click on your session (green book icon) and select EXECUTE.<br />
7) On the next pop-up hit the EXECUTE button and you should see your scan underway.</p>
<p>At this point, you are golden. When the scan is done you can preview it or you can generate a report. I usually select HTML output.</p>
<p>In conclusion, I left out *tons* of options and configs but this tutorial is only intended to get you scanning. You’ll need to look into the docs to explore all this tool has to offer.</p>
<p>Happy scanning!</p>
<p>Oh yeah, if someone spots a mistake, let me know and I’ll fix the tut.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-step-by-step-setup-of-nessus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; NMAP 3.48 Lesson 5 &#8211; Fingerprinting &amp; scannin</title>
		<link>http://www.thetazzone.com/tutorial-nmap-348-lesson-5-fingerprinting-scannin/</link>
		<comments>http://www.thetazzone.com/tutorial-nmap-348-lesson-5-fingerprinting-scannin/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 01:06:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=782</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=688">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=688#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>NMAP v3.48 tutorial lesson 5 of 5 rev 1.0 by TheHorse13</p>
<p>PREFACE ***PLEASE READ AND UNDERSTAND THIS*** (Will be repeated at the top of each lesson)<br />
======================<br />
I&#8217;d like to start by saying that I will be covering many of the basic functions along with examples and explanations why you would want to use the tool in each scenario. In addition, I will hit on several advanced features for those who are familiar with the tool but not to the point where advanced knowledge of the application is grasped.</p>
<p>***I will be borrowing verbage (in some cases)*** from the developer because I feel that the developer has worded things in such ways that I cannot improve upon. By no means is this a cut &amp; paste tutorial but I would like to make everyone aware that I will be borrowing info where it makes sense.</p>
<p>NOTE: TheHorse13 takes no responsibility in regards to your use of the information presented in the NMAP tutorial series. If you get into trouble, then obviously you aren’t as 31337 as you thought.</p>
<p>Bold text &#8211; Command syntax<br />
Underlined text &#8211; Important information</p>
<p>PREREQUISIT<br />
======================<br />
Please read the past four tutorials if you are new to NMAP. They are all in the Anti-Online tutorials forum.</p>
<p>IN THIS LESSON<br />
=====================<br />
You have seen basic, intermediate and advanced scanning techniques used thus far. You have also seen some of the footprints left behind by NMAP and how to avoid doing so. Building on this information, there will be times when you conduct scans with NMAP and the application will return something that looks like a giant pile of crypto babble. We will go over what this really is and what to do with the information. We will also use some other less used NMAP scans to quietly probe network devices for vulnerabilities as well as some logging features.</p>
<p>This is the final lesson in the NMAP series. I covered what I feel are useful features although there are others that I have not hit upon. As many of you know Fyoder is going to write a book on the application. That should tell you what this tool is capable of doing. I hope that this short series of tutorials have been helpful to both beginners and advanced users.</p>
<p>NMAP Fingerprints &#8211; What is This?<br />
======================</p>
<p>From time to time, you will scan a particular host and you will receive output that looks like cryptobabble. Let&#8217;s look at an example.</p>
<p>[haxor@localhost]# NMAP -v -sV -O -p 1-1024 192.168.0.44</p>
<p>Starting nmap 3.48 (</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/nmap/">http://www.insecure.org/nmap/</a></p>
<p><!-- m -->) at 2003-11-20 09:05 EST<br />
Interesting ports on 192.168.0.44:<br />
(The 1017 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE VERSION<br />
21/tcp open ftp Microsoft ftpd 5.0<br />
80/tcp open http Microsoft IIS webserver 5.0<br />
135/tcp open msrpc Microsoft Windows msrpc<br />
139/tcp open netbios-ssn<br />
443/tcp open ssl Microsoft IIS SSL<br />
445/tcp open microsoft-ds Microsoft Windows 2000 microsoft-ds<br />
1024/tcp open kdm?<br />
No exact OS matches for host (If you know what OS is running on it, see</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/cgi-bin/nmap-submit.cgi">http://www.insecure.org/cgi-bin/nmap-submit.cgi</a></p>
<p><!-- m -->).<br />
TCP/IP fingerprint:<br />
SInfo(V=3.48%P=i686-pc-linux-gnu%D=11/20%Time=3FBCCA2B%O=21%C=1)<br />
TSeq(Class=RI%gcd=1%SI=3085%IPID=I%TS=0)<br />
TSeq(Class=RI%gcd=1%SI=1DA1%IPID=I%TS=0)<br />
TSeq(Class=RI%gcd=2%SI=16BB%IPID=I%TS=0)<br />
T1(Resp=Y%DF=Y%W=FFFF%ACK=S++%Flags=AS%Ops=MNNT)<br />
T2(Resp=Y%DF=N%W=1000%ACK=S%Flags=AR%Ops=WNMETL)<br />
T2(Resp=Y%DF=N%W=400%ACK=S%Flags=AR%Ops=WNMETL)<br />
T3(Resp=Y%DF=N%W=400%ACK=S++%Flags=UAPR%Ops=WNMETL<br />
)<br />
T3(Resp=Y%DF=N%W=1000%ACK=S++%Flags=UAPR%Ops=WNMET<br />
L)<br />
T3(Resp=Y%DF=N%W=800%ACK=S++%Flags=UAPR%Ops=WNMETL<br />
)<br />
T4(Resp=Y%DF=N%W=800%ACK=S%Flags=AR%Ops=WNMETL)<br />
T4(Resp=Y%DF=N%W=C00%ACK=S%Flags=AR%Ops=WNMETL)<br />
T5(Resp=Y%DF=N%W=0%ACK=S++%Flags=AR%Ops=)<br />
T6(Resp=Y%DF=N%W=400%ACK=S%Flags=AR%Ops=WNMETL)<br />
T6(Resp=Y%DF=N%W=800%ACK=S%Flags=AR%Ops=WNMETL)<br />
T6(Resp=Y%DF=N%W=1000%ACK=S%Flags=AR%Ops=WNMETL)<br />
T7(Resp=Y%DF=N%W=800%ACK=S++%Flags=UAPR%Ops=WNMETL<br />
)<br />
T7(Resp=Y%DF=N%W=1000%ACK=S++%Flags=UAPR%Ops=WNMET<br />
L)<br />
PU(Resp=Y%DF=N%TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPC<br />
K=E%UCK=F%ULEN=134%DAT=E)</p>
<p>Nmap run completed &#8212; 1 IP address (1 host up) scanned in 23.524 seconds.</p>
<p>Hmmmm, what could this mess be? This mess is what NMAP uses to try and fingerprint the stack. You see, certain stack implementations respond differently when presented with an improper TCP flag, etc.. NMAP has a database of stack fingerprints which is based on RFCs for proper responses and also how specific proprietary stacks respond to the probes that NMAP makes when fingerprinting. What each of these lines represents is a tutorial by itself but if anyone is interested, here is a link that explains it:<br />
<!-- m --><a class="postlink" href="http://www.insecure.org/nmap/nmap-f...ng-article.html">http://www.insecure.org/nmap/nmap-f&#8230;ng-article.html</a></p>
<p><!-- m --></p>
<p>NOTE: To view the content of the NMAP stack fingerprints file, open it in a text editor of your choice. The locations are:<br />
WIN32: %NMAP directory%nmap-os-fingerprints<br />
*NIX: default install directory: /usr/local/share/nmap/nmap-os-fingerprints</p>
<p>Now then, as you can see, NMAP is having a small issue identifying a Windows box. I have included this example on purpose to reinforce the fact that the NMAP fingerprinting feature is *NOT* fool proof.</p>
<p>Now, if you know what kind of box you are hitting and NMAP does not recognize it, you can send the fingerprint to Fyodor (NMAP developer) and it will be added to the fingerprint file in future builds. If you want it right away, you can add it to the nmap-os-fingerprints file on your local machine. Just follow the format of the other entries and you are good to go. This method is also helpful if you don’t want others outside your organization to see how a specific device responds to NMAP fingerprinting. Developers and the like would most likely want to keep this information hush hush for as long as possible.One thing to note is that NMAP will overwrite the fingerprints file when you install a newer release, so keep that in mind if you choose to add entries locally.</p>
<p>Here is the link to submit NMAP fingerprints:</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/cgi-bin/nmap-submit.cgi">http://www.insecure.org/cgi-bin/nmap-submit.cgi</a></p>
<p><!-- m --></p>
<p>NOTE: Per the application developer, ¡§Be careful to not submit fingerprints generated when scanning through firewalls, NAT devices (on your end!) or load balancers without telling that in the Notes section.¡¨</p>
<p>NMAP LOGGING CAPABILITIES<br />
============================</p>
<p>NMAP is capable of logging in several different formats. Personally, I use the human readable format but you do have the option of XML and grepable format. Without getting too deep into this, here are the appropriate switches for each logging method. They can be added anywhere in the NMAP command you issue.<br />
-oN &lt;logfilename&gt; This logs the results of your scans in a normal<br />
human readable form into the file you specify as an argument.</p>
<p>-oX &lt;logfilename&gt; This logs the results of your scans in XML form<br />
into the file you specify as an argument.</p>
<p>-oG &lt;logfilename&gt; This logs the results of your scans in a grepable<br />
form into the file you specify as an argument.</p>
<p>-oA &lt;basefilename&gt; This tells Nmap to log in ALL the major formats<br />
(normal, grepable, and XML). You give a base for the filename, and the output files will be base.nmap, base.gnmap, and base.xml.</p>
<p>-oS &lt;logfilename&gt; thIs l0gz th3 r3suLtS of YouR ScanZ iN a s|&lt;ipT<br />
kiDd|3 f0rM iNto THe fiL3 U sPecfy 4s an arGuMEnT! U kAn gIv3 the 4rgument &#8220;-&#8221; (wItHOUt qUOteZ) to sh00t output iNT0 stDouT!@!!. Just a note that this option is more for fun than anything else. The developer has a sense of humor and it is pretty funny to add this switch just to see what the output looks like. ƒº</p>
<p>THE GRAND FINALE &#8211; AN NMAP SESSION USING A NUMBER OF ADVANCED SWITCHES<br />
==================================================<br />
=========</p>
<p>OK, let’s say that you are auditing a network because, of course, you wouldn’t be attacking one. The firewall admin says that they have a tight firewall and nothing can get around it. However, you notice a CHUBB institute certificate on his wall so already you know that he barely knows which shoe goes on the right foot. You setup shop outside the network and you begin to probe the network. Now, even though you know that one dumdum is working at the company, there could be smarter people lurking around so your paranoia will serve you well. The first thing we do is a port scan to determine if the firewall allows inbound DNS connections for whatever purpose (Zone transfers, etc.).</p>
<p>[haxor@localhost]# NMAP -v -sS -g 53 -p 53 66.99.104.198</p>
<p>Let’s look at the command. We specified s SYN scan with a source port of 53 (DNS) and a destination port of 53 on the host specified. Note that I didn’t try to hide my identity because this is an audit, not an attack. We could have easily used a decoy or zombie scan (covered in earlier tutorials). Now, a decent firewall will immediately dump this source routed traffic. It will examine the contents to determine if this is malicious traffic and typically black hole the traffic.</p>
<p>Let’s say that this turns up nothing. Hmmm, let’s try something else.</p>
<p>[haxor@localhost]# NMAP -v -sU -g 53 -p 53 66.99.104.198</p>
<p>Notice that we are now using the UDP scan switch here. Let’s say that again, we are shot down. Not to worry, there are other avenues. Let’s try this:</p>
<p>[haxor@localhost]# NMAP -v -sS -g 20 -p 23 66.99.104.198</p>
<p>You’ll notice that I now specified an FTP data channel source port. Success!! We will assume that the IP address we hit is a static NAT address which will dump us to a box that sits on the inside of the network. Static NATing to internal addresses is much more common than you may think. If the box is listening, we can *easily* begin to chip away at it and eventually gain access. If we are able to, then GAME OVER. We can safely download a rootkit and anything else we like to the host. We can even go as far as setting up a reverse telnet session using Netcat (but that’s another story). So we now know that the device being used to guard the perimeter of this network is vulnerable to source routed packets that seem to be coming from a legitimate FTP session. This is hole #1. Let’s continue.</p>
<p>OK, so here we are, and we now tell the admin that not only can we poke holes in his network, we now tell him that it will be very difficult if at all possible to see us do it. We tell him that he can watch the logs and we still will be able to sneak under the radar screen.</p>
<p>Let’s make some assumptions. First, let’s say you were doing some traffic analysis and you have a pretty good idea what normal traffic looks like. There are many ways to do this, but different tools are involved. Now, let’s say that all of our precision scans turned up nothing so we’re gonna have to scan the entire class C range that we know is registered to them (because we did a whois on the domain and got all kinds of juicy info). Now, we’re not going to scan the ENTIRE class C range in one sweep. This would be like driving a bus through a library while trying to sneak out. Let’s be a bit more clever. Again, we can use the zombie or decoy switches learned earlier but for this example, we’re going to leave them out.</p>
<p>[haxor@localhost]# NMAP -v -n -T Paranoid -data_length 64 &#8211;randomize_hosts -oN haxor -sV -p 1-65535 66.99.104.198-203</p>
<p>OK, what we’ve done here is tell NMAP to never do a reverse DNS lookup (-n) and use Paranoid scans ( -T Paranoid serializes scans and waits 5 minutes between scans before continuing to the next host in hopes of not triggering an IDS) and we specified a data length consistent with normal traffic (&#8211;data_length 64) and we want it to randomize hosts (&#8211;randomize_hosts) and we want it logged in human readable format (-oN)to haxor and we specified a service scan for the entire IANA range for the host range of 198-203.</p>
<p>WHEW!!! Now, go relax and have a nice glass of beer while NMAP writes a nice file with any available goodies for further review.</p>
<p>CONCLUSION<br />
==================<br />
I have covered quite a few commands and scenarios but there are many more that I have not. I could write a book on the many features NMAP has to offer (like it has a TCP dump type feature using the (-packet_trace switch). Like I mentioned, a book is coming out on its use. My tutorials are designed to give you a solid understanding of its use along with some very handy scan techniques. I hope you enjoyed the series.</p>
<p>I didn&#8217;t get a change to really clean up the formatting, so if something bothers you let me know. Also, if there is something you wanted covered but I didn&#8217;t hit on it, let me know and I will post a mini tut on the feature or technique.</p>
<p>&#8211;TH13</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-nmap-348-lesson-5-fingerprinting-scannin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; NMAP 3.48 Lesson 4 &#8211; Stealth Scans</title>
		<link>http://www.thetazzone.com/tutorial-nmap-348-lesson-4-stealth-scans/</link>
		<comments>http://www.thetazzone.com/tutorial-nmap-348-lesson-4-stealth-scans/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 01:04:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=780</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=687">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=687#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>NMAP v3.48 tutorial lesson 4 of ? rev 1.0 by TheHorse13</p>
<p>PREFACE ***PLEASE READ AND UNDERSTAND THIS*** (Will be repeated at the top of each lesson)<br />
======================<br />
I&#8217;d like to start by saying that I will be covering many of the basic functions along with examples and explanations why you would want to use the tool in each scenario. In addition, I will hit on several advanced features for those who are familiar with the tool but not to the point where advanced knowledge of the application is grasped.</p>
<p>***I will be borrowing verbage (in some cases)*** from the developer because I feel that the developer has worded things in such ways that I cannot improve upon. By no means is this a cut &amp; paste tutorial but I would like to make everyone aware that I will be borrowing info where it makes sense.</p>
<p>NOTE: TheHorse13 takes no responsibility in regards to your use of the information presented in the NMAP tutorial series. If you get into trouble, then obviously you aren’t as 31337 as you thought.</p>
<p>Bold text &#8211; Command syntax<br />
Underlined text – Important information</p>
<p>PREREQUISIT<br />
======================<br />
Please read the past three tutorials if you are new to NMAP. They are all in the Anti-Online tutorials forum.</p>
<p>IN THIS LESSON<br />
=====================<br />
Now that you know how to use NMAP we are going to cover some advanced functionality along with what kind of footprints the application leaves behind. As you may have guessed, one of the topics in this tutorial is how to hide the source of your NMAP footprints. You will benefit from this info because you will see what types of scans NMAP users may use against you and you will also see what results are returned (or logged) when you attempt to enumerate networks. You will also see why NMAP can be most effective in mapping trust relationships on hosts between filtering devices such as firewall and/or routers.</p>
<p>I will be using a default install of Snort 2.0.0 build 72 on Red Hat 9 as a component in this tutorial. I will not be covering any features of Snort but rather what an admin will see if you hit a box that is running Snort. I could have used my own IDS setup but that would require another tutorial along with this series. Besides, I don’t want anyone seeing exactly how my IDS infrastructure responds to scans.</p>
<p>NOTE: Unless otherwise specified, assume that you are in a switched network environment.</p>
<p>Let’s start by just throwing a basic scan at a host that happens to have Snort running. Your IP is 192.168.1.100.</p>
<p>[haxor@localhost]# NMAP –v –sV -O -p 22 192.168.1.254</p>
<p>Snort will generate several alerts, including this one:</p>
<p>[**] SCAN nmap TCP [**]<br />
11/07-01:33:18.752219 192.168.1.100:55464 -&gt; 192.168.1.254:22<br />
TCP TTL:46 TOS:0&#215;0 ID:12633 IpLen:20 DgmLen:60<br />
***A**** Seq: 0&#215;18D5EF65 Ack: 0&#215;0 Win: 0xC00 TcpLen: 40<br />
TCP Options (4) =&gt; WS: 10 NOP MSS: 265 TS: 1061109567 0<br />
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+<br />
=+=+=+=+=+=+=+=+=+=+=</p>
<p>Hmmmm, notice the first line. [**]SCAN nmap TCP[**]. Then notice the source, 192.168.1.100:55464. Well folks, you’ve been made. Game over. Or is it?</p>
<p>Let’s try this again only let’s make a small change to our command. Again, your IP is 192.168.1.100</p>
<p>[haxor@localhost]# NMAP –v –sV –O –D 192.168.2.10 -p 22 192.168.1.254</p>
<p>Notice that we used the –D switch for decoy. This generates the following log entry in Snort:</p>
<p>[**] SCAN nmap TCP [**]<br />
11/07-12:01:08.582551 192.168.2.10:35522 -&gt; 192.168.1.254:22<br />
TCP TTL:46 TOS:0&#215;0 ID:1902 IpLen:20 DgmLen:60<br />
***A**** Seq: 0&#215;2B740381 Ack: 0&#215;0 Win: 0xC00 TcpLen: 40<br />
TCP Options (4) =&gt; WS: 10 NOP MSS: 265 TS: 1061109567 0<br />
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+<br />
=+=+=+=+=+=+=</p>
<p>Notice how Snort thinks the traffic source IP was the decoy you specified, 192.168.2.10, not your true IP address of 192.168.1.100.</p>
<p>One additional thing you can do is add multiple decoys so that it appears that traffic is coming from a number of decoys.</p>
<p>[haxor@localhost]# NMAP –v –sV –O –D 192.168.2.10, 192.168.3.10 -p 22 192.168.1.254</p>
<p>This will generate log entries in Snort that show NMAP scans coming from the two decoys you specified.</p>
<p>Important: Be sure that your decoy machine(s) is/are up otherwise you may end up SYN flooding the target.</p>
<p>Another crafty way to hide yourself is with the –b FTP bounce option. Now, this issue has been addressed years ago and is rare in the wild but you can still find vulnerable FTP servers out there that will gladly bounce traffic for you. Because this is not really popular anymore, I’ll give you a quick explanation on how it works.<br />
Because the RFC for FTP has proxy support, you are able to use an FTP server to bounce traffic. As *Hobbit* wrote back in 1995, this protocol flaw &#8220;can be used to post virtually untraceable mail and news, hammer on servers at various sites, fill up disks, try to hop firewalls, and generally be annoying and hard to track down at the same time.&#8221; What we will exploit this for is to (surprise, surprise) scan TCP ports from a &#8220;proxy&#8221; ftp server. Thus you could connect to an ftp server behind a firewall, and then scan ports…”.</p>
<p>The syntax is simple:</p>
<p>[haxor@localhost]# NMAP –v –sV –O –b anonymous:nopassword@fux0red.com:21 -p 22 192.168.1.254</p>
<p>You will see NMAP connect up and begin to proxy out traffic. Also, NMAP will inform you if a server is able to conduct this type of proxy operation. Typically, when you hit a server that will not do this, NMAP will tell you that the FTP server sucks and cannot be used for this purpose. The actual syntax looks something like this:</p>
<p>Hint: if your bounce scan target hosts aren&#8217;t reachable from here, remember to use -P0 so we don&#8217;t try and ping them prior to the scan</p>
<p>Starting nmap 3.48 (</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/nmap/">http://www.insecure.org/nmap/</a></p>
<p><!-- m -->) at 2003-11-10 12:54 EST<br />
Resolved ftp bounce attack proxy to 10.10.10.112 (Crack-House).<br />
Host 192.168.1.254 appears to be up &#8230; good.<br />
Attempting connection to</p>
<p><!-- m --><a class="postlink" href="ftp://anonymous:ff@10.10.10.112/">ftp://anonymous:ff@10.10.10.112:21</a></p>
<p><!-- m --><br />
Connected:220-Microsoft FTP Service<br />
220 Crack House &#8211; Da Masta Gangstaz<br />
Login credentials accepted by ftp server!<br />
Initiating TCP ftp bounce scan against 192.168.1.254 at 12:54<br />
Your ftp bounce server sucks, it won’t let us feed bogus ports!</p>
<p>Anyway, this is the message you will see 99% of the time. I just wanted to include the syntax and output for learning purposes.</p>
<p>IDLESCANNING: THE NMAP HOLY GRAIL<br />
=========================</p>
<p>Of all the features that NMAP has, this one is my favorite. This scan allows you to gather information about target hosts *without* sending packets. Yes, you read correctly. The most important thing to note is that NMAP reports vulnerability info based on the zombie’s perspective, that is, the machine you are using to idlescan the target. The benefit of this is that the zombie host may have a trust relationship with a target behind a router or firewall, while you, the attacker (or security auditor) obviously has no trust. For more information, along with a diagram, see</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/nmap/idlescan.html">http://www.insecure.org/nmap/idlescan.html</a></p>
<p><!-- m --></p>
<p>Let’s go to work here. The scenario is that I am auditing the perimeter defenses of a subnet that has a router sitting between my subnet and the target subnet. There are about 50 hosts on my network and one of the boxes has a trust relationship with a box on another subnet.<br />
Because we don’t want to be identified by the crafty folks watching the IDS logs, we’re going to use the idlescan technique. Now, the IDS will still log a hit but it will appear to come from the zombie host, not you. This may or may not raise attention based on how you probe the target host. Here we go.</p>
<p>First, let’s assume that you found the host that has the trust relationship. This is a paper on to itself so just bear with me. Now, Snort is positioned on the same network as the target machine.</p>
<p>You = 192.168.1.100<br />
Zombie = 192.168.1.50<br />
Target = 192.168.10.10<br />
Snort = 192.168.10.5</p>
<p>[haxor@localhost]# NMAP –v –P0 –p 1-65535 -sI 192.168.1.50 192.168.10.10</p>
<p>Important: To be sure that an initial ping is not sent by using the –P0 switch, which tells NMAP not to send out an ICMP request to the target host.</p>
<p>Starting nmap 3.48 (</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/nmap/">http://www.insecure.org/nmap/</a></p>
<p><!-- m -->) at 2003-11-10 12:54 EST<br />
Idlescan using zombie 192.168.1.50 (192.168.1.50:80); Class: Incremental<br />
Interesting ports on 192.168.10.10:<br />
(The 65522 ports scanned but not shown below are in state: closed)<br />
Port State Service<br />
21/tcp open ftp<br />
25/tcp open smtp<br />
80/tcp open http<br />
111/tcp open sunrpc<br />
135/tcp open loc-srv<br />
443/tcp open https<br />
1027/tcp open IIS<br />
1030/tcp open iad1<br />
2306/tcp open unknown<br />
5631/tcp open pcanywheredata<br />
7937/tcp open unknown<br />
7938/tcp open unknown<br />
36890/tcp open unknown</p>
<p>Nmap run completed &#8212; 1 IP address (1 host up) scanned in 2594.472 seconds</p>
<p>Can you guess what Snort shows after this scan? Nada, zippo, nothing. It also appears that 192.168.1.50 has permit ACLs on the router as we suspected. All that is left is to compromise this host (which would be a joke for a number of reasons, but again, that’s another tutorial).</p>
<p>NOTE: If the box running Snort and the zombie are hooked up to the same hub as your host running NMAP then you are owned before you begin. Even with the –P0 switch, NMAP will send ICMP traffic to the zombie, which will result in every port on the hub seeing the traffic. This includes the box running Snort. Snort will immediately see this as NMAP activity and will nail you as the source. Be sure you understand networking before you decide to be cute with this application.</p>
<p>NOTE: There are plenty of things you can do to prevent this type of attack. This technique is shown here so that you can see how mis-configured hardware can easily lead to complete compromise. Also, how to use NMAP to identify mis-configured networking hardware.</p>
<p>Next lesson will show how NMAP can be used to identify mis-configured firewalls and how to determine which ACLs are in use.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-nmap-348-lesson-4-stealth-scans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; NMAP 3.48 Lesson 3 &#8211; Common Output</title>
		<link>http://www.thetazzone.com/tutorial-nmap-348-lesson-3-common-output/</link>
		<comments>http://www.thetazzone.com/tutorial-nmap-348-lesson-3-common-output/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 01:02:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=778</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=686">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=686#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>NMAP v3.48 tutorial lesson 3 of ? rev 1.0 by TheHorse13</p>
<p>PREFACE (Will be repeated at the top of each lesson)<br />
======================<br />
I&#8217;d like to start by saying that I will be covering many of the basic functions along with examples and explanations why you would want to use the tool in each scenario. In addition, I will hit on several advanced features for those who are familiar with the tool but not to the point where advanced knowledge of the application is grasped.</p>
<p>I will be borrowing verbage (in some cases) from the developer because I feel that the developer has worded things in such ways that I cannot improve upon. By no means is this a cut &amp; paste tutorial but I would like to make everyone aware that I will be borrowing info where it makes sense.</p>
<p>Bold text &#8211; Command syntax<br />
Underlined text – Important information</p>
<p>NOTE: TheHorse13 takes no responsibility in regards to your use of the information presented in the NMAP tutorial series. If you get into trouble, then obviously you aren’t as 1337 as you thought.</p>
<p>PREREQUISIT<br />
======================<br />
Read Lesson one – The Basics and Lesson 2 &#8211; More Basics, both found in the Tutorial Forum.</p>
<p>IN THIS LESSON<br />
=====================<br />
This lesson deals with typical output observed when scanning outside of your network. Note that we are still using the basic and most common command set without any of the advanced features.</p>
<p>OH NO, WHAT ARE FILTERED AND UNFILTERED PORTS?<br />
====================<br />
Now that you have a grasp on the basic operation of NMAP and the base command line options, let’s take a look at some things that may pop up during your scans. Using NMAP internally is wonderful but the true power of the application is only seen when used *outside* of your network. The reason I say this is because there are many more potential targets…..errrrrr……..servers that need remediation out on the open internet.</p>
<p>Important – When you use basic NMAP functionality to perform scans against a host that is not yours, be prepared to be identified quickly. All good administrators can spot a standard port scan a mile away.</p>
<p>OK, let’s use a basic scan against a host and let’s take a peek at the output.</p>
<p>[haxor@localhost]# NMAP –v –sV -O -p 21,135,139,445,5800,5900 207.96.37.20</p>
<p>NOTE: Output edited for brevity</p>
<p>PORT STATE SERVICE<br />
21/tcp open ftp<br />
135/tcp filtered msrpc<br />
139/tcp filtered netbios-ssn<br />
445/tcp open microsoft-ds<br />
5800/tcp unfiltered vnc-http<br />
5900/tcp filtered vnc</p>
<p>The result of running nmap is usually a list of interesting ports on the machine(s) being scanned (if any). The state is either &#8220;open&#8221;, &#8220;filtered&#8221;, or &#8220;unfiltered&#8221;. Open means that the target machine will accept connections on that port. Filtered means that a firewall, filter, or other network obstacle is covering the port and preventing nmap from determining whether the port is open. Unfiltered means that the port is known by nmap to be closed and no fire wall/filter seems to be interfering with nmap&#8217;s attempts to determine this.</p>
<p>As we can see, this person has closed down the typical NetBIOS ports but forgot to do so to the CIFS service on port 445. This poor admin could have left just enough room for an attacker to enumerate some useful information from this host. We also see that FTP is waiting cheerfully for connections, while VNC is filtered. Oh yes, the HTTP vnc service appears to be closed but nothing seems to be standing in the way. Again. Another potential chink in the armor should the service suddenly become available.</p>
<p>LOOKS LIKE I HIT A FIREWALL<br />
======================<br />
From time to time you may see something like this:</p>
<p>[haxor@localhost]# NMAP –v –sV -O -p 1-65535 207.96.37.21</p>
<p>Starting nmap 3.48 (</p>
<p><!-- m --><a class="postlink" href="http://www.insecure.org/nmap/">http://www.insecure.org/nmap/</a></p>
<p><!-- m -->) at 2003-11-04 14:50 EST<br />
Host 207.96.37.198 appears to be up &#8230; good.<br />
Initiating SYN Stealth Scan against 207.96.37.21 at 14:50<br />
The SYN Stealth Scan took 186 seconds to scan 65535 ports.<br />
Warning: OS detection will be MUCH less reliable because we did not find at least 1 open and 1 closed TCP port<br />
All 65535 scanned ports on 207.96.37.198 are: closed<br />
Device type: firewall|general purpose<br />
Running (JUST GUESSING) : Cisco PIX 6.X|5.X (90%), Stratus VOS (90%)<br />
Aggressive OS guesses: Cisco PIX 506 Firewall (90%), Cisco PIX 515 or 525 running 6.1(4) &#8211; 6.2(1) (90%), Cisco PIX Firewall Version 6.2(2) &#8211; 6.3 (90%), Cisco Secure PIX Firewall Version 5.0(2) (90%), Stratus VOS Release 14.3.1ae (90%)<br />
No exact OS matches for host (test conditions non-ideal).</p>
<p>Nmap run completed &#8212; 1 IP address (1 host up) scanned in 204.288 seconds</p>
<p>Well, well, well, what do we have here? NMAP does an excellent job of identifying firewalls and other network gear. This scan is on the money but you’ll have to do some more probing in order to pinpoint the exact model and exact IOS in use. The problem you have now is that the firewall admin now sees that you have port scanned his/her firewall. But maybe, just maybe there are ways to probe without raising attention. We will cover these techniques in the next lesson. Lesson 4 will be the first advanced lesson in this series. It will cover anonymous scanning, connectionless scanning and other techniques that avoid detection.</p>
<p>As always, comments good, bad and indifferent are welcome.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-nmap-348-lesson-3-common-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; NMAP 3.48 Lesson 2 &#8211; More Basics</title>
		<link>http://www.thetazzone.com/edit-post-report-this-post-warn-user-information-reply-with-quote-tutorial-nmap-348-lesson-2-more-basics/</link>
		<comments>http://www.thetazzone.com/edit-post-report-this-post-warn-user-information-reply-with-quote-tutorial-nmap-348-lesson-2-more-basics/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 00:59:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=775</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=685">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=685#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>NMAP v3.48 tutorial lesson 2 of ? rev 1.0 by TheHorse13</p>
<p>PREFACE (Will be repeated at the top of each lesson)<br />
======================<br />
I&#8217;d like to start by saying that I will be covering many of the basic functions along with examples and explanations why you would want to use the tool in each scenario. In addition, I will hit on several advanced features for those who are familiar with the tool but not to the point where advanced knowledge of the application is grasped.</p>
<p>I will be borrowing verbage (in some cases) from the developer because I feel that the developer has worded things in such ways that I cannot improve upon. By no means is this a cut &amp; paste tutorial but I would like to make everyone aware that I will be borrowing info where it makes sense.</p>
<p>PREREQUISIT<br />
======================<br />
Read Lesson one – The Basics, found in the Tutorial Forum.</p>
<p>IN THIS LESSON<br />
=====================<br />
This lesson will still be at the beginner level so those who are advanced users, look for later lessons where things like connectionless scans are covered.</p>
<p>We will look at some additional scanning techniques and when to use them. We will focus only on internal scans at this point. We will look at output when you hit firewalls, routers and other devices between you and your target in later lessons.</p>
<p>SUBNET, PORT RANGES AND MULTIPLE HOST SCANS<br />
=====================<br />
In lesson 1, we saw a very basic scan that produced results for a single host. Let’s take that same example and add a small twist. You now have an entire subnet that needs to be scanned to pinpoint all of the machines that have remote control services running. In the organization, PCAnywhere is the only supported remote access solution and you now have to track down those who are not in compliance. Being a vigilant security professional, you immediately grab your trusty NMAP tool and go to work.</p>
<p>NOTE: Some folks are quite crafty and don’t run services on the typical port associated with the service. But for now, we will make two assumptions for this example. First, all remote control services are running on the ports that are typically associated with them.</p>
<p>We will assume that three additional remote control services are running out there. They will be, 1) Terminal Services, 2) VNC and 3) LapLink. The subnet you will scan is a class C network so the network is 192.168.1.0 and the subnet mask is 255.255.255.0</p>
<p>OK, let’s create the syntax to discover these services<br />
[haxor@locahost]# NMAP –v –sV -p 1547,5631,3389,5900 192.168.1.0/24</p>
<p>OK, let’s look over what we are doing here.<br />
NMAP – obviously the command<br />
-v – I typically recommend using the verbose switch. If you leave it out, your output will only show the ordered port list and a few less details on scan time responses and other details that may be useful to you.<br />
-sV – Since the default privileged mode scan is sS (SYN Stealth, or half-open scan- a scan where only the SYN flag is sent in the packet) -sV will cause NMAP to communicate with the box to identify the running services that it finds. This feature was added in NMAP-3.48.<br />
-p – Ports can be expressed individually separated by commas, as ranges separated by dashes or a combination such as –p 1547,1567,3300-3350<br />
hosts 192.168.1.0/24 – now, without starting another tutorial subject, subnet masks must be expressed as bits. For example, 255.255.255.0 is a 24 bit mask, 255.255.0.0 is a 16 bit mask, etc. A single host does not require a subnet mask but if you want to be technical, it would be 32 and would work if given as part of the command. You can also use the “*” key like this: -p 192.168.1.* This is the same as 192.168.1.0/24.</p>
<p>Now then, in the interest of post length, I’ll let you play with the multiple host syntax and specific port/port range functionality. You’ll notice that you will get a complete record for each host that is alive and should a host not respond, NMAP will notify you that the host appears to be down and NMAP is skipping it.</p>
<p>One more function that I’d like to cover is the multiple host scan syntax.</p>
<p>[haxor@locahost]# NMAP –v –sV -p 1547,5631,3389,5900 192.168.1.10,11,12</p>
<p>Notice that I just added additional host ID numbers separated by commas. NMAP will recognize this as a multiple host scan. You can also use the same idea when scanning a range of hosts.</p>
<p>[haxor@locahost]# NMAP –v –sV -p 1547,5631,3389,5900 192.168.1.10-15</p>
<p>This will tell NMAP to scan the specified ports using the IP range 192.168.1.10 thru 15. You’ll notice that port and host expressions are the same. This makes learning the command line switches a bit easier.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/edit-post-report-this-post-warn-user-information-reply-with-quote-tutorial-nmap-348-lesson-2-more-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; HPING &#8211; Basic host and port probing. Tut 1 of 5</title>
		<link>http://www.thetazzone.com/tutorial-hping-basic-host-and-port-probing-tut-1-of-5/</link>
		<comments>http://www.thetazzone.com/tutorial-hping-basic-host-and-port-probing-tut-1-of-5/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 00:57:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[networking tutorials]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=773</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=683">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=29&amp;t=683#">Select all</a></dt>
<dd><code>This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.</code></p>
</dd>
</dl>
<p>PREFACE:<br />
=================================================<br />
I&#8217;d like to start by saying that I will be covering many of the basic functions along with examples and explanations why you would want to use the tool in each scenario. In addition, I will hit on several advanced features for those who are familiar with the tool but not to the point where advanced knowledge of the application is grasped. I will be borrowing verbage (in some cases) from the developer because I feel that the developer has worded things in such ways that I cannot improve upon. By no means is this a cut &amp; paste tutorial but I would like to make everyone aware that I will be borrowing info where it makes sense. For those who have been around here for awhile, you know that I preface my tutorials with this advanced warning in the event that someone finds a sentence or two from the original man pages for the app.</p>
<p>SCOPE: Part 1 in a series of 5 – Basic Port and Host Probing<br />
=================================================<br />
The scope of this tutorial is limited to the more popular options used with packet crafting. I will not be covering *every* switch and combination thereof or I would be writing a 500 page book. If there is a particular switch/switch combo you don’t see covered, PM me and I will be happy to write a companion tutorial. Also, HPING has many other uses (port scanner, stack auditing, fire-walking, etc., etc.). I am also going to assume that readers of this tutorial already have a firm grasp on networking and standard protocols. If you do not, you wont benefit much from this series of tutorials. Like my NMAP series, I will start with very basic techniques and ramp up to the more complex in the last two. Again, all input, good or bad, is welcome.</p>
<p>Tool: HPING:</p>
<p><!-- m --><a class="postlink" href="http://www.hping.org/download.html">http://www.hping.org/download.html</a></p>
<p><!-- m --><br />
=================================================</p>
<p>Using HPING for host detection begins with just sending a packet and waiting for the reply. If no reply is received, the host is down, the packet has been filtered or the packet has been dropped. We will use this rule of thumb throughout the series of tutorials. Also, unless otherwise noted, the target host is going to be a W2K3 server.</p>
<p>PART I</p>
<p>TCP SYN Packet Probe:<br />
=================================================<br />
Packets with the SYN bit flagged typically won&#8217;t be filtered or dropped if the target port is open. Normally, an open port will receive this packet and return the expected SYN/ACK-flagged packet. Closed ports will normally return a packet flagged with the RST/ACK bits set. Let’s try this command out.</p>
<p>[root@HorseyLand-Labs]#hping 10.10.10.10 -S -c 1 -p 21</p>
<p>Switches defined:<br />
-S = Set the SYN flag.<br />
-c 1 = Packet count. In this example, I only sent one.<br />
- p 21 = The port on the remote host I want to send the packet to.</p>
<p>HPING 10.10.10.10 (eth0 10.10.10.10): S set, 40 headers + 0 data bytes<br />
len=46 ip=10.10.10.10 ttl=128 DF id=25618 sport=21 flags=SA seq=0 win=16616 rtt=0.4 ms</p>
<p>NOTE: The return packet info begins with len=46.</p>
<p>The above packet was sent to a host to check if port 21 (File Transfer Protocol) is open, and apparently it was. As we expected, a packet was returned with the SYN/ACK bits flagged. Of course the remote host is now expecting another packet from your host with the ACK bit flagged in order to complete the 3-way handshake required for TCP/IP connections.</p>
<p>Let’s dissect the information returned and see what each item means.</p>
<p>S set – The SYN flag is set.<br />
40 headers + 0 data bytes – Shows you that no data was added to the body of the packet.<br />
len &#8211; The size, in bytes, of the data captured from the data link layer excluding the data link header size. This may not match the IP datagram size due to low level transport layer padding.<br />
ip – The target IP address.<br />
ttl – The default time-to-live setting on the packet. It will hop 128 times before dropping off the face of the Earth.<br />
DF &#8211; The “don’t fragment” bit is set<br />
id = This is the IP identification<br />
sport = This is the target port<br />
flags = The flags set on the response<br />
seq = The sequence 32bit number in the TCP header.<br />
win = The TCP window size.<br />
rtt = round trip time in milliseconds.</p>
<p>Now that you see what a normal response is to a SYN packet sent to an open port, let’s try to send the same packet to a closed port.</p>
<p>[root@HorseyLand-Labs]#hping 10.10.10.10 -S –c 1 -p 2</p>
<p>HPING 10.10.10.10 (eth0 10.10.10.10): S set, 40 headers + 0 data bytes<br />
len=46 ip=10.10.10.10 ttl=128 DF id=25927 sport=2 flags=RA seq=0 win=16616 rtt=0.5 ms</p>
<p>The above packet, flagged with the SYN bit was sent to a closed port, port 2. Notice that the RST/ACK flag is set on the return packet. This is the expected behavior because the port is not accepting TCP/IP connections</p>
<p>TCP ACK packet: Is the host alive?<br />
=================================================</p>
<p>When a packet with the ACK (acknowledge) bit flagged is sent to a host, if the host is alive, it should respond with another packet with the RST (reset) bit flagged. The beauty of this technique is that it doesn&#8217;t make a difference whether the port you sent the ACK-flagged packet to is open or closed. If the host is alive, it should respond with a RST-flagged packet.</p>
<p>NOTE: Many vendors are aware of this technique and have built in mechanisms to defeat it.</p>
<p>[root@HorseyLand-Labs]#hping 10.10.10.10 -A –c 1 -p 123</p>
<p>Switches defined:<br />
-A = Set the ACK flag.<br />
-c 1 = Packet count. In this example, I only sent one.<br />
- p 123 = The port on the remote host I want to send the packet to.</p>
<p>HPING 10.10.10.10 (eth0 10.10.10.10): A set, 40 headers + 0 data bytes<br />
len=46 ip=10.10.10.10 ttl=128 id=26250 sport=123 flags=R seq=0 win=0 rtt=1.3 ms</p>
<p>Notice the returned packet, flagged with the RST (reset) bit flagged. This indicates that our host is alive and that TCP ACK-flagged packets are allowed through.</p>
<p>TCP SYN/ACK packet: Another way to see if the host is alive.<br />
==================================================</p>
<p>This technique sends a packet with the SYN and ACK bits flagged. This technique is geared more towards host operating system detection but I wanted to mention it here for two reasons. One, because you can use it to see if a host is alive and two, I want you to become familiar with it for later use. When a host receives a packet flagged with the SYN/ACK bits, it returns a packet flagged with the RST bit flagged. This will be the case whenever a port is open or closed.</p>
<p>[root@HorseyLand-Labs]#hping 10.10.10.10 -SA –c 1 -p 123</p>
<p>HPING 10.10.10.10 (eth0 10.10.10.10): SA set, 40 headers + 0 data bytes<br />
len=46 ip=172.29.94.4 ttl=62 DF id=266 sport=123 flags=R seq=0 win=0 rtt=0.3 ms</p>
<p>By now you should be able to identify the switches I’m using. In later tutorials, I will not reference basic switches as I did early in this tutorial.</p>
<p>That’s all for part I. Look for part II within the next week or so.</p>
<p>&#8211;TH13</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-hping-basic-host-and-port-probing-tut-1-of-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
