<?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>vCabbage</title>
	<atom:link href="http://vcabbage.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vcabbage.com</link>
	<description>nutrition for the network</description>
	<lastBuildDate>Mon, 16 Aug 2010 00:03:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>DHCP Snooping, IP Source Guard, and DHCP Option 82</title>
		<link>http://vcabbage.com/2010/08/07/dhcp-snooping-ip-source-guard-and-dhcp-option-82/</link>
		<comments>http://vcabbage.com/2010/08/07/dhcp-snooping-ip-source-guard-and-dhcp-option-82/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 23:06:57 +0000</pubDate>
		<dc:creator>kale</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://vcabbage.com/?p=176</guid>
		<description><![CDATA[One of the most secure methods of protecting layer two is IP source guard with MAC verification. IP source guard works in conjunction with port security and DHCP snooping to block all ingress traffic not sourced from the IP and MAC recorded in the DHCP snooping database. (This article only discusses IP source guard with MAC verification, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most secure methods of protecting layer two is IP source guard with MAC verification. IP source guard works in conjunction with port security and DHCP snooping to block all ingress traffic not sourced from the IP and MAC recorded in the DHCP snooping database. (This article only discusses IP source guard with MAC verification, port security and option 82 is not necessary if you are not using MAC verification.)</p>
<p><span id="more-176"></span></p>
<p>When a client initially connects to a port protected by IP source guard only DHCP discover and request messages are allowed, everything else is dropped. An important point to keep in mind is that at this point no traffic, including DHCP, will cause the switch to add an entry for the client in the CAM table and therefor when the DHCP server responds with an offer the switch will not know where to send the packet and when DHCP snooping is enabled replies from the DHCP server are not flooded out all ports if there is no entry in the CAM, so the DHCP offer will be dropped. To get around this DHCP option 82, or Relay Agent Information, is necessary. Option 82 is a frequently misunderstood value, likely because unlike other options it is not set by the DHCP server, rather it is set by an intermediary device such as a DHCP relay agent or a switch. Option 82 is made up of two TLVs (type, length, value) fields, the circuit ID and remote ID. The values of these fields are up to the vendor, the default for Cisco switches is to use circuit ID to record vlan, module, and port of the interface the request is received through and remote ID for switch&#8217;s ID (MAC address). When DHCP snooping is enabled you can view the Option 82 configuration with &#8216;show ip dhcp snooping&#8217; as seen below.</p>
<div class="terminal"><code>Switch#show ip dhcp snooping<br />
Switch DHCP snooping is enabled<br />
DHCP snooping is configured on following VLANs:<br />
1<br />
DHCP snooping is operational on following VLANs:<br />
1<br />
DHCP snooping is configured on the following L3 Interfaces:</p>
<p><span id="highlight">Insertion of option 82 is enabled<br />
circuit-id default format: vlan-mod-port<br />
remote-id: 000d.2818.cd00 (MAC)</span><br />
Option 82 on untrusted port is not allowed<br />
Verification of hwaddr field is enabled<br />
Verification of giaddr field is enabled<br />
DHCP snooping trust/rate is configured on the following Interfaces:</p>
<p>Interface                  Trusted    Allow option    Rate limit (pps)<br />
-----------------------    -------    ------------    ----------------<br />
FastEthernet1/0/11         yes        yes             unlimited<br />
Custom circuit-ids:</code></div>
<p>When a DHCP packet is received on an untrusted port the switch adds the option 82 information and sends it on it&#8217;s way, if the option 82 field already exists the packet will be dropped (this behavior can be changed by using the &#8216;ip dhcp snooping information option allow-untrusted&#8217; command under interface configuration). When the DHCP server receives the discover it is expected to return the values in option 82 with it&#8217;s offer, unfortunately not all DHCP servers support this, most glaringly is Microsoft&#8217;s server which just ignores option 82. Assuming that the server does support option 82 and returns an offer with the information intact the switch will determine whether it is the originator of the option 82 information by checking whether the MAC address in the remote ID field matches it&#8217;s own, it then looks at the VLAN, module, and port carried in the circuit ID field to find out which port the packet should be sent out, the switch then strips option 82 out of the packet and forwards it to the specified port. The same process will occur with the request and ack portion of DHCP. If the offer is sent back from the DHCP server without the option 82 information the switch is unable to determine where the packet should be sent and drops it.</p>
<p>Once the DHCP negotiation is completed the switch will add the IP and MAC mapping to the DHCP snooping table and the MAC address will be <span style="text-decoration: underline;">eligible</span> to be added to port security and the CAM table. Note that the MAC address is not added by the DHCP snooping process, additional traffic must occur before the MAC address is added.</p>
<p>Now that we know how IP source guard works lets get to the configuration.</p>
<p>1. Configure the port connected to the DHCP server as trusted.</p>
<div class="terminal">Switch(config)#int fa1/0/11<br />
Switch(config-if)#ip dhcp snooping trust<br />
Switch(config-if)#exit</div>
<p>2. Enable DHCP snooping globally.</p>
<div class="terminal">Switch(config)#ip dhcp snooping<br />
Switch(config)#ip dhcp snooping vlan 1
</div>
<p>3. Configure interface as access port.</p>
<div class="terminal">Switch(config)#int fa1/0/12<br />
Switch(config-if)#switchport mode access
</div>
<p>4. Enable port security on the interface. (For more details on port security see my <a href="http://vcabbage.com/2010/07/31/cam-table-overflow-attack/">CAM Table Overflow Attack</a> article.)</p>
<div class="terminal">Switch(config-if)#switchport port-security</div>
<p>4. Enable IP source guard with MAC verification.</p>
<div class="terminal">Switch(config-if)#ip verify source port-security</div>
<p>We can verify the configuration with the following commands:</p>
<ul>
<li>As seen above &#8216;show ip dhcp snooping&#8217; shows us which VLANs snooping is enabled for, option 82 parameters, and which interfaces are configured as trusted.</li>
</ul>
<ul>
<li>&#8216;show ip dhcp snooping binding&#8217; will display the current bindings for each interface.</li>
</ul>
<div class="terminal">Switch#show ip dhcp snooping binding<br />
MacAddress          IpAddress        Lease(sec)  Type           VLAN  Interface<br />
------------------  ---------------  ----------  -------------  ----  --------------------<br />
00:24:81:68:7F:A3   10.0.0.10        598         dhcp-snooping   1     FastEthernet1/0/12<br />
Total number of bindings: 1</div>
<ul>
<li>Use &#8216;show port security interface [interface]&#8216; to see the port security configuration for a particular interface.</li>
</ul>
<div class="terminal">Switch#show port-security<br />
Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action<br />
                (Count)       (Count)          (Count)<br />
---------------------------------------------------------------------------<br />
   Fa1/0/12              1            1                  0         Shutdown<br />
---------------------------------------------------------------------------<br />
Total Addresses in System (excluding one mac per port)     : 0<br />
Max Addresses limit in System (excluding one mac per port) : 12288</div>
<ul>
<li>&#8216;show ip verify source&#8217; displays the status of each port with IP source guard enabled.</li>
</ul>
<div class="terminal">Switch#show ip verify source<br />
Interface  Filter-type  Filter-mode  IP-address       Mac-address        Vlan<br />
---------  -----------  -----------  ---------------  -----------------  ----<br />
Fa1/0/12   ip-mac       active       10.0.0.10        00:24:81:68:7F:A3  1</div>
<p>We&#8217;re all done with the configuration, but what exactly are we protected against? Well, pretty much any attack that relies on the ability to spoof the source IP or MAC address, this includes CAM overflow, CAM table poisoning, <span style="text-decoration: line-through;">ARP table poisoning</span> (correction: ARP is not IP-based so it is not affected), and DHCP exhaustion to name a few. The DHCP snooping also protects against rogue DHCP servers.</p>
<p>I hope this article shed some light on IP source guard, as always comments are appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcabbage.com/2010/08/07/dhcp-snooping-ip-source-guard-and-dhcp-option-82/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CAM Table Overflow Attack</title>
		<link>http://vcabbage.com/2010/07/31/cam-table-overflow-attack/</link>
		<comments>http://vcabbage.com/2010/07/31/cam-table-overflow-attack/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 20:47:40 +0000</pubDate>
		<dc:creator>kale</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Attacks]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://vcabbage.com/?p=129</guid>
		<description><![CDATA[Most IT pros have heard of CAM table overflow attacks or MAC address flooding attacks and understand at least the basic concept; send a ton of frames with different source MAC addresses to a switch, thereby causing the CAM table to fill and the switch begins to act more like a hub. While the basic [...]]]></description>
			<content:encoded><![CDATA[<p>Most IT pros have heard of CAM table overflow attacks or MAC address flooding attacks and understand at least the basic concept; send a ton of frames with different source MAC addresses to a switch, thereby causing the CAM table to fill and the switch begins to act more like a hub. While the basic idea is correct it&#8217;s not quite that simple. An important factor is how the switch manages the entries in the CAM table, Cisco switches maintain an entry until the aging timer for the entry expires. Even if the CAM table fills due to an attack the existing valid entries will continue to be honored and traffic for those addresses will not be flooded out all ports.</p>
<p><span id="more-129"></span></p>
<p>As an example I setup a 3750 switch with one computer and one router attached (the router could be a computer, it&#8217;s just what I had handy). The switches VLAN 1 was assigned 10.0.0.1/24 and the router 10.0.0.2/24. The computer was running Ubuntu with Wireshark and macof installed. Macof is a simple tool designed specifically to overflow a switches CAM table by rapidly generating thousands of packets with bogus source MAC addresses. I proceeded to test the switch&#8217;s reaction to a mac flooding attack as follows.</p>
<p>1. Started a ping from the router to the switch. As expected none of the unicast traffic was visible in Wireshark.</p>
<div class="terminal">Router#ping 10.0.0.1 repeat 5000</div>
<p>2. Started macof and verified that the CAM table filled. Still no unicast traffice in Wireshark.</p>
<div class="terminal">root@ubuntu:~# macof -i eth0</div>
<p></p>
<div class="terminal">Switch#show mac address-table count</p>
<p>Mac Entries for Vlan 1:<br />
---------------------------<br />
Dynamic Address Count  : 5960<br />
Static  Address Count  : 0<br />
Total Mac Addresses    : 5960</p>
<p>Total Mac Address Space Available: 0</p></div>
<p>(I&#8217;m not sure why the total mac address space available shows as 40 on my 3750, but the CAM table is indeed filled. Apparently it was a bug, an older IOS doesn&#8217;t exhibit the same issue.)</p>
<p>3. Cleared the MAC entry of the router from the switch&#8217;s CAM table. The replies from the switch to the router immediately showed up in Wireshark.</p>
<div class="terminal">Switch#clear mac address-table dynamic int fa1/0/13</div>
<p>So what happened? As soon as the routers MAC address was removed from the CAM table the available slot was taken by one of the addresses spoofed by macof and when the next echo response was sent the switch no longer knew which port to send it to and had to send it out all ports in the VLAN. If I had not cleared the address I would have had to wait for the device to stop all communications for 5 minutes (the default aging time on Cisco switches), at which point the switch would automatically remove the entry.</p>
<p>It is also worth mentioning that filling the CAM table affects all VLANs on the switch. While traffic will still be confined to individual VLANs the switch will begin flooding traffic to all ports in each respective VLAN.</p>
<h3>Mitigation</h3>
<p>There are plenty of good guides for implementing port security to protect against CAN overflow attacks. I&#8217;m going to explain it again here primarily because I&#8217;m currently studying for the CCSP and explaining the topics is an excellent way to learn and ingrain the material in one&#8217;s head.</p>
<p>Port security is Cisco&#8217;s method of restricting which source MAC addresses can appear on frames entering a port. MAC addresses can be limited based on specific allowed addresses, the total number of MAC addresses seen on the port at any one time, or a combination of both. To stop a CAM table overflow attack in it&#8217;s tracks we only need to limit the total number of MAC addresses per port, I&#8217;ll discuss tying specific MAC addresses to a port in another post.</p>
<p>The &#8216;show port-security&#8217; command will display an overview of all ports configured with port security, for more detail on a specific port use &#8216;show port-security &lt;interface&gt;&#8217;.</p>
<div class="terminal">Switch#show port-security interface fa1/0/12<br />
Port Security              : Disabled<br />
Port Status                : Secure-down<br />
Violation Mode             : Shutdown<br />
Aging Time                 : 0 mins<br />
Aging Type                 : Absolute<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 1<br />
Total MAC Addresses        : 0<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : 0000.0000.0000:0<br />
Security Violation Count   : 0</div>
<p>As you can see port security is not enabled on this port.</p>
<p>1. Port security only works on access ports, so we must first configure the port as such.</p>
<div class="terminal">Switch(config-if)#switchport mode access</div>
<p>2. Now we can enable port security.</p>
<div class="terminal">Switch(config-if)#switchport port-security<br />
Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Shutdown<br />
Aging Time                 : 0 mins<br />
Aging Type                 : Absolute<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 1<br />
Total MAC Addresses        : 0<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : 0000.0000.0000:0<br />
Security Violation Count   : 0</div>
<p>3. By default only one MAC address will be allowed on the port at a time. In some cases you may want to allow more than one, such as is you have a IP phone and computer attached to the port or if technical users have virtualization software installed on their computers. It takes thousands of MAC addresses to fill a CAM table so allowing a few per port doesn&#8217;t pose much of a risk. Here I&#8217;ve allowed 10 MAC address on the port.</p>
<div class="terminal">Switch(config-if)#switchport port-security maximum 10<br />
Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Shutdown<br />
Aging Time                 : 0 mins<br />
Aging Type                 : Absolute<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 10<br />
Total MAC Addresses        : 0<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : 0000.0000.0000:0<br />
Security Violation Count   : 0</div>
<p>You can see that the violation mode is shutdown, this means that the port will be shutdown in an err-disable state if more than 10 MAC addresses appear on the port. The two other options are protect and restrict. Restrict blocks any traffic from MAC addresses beyond the first 10 and logs a message to syslog. Protect is like restrict except that it doesn&#8217;t log any messages, and is useful if you want to make troubleshooting more difficult. We can change the violation mode like so.</p>
<div class="terminal">Switch(config-if)#switchport port-security violation restrict<br />
Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Restrict<br />
&#8230;</div>
<p>Lets see how the switch reacts to a CAM table overflow attack with each the violation types.</p>
<p><span style="text-decoration: underline;">Shutdown</span></p>
<div class="terminal">*Mar  1 00:35:49.874: %PM-4-ERR_DISABLE: psecure-violation error detected<br />
on Fa1/0/12, putting Fa1/0/12 in err-disable state<br />
*Mar  1 00:35:49.882: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation<br />
occurred, caused by MAC address 8063.a860.8bce on port FastEthernet1/0/12.<br />
Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-shutdown<br />
Violation Mode             : Shutdown<br />
Aging Time                 : 0 mins<br />
Aging Type                 : Absolute<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 10<br />
Total MAC Addresses        : 0<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : 8063.a860.8bce:1<br />
Security Violation Count   : 1</div>
<p>To clear the err-disabled state the port must be shutdown then no shutdown.</p>
<p><span style="text-decoration: underline;">Protect</span></p>
<div class="terminal">Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Protect<br />
Aging Time                 : 0 mins<br />
Aging Type                 : Absolute<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 10<br />
Total MAC Addresses        : 10<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : 6878.415d.a608:1<br />
Security Violation Count   : 0</div>
<p>Notice that nothing was logged to the console and the security violation count remains at zero. To clear the learned MAC addresses from port security use &#8216;clear port-security dynamic interface [interface]&#8216;.</p>
<p><span style="text-decoration: underline;">Restrict</span></p>
<div class="terminal">*Mar  1 00:47:07.942: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation<br />
occurred, caused by MAC address 9e03.3047.2847 on port FastEthernet1/0/12.<br />
Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Restrict<br />
Aging Time                 : 0 mins<br />
Aging Type                 : Absolute<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 10<br />
Total MAC Addresses        : 10<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : 5443.823f.edcd:1<br />
Security Violation Count   : 13968</div>
<p>In restrict mode messages are logged as the policy is violated and the violation count increments for each violating MAC address.</p>
<p>By default, once the maximum number of MAC addresses have been seen on a port no other devices may use that port until the MAC addresses are manually cleared. If you would like the allowed MAC addresses to be removed after a period of time aging can be configured on the port. There are two settings related to aging, one is the number of minutes until a MAC address is aged out, the other is the aging type. The aging type can be either absolute or inactivity. The default is absolute, which means that the aging timer starts as soon as the entry is added and will be removed once the specified number of of minutes elapses. The timer for inactivity starts when the MAC address is no longer communicating on the port and is reset if the MAC address start communicating again. Here&#8217;s how to configure the switch to age entries out after five minutes of inactivity.</p>
<div class="terminal">Switch(config-if)#switchport port-security aging time 5<br />
Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Restrict<br />
Aging Time                 : 5 mins<br />
Aging Type                 : Absolute<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 10<br />
Total MAC Addresses        : 10<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : f02b.dd07.012a:1<br />
Security Violation Count   : 115870</div>
<div class="terminal">Switch(config-if)#switchport port-security aging type inactivity<br />
Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Restrict<br />
Aging Time                 : 5 mins<br />
Aging Type                 : Inactivity<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 10<br />
Total MAC Addresses        : 10<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : f02b.dd07.012a:1<br />
Security Violation Count   : 115870</div>
<p>After five minutes we can see that the total MAC addresses has changed from 10 to 0.</p>
<div class="terminal">Switch(config-if)#do show port-security interface fa1/0/12<br />
Port Security              : Enabled<br />
Port Status                : Secure-up<br />
Violation Mode             : Restrict<br />
Aging Time                 : 5 mins<br />
Aging Type                 : Inactivity<br />
SecureStatic Address Aging : Disabled<br />
Maximum MAC Addresses      : 10<br />
Total MAC Addresses        : 0<br />
Configured MAC Addresses   : 0<br />
Sticky MAC Addresses       : 0<br />
Last Source Address:Vlan   : f02b.dd07.012a:1<br />
Security Violation Count   : 115870</div>
<p>I hope this explanation of CAM overflow attacks and mitigations has been helpful. As always I welcome any questions, comments, or corrections.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcabbage.com/2010/07/31/cam-table-overflow-attack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building a Passive Network Tap</title>
		<link>http://vcabbage.com/2010/07/17/building-a-passive-network-tap/</link>
		<comments>http://vcabbage.com/2010/07/17/building-a-passive-network-tap/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 22:44:42 +0000</pubDate>
		<dc:creator>kale</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[tap]]></category>
		<category><![CDATA[Wireshark]]></category>

		<guid isPermaLink="false">http://vcabbage.com/?p=4</guid>
		<description><![CDATA[Have you ever wanted to view the traffic on a link without forcing it to half-duplex with a hub or spending an exorbitant amount of money on a aggregating tap? A cheap DIY passive tap may be your answer. Before we get into the build lets explore the types of network taps and their pros and cons. Hub These [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapComplete.png"><img class="alignright size-full wp-image-8" title="Passive Tap" src="http://vcabbage.com/wp-content/uploads/2010/07/TapComplete.png" alt="" width="205" height="211" /></a>Have you ever wanted to view the traffic on a link without forcing it to half-duplex with a hub or spending an exorbitant amount of money on a aggregating tap? A cheap DIY passive tap may be your answer.</p>
<p>Before we get into the build lets explore the types of network taps and their pros and cons.<span id="more-4"></span></p>
<ul>
<li>Hub<br />
These are cost effective and very simple network taps. The problem is that they force the port to half duplex, which is handy because you can monitor the link with a single network card but if there is a problem relating to full duplex on the link it may not be observable when changed to half duplex. Additionally, if the link is heavily used inserting a hub may affect performance on the network. Finally, true hubs are harder and harder to find since there is little use for them outside monitoring traffic.</li>
</ul>
<ul>
<li>Port Mirroring<br />
Referred to as SPAN (Switched Port Analyzer) in the Cisco world, many managed switches have the ability to duplicate frames from a monitored port to a dedicated monitoring port. If your switches have this capability it is a non-invasive (you don&#8217;t have to unplug ports to insert a tap) method of monitoring a link, though it too has downsides. Mirroring typically runs as a low priority process and if the switch is under heavy load packets may not be mirrored (particularly bad for <a href="http://en.wikipedia.org/wiki/Intrusion_detection_system" target="_blank">IDS</a>), corrupt frames get dropped at ingress and are not mirrored, if bidirectional traffic exceeds the capability of the monitoring port excess traffic will be dropped (ie, when the monitoring ingress and egress traffic on a gigabit link the maximum bidirectional traffic is 2Gbps, which would exceed the capabilities of a gigabit monitoring port).</li>
</ul>
<ul>
<li>Aggregation Tap<br />
An aggregation tap is connected inline between devices and copies all traffic to a monitoring port. This is similar to port mirroring, the difference being an aggregation tap is a dedicated device, they don&#8217;t drop frames do to being overloaded and corrupt frames are passed to the monitoring port. Like port mirroring they can be overloaded if bidirectional traffic exceeds the output of the monitoring port. Aggregation taps tend to be expensive, particularly for personal use. (Note: There are many types of aggregation taps, with varying features, this is not meant to be a thorough examination.)</li>
<li>Passive Tap<br />
As the name implies a passive tap contains no special circuitry and is connected inline with the monitored devices. It functions simply by splitting out the receive and transmit wires so that the electrical signal is sent to both the intended devices and two monitoring ports. Two monitoring ports are required because the transmit and receive is not aggregated like with port mirroring or an aggregation tap. Due to this passive taps require two network cards in order to capture bidirectional traffic. This requirement is both a blessing and a curse, the obvious downside is that you need to add an additional network card in your monitoring computer, and popular software such as <a href="http://wireshark.org/" target="_blank">Wireshark</a> is incapable of capturing from multiple cards at once so it becomes necessary to run multiple instances and combine the results later. (Some operating systems can bond interfaces so that multiple instances aren&#8217;t necessary.) The benefit of a passive tap, other than being cheap, is that full bidirectional traffic can be captured, assuming the the monitoring device is able to keep up. <span style="color: #ff0000;">EDIT: Passive network taps do not work on gigabit links, 1000BASE-T uses all four pairs for both receive and transmit so it is not possible to tap gigabit with a passive device.</span></li>
</ul>
<p>Although most of the switches I own and work with are capable of mirroring ports I wanted to be able to see all traffic passing over a link and be able to insert a tap at any point rather than only at a switch. Initially I looked for a guide to building a passive tap but found most of them overly complicated or ugly and fragile. Some were even wired so poorly that in practice they would have taken down the link they were connected to.</p>
<p>In the end I decided to come up with my own. The goal of this project is to create a functional, compact tap sturdy enough to be tossed in a bag and doesn&#8217;t look like a mess of wires. Knowing that I would need four RJ45 jacks I started by looking for small enclosures that could house four keystone jacks, I didn&#8217;t find many and those that I did weren&#8217;t quite what I wanted. While browsing <a href="http://monoprice.com">Monoprice</a> I came across a two port surface mount box with built in RJ45 jacks and wondered how difficult it would be to attach two of them together to create a cube with four jacks. Since they were only a few dollars each I decided to purchase a couple to see if they would fit the bill. To my gratification they worked out better than expected. Enough with the background, lets build one!</p>
<p><strong>Parts</strong></p>
<ul>
<li>2 x Monoprice <a href="http://www.monoprice.com/products/product.asp?c_id=105&amp;cp_id=10517&amp;cs_id=1051705&amp;p_id=2040&amp;seq=1&amp;format=2" target="_blank">Surface Mount Box Cat5e Double</a></li>
<li>2 x Very small nuts and bolts (I used 1/4&#8243; long, 7/64&#8243; diameter bolts)</li>
<li>1 x ~12&#8243; length of Cat5 cable</li>
</ul>
<p><strong>Tools</strong></p>
<ul>
<li>Scissors or Snips</li>
<li>Drill with bit the same diameter as bolts</li>
<li>110 Punch down tool</li>
<li>Philips head screw driver</li>
</ul>
<p><strong>The Build</strong></p>
<p><strong> </strong>1. ﻿Remove the screw from the top of the wall mount boxes and set the tops aside.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep1.png"><img class="size-full wp-image-20 alignnone" title="TapStep1" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep1.png" alt="" width="346" height="155" /></a></p>
<p>2. Unscrew the circuit board from each box.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep2.png"><img class="size-full wp-image-25 alignnone" title="TapStep2" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep2.png" alt="" width="280" height="171" /></a></p>
<p>3. Hold the boxes back to back with the openings for the jacks facing in opposite directions. (I chose to make the boxes face away from each other, you can have them facing the same direction if you would like.) On each side, put the tip of a marker through the hole closest to the jack openings, making sure that it marks the back of the other box.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep3a.png"><img class="alignnone size-full wp-image-29" title="TapStep3a" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep3a.png" alt="" width="221" height="239" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep3b.png"><img class="alignnone size-full wp-image-30" title="TapStep3b" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep3b.png" alt="" width="241" height="240" /></a></p>
<p>4. Use the drill to make a hole where you made the marks.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep4.png"><img class="size-full wp-image-93 alignnone" title="TapStep4" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep4.png" alt="" width="469" height="222" /></a></p>
<p>5. Secure the boxes together using the bolts and nuts.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep5.png"><img class="alignnone size-full wp-image-34" title="TapStep5" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep5.png" alt="" width="245" height="246" /></a></p>
<p>6. Drill a hole through one of the blank areas to the left or right. This hole will be used to pass the receive and transmit wire pairs into the adjoining box, you may need to make it slightly larger than the previous holes.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep6.png"><img class="alignnone size-full wp-image-36" title="TapStep6" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep6.png" alt="" width="221" height="204" /></a></p>
<p>7. Screw the circuit board back on to one side of the tap. Use one of the covers to give yourself a stable base.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep7.png"><img class="alignnone size-full wp-image-43" title="TapStep7" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep7.png" alt="" width="227" height="212" /></a></p>
<p>8. Remove the casing from the length of Cat5 cable, don&#8217;t untwist the pairs. The wires will be punched down as follows:</p>
<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<th></th>
<th colspan="2" align="center">Box 1</th>
<th colspan="2" align="center">Box 2</th>
</tr>
<tr>
<th>Wire</th>
<th>Passthrough 1</th>
<th>Passthrough 2</th>
<th>Host Tap</th>
<th>Switch Tap</th>
</tr>
<tr>
<td>1</td>
<td>green-white</td>
<td>green-white</td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>green</td>
<td>green</td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>orange-white</td>
<td>orange-white</td>
<td>green-white</td>
<td>orange-white</td>
</tr>
<tr>
<td>4</td>
<td>blue</td>
<td>blue</td>
<td></td>
<td></td>
</tr>
<tr>
<td>5</td>
<td>blue-white</td>
<td>blue-white</td>
<td></td>
<td></td>
</tr>
<tr>
<td>6</td>
<td>orange</td>
<td>orange</td>
<td>green</td>
<td>orange</td>
</tr>
<tr>
<td>7</td>
<td>brown-white</td>
<td>brown-white</td>
<td></td>
<td></td>
</tr>
<tr>
<td>8</td>
<td>brown</td>
<td>brown</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>9.Punch down the wires for the two passthrough ports according to the table above, wire numbers are marked on the circuit board. Try to untwist the pairs as little as possible while punching them down, otherwise interference may be introduced. Don&#8217;t trim or cut off one side of the green and orange pairs, these will be used to wire in the tap ports. I recommend punching down the green and orange pair last.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9a1-brown.png"><img class="alignnone size-full wp-image-78" title="TapStep9a1-brown" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9a1-brown.png" alt="" width="195" height="254" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9a2-brown.png"><img class="alignnone size-full wp-image-79" title="TapStep9a2-brown" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9a2-brown.png" alt="" width="202" height="254" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9b1-blue.png"><img class="alignnone size-full wp-image-65" title="TapStep9b1-blue" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9b1-blue.png" alt="" width="215" height="269" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9b2-blue.png"><img class="alignnone size-full wp-image-66" title="TapStep9b2-blue" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9b2-blue.png" alt="" width="204" height="275" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9c1-orange.png"><img class="alignnone size-full wp-image-67" title="TapStep9c1-orange" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9c1-orange.png" alt="" width="202" height="251" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9c2-orange.png"><img class="alignnone size-full wp-image-68" title="TapStep9c2-orange" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9c2-orange.png" alt="" width="225" height="240" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9d1-green.png"><img class="alignnone size-full wp-image-69" title="TapStep9d1-green" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9d1-green.png" alt="" width="172" height="268" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9d2-green.png"><img class="alignnone size-full wp-image-70" title="TapStep9d2-green" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep9d2-green.png" alt="" width="255" height="225" /></a></p>
<p>10. Double check that everything is wired properly, then unscrew the circuit board from the box. Feed the excess green and orange wires through the hole drilled earlier.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep10.png"><img class="alignnone size-full wp-image-82" title="TapStep10" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep10.png" alt="" width="211" height="229" /></a></p>
<p>11. Screw the circuit board back on as well as the cover.</p>
<p>12. Turn the box over and screw in the other circuit board.</p>
<p>13. Punch down the orange and red pairs according to the table from step 8. The orange pair will transmit the data being sent from the switch, the green pairs will transmit the data sent from the host device. (This doesn&#8217;t apply if you are connecting the cables between two host devices.) I recommend that you keep track of which port is connected to which so you can label them when finshed.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep13a-green.png"><img class="alignnone size-full wp-image-83" title="TapStep13a-green" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep13a-green.png" alt="" width="215" height="205" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapStep13b-orange.png"><img class="alignnone size-full wp-image-84" title="TapStep13b-orange" src="http://vcabbage.com/wp-content/uploads/2010/07/TapStep13b-orange.png" alt="" width="189" height="203" /></a></p>
<p>14. Double check the wires are in the correct places and screw the cover on. Label each side as either passthrough or tap (the ports that are fully connected are the passthrough ports, the ports with only two wires connected are the tap ports), optionally you can also label the tap ports as switch or host as discussed in step 13.</p>
<p><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapComplete.png"><img class="alignnone size-full wp-image-8" title="Passive Tap" src="http://vcabbage.com/wp-content/uploads/2010/07/TapComplete.png" alt="" width="205" height="211" /></a><a href="http://vcabbage.com/wp-content/uploads/2010/07/TapCompleteb.png"><img class="alignnone size-full wp-image-85" title="TapCompleteb" src="http://vcabbage.com/wp-content/uploads/2010/07/TapCompleteb.png" alt="" width="209" height="209" /></a></p>
<p><img class="alignright size-full wp-image-86" title="TapConnected" src="http://vcabbage.com/wp-content/uploads/2010/07/TapConnected.png" alt="" width="299" height="400" /></p>
<p>You should now have a complete passive network tap! Connect it between a couple devices and try it out with Wireshark or your packet capture tool of choice. If you don&#8217;t see any packets check your cabling and the wiring inside the tap.</p>
<p>I hope that this article was helpful. Questions, feedback, and improvements are welcome in the comments. I&#8217;m also interested in how you intended to use your new tap.</p>
<p>Next time I&#8217;ll discuss how to combine two packet capture files (hint: mergecap) and show how *nix users can bond interfaces together so that merging the files is not necessary.</p>
<p>Disclaimer: I take no responsibility for any affect this tap has on your network. A properly wired and connected tap can&#8217;t affect the monitored devices, but an improperly wired tap could be devastating. Always test the tap in a non-production environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcabbage.com/2010/07/17/building-a-passive-network-tap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

