<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ayushi Rathore on Medium]]></title>
        <description><![CDATA[Stories by Ayushi Rathore on Medium]]></description>
        <link>https://medium.com/@ayushir?source=rss-9a7fe2d4298b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*uDjq5Iu6pmK46GNoL4OX_g.jpeg</url>
            <title>Stories by Ayushi Rathore on Medium</title>
            <link>https://medium.com/@ayushir?source=rss-9a7fe2d4298b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:53:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayushir/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[IP Source Gaurd]]></title>
            <link>https://medium.com/@ayushir/ip-source-gaurd-e5fbbfca9025?source=rss-9a7fe2d4298b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5fbbfca9025</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[ip-spoofing]]></category>
            <dc:creator><![CDATA[Ayushi Rathore]]></dc:creator>
            <pubDate>Thu, 17 Oct 2019 18:28:05 GMT</pubDate>
            <atom:updated>2019-10-17T18:28:05.445Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>*** Nothing contained in this article is intended to teach or encourage the use of security tools or methodologies for illegal or unethical purposes. Always act in a responsible manner. Make sure you have permission from the proper individuals before you use any of the tools or techniques described here.</em></blockquote><h3><strong>Introduction</strong></h3><p>In IP address spoofing attack the attacker steals the legitimate IP address to hide its actually identity. After that the attacker can easily send and receives the IP datagram packets as they are coming from the valid source. IP spoofing is of two types non blind and blind. In this lab non blind spoofing is performed where attacker is taking a legitimate IP address.</p><p>IP source guard is used to mitigate the IP Spoofing attack. It makes use of the DHCP snooping and Static IP source Binding. In IP source guard whenever a switch receives a packet it looks for the MAC address of the source from the DHCP snooping table. If the MAC address matches with the table address than the packets are allowed else they are discarded.</p><p><strong>Topology Used</strong></p><p>The experiment consists of two systems connected to the router interface. The router has IP address of 192.168.10.1 which connected to the switch interface 1/0/5 via its own interface F0/1. The Victim PC is connected on interface 1/0/1 with IP 192.168.10.4 and Attacker is running Kali VM on IP 192.168.10.5 and running on interface 1/0/3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*kM_aTU4vTGbUHTTTax1KiQ.png" /></figure><p>Initially, both the PCs are pinging each other normally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*fQ8ENFjGzRTzpZD7AcT5mw.png" /><figcaption>Fig. attacker PC pinging viction [attacker:192.168.10.5, victim: 192.168.10.4]</figcaption></figure><p>Note: here source in IPV4 is <strong>192.168.10.5</strong> which is normal case and notice the attacker MAC address in Ethernet II frame.</p><p><strong>1.1.</strong> <strong>Attack Methodology</strong></p><p>This is the very simple kind of attack and performed using the the <strong>hping</strong> command only where attacker adds the spoofed IP address than it adds the destination address and desired protocol.</p><p>Attacker will perform hping to victim:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*4c0Yh9kTzpWQjFtkTitvog.png" /><figcaption>Fig. attacker spoofing the router IP address</figcaption></figure><p>Hping description: It is a free packet generator and analyser for the TCP and IP packets. Here -a tells to spoof source address to 192.168.10.1 and 192.168.10.4 is our destination and ICMP is telling the type of desired protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*2_kZ13JY3dxyDe1ZLubMrw.png" /><figcaption>Fig. Victim Machine wireshark Capture</figcaption></figure><p>Here we can see that victim is successfully replying for all ping sent by attacker. The thing which needs to be noticed here is that in IPV4 tab the IP address of source is 192.168.10.1 but its MAC address is same as the attacker PC when we look into Ethernet II frame. This proves that the attacker is successfully able to spoof IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*DJnK1TubFQhnfdIiFcj-QA.png" /><figcaption>Fig. Wireshark Captures of Attacker Machine</figcaption></figure><p>This Wireshark captures shows that only ping requests are being sent from the attacker machine but no replies are coming back.</p><p><strong>Mitigation</strong></p><p>As mentioned previously the mitigation of IP Spoofing attack is to apply DHCP snooping along with the static IP source binding entries. Where the IP address of the legitimate client is bind with its MAC address.</p><p>Mitigation steps:</p><ul><li>Configure the DHCP snooping globally and on each interface</li><li>Configure switch port security</li><li>Perform IP source binding for all switch ports.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*7m5VkxIjzoPAVhFKd5BmgQ.png" /><figcaption>Fig. DHCP snooping configured globally and on vlan 1</figcaption></figure><p>Set trust on router interface and victim interface. Limit all other interfaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*x884_CUoGxVeVchxEfIrlQ.png" /><figcaption>Fig. DHCP snooping on each interface</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*qmSnHa0Ayr2aTpDuj2tjpw.png" /><figcaption>Fig. port security on interface range</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*L0br2O1O290gL7IvpAX5mg.png" /><figcaption>Fig. port security on switch interface</figcaption></figure><p>Perform the IP source binding with the following command:</p><p>ip source binding mac-address vlan vlan-id ip-address interface type mod/num</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*Wj0aLv3Z0EsOYr0XY6WGdQ.png" /><figcaption>Fig IP source binding command for all switch interfaces</figcaption></figure><p><strong>Results</strong></p><p>Results after applying the IP source guard are as:</p><p>To display ip source guard enabled interface write command: sh ip verify show</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*2O5PyXRxbtpnrFcwiaPAGg.png" /><figcaption>Fig. display IP source guard on interfaces</figcaption></figure><p>To display the source binding, command is :<strong> </strong>sh ip source binding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*4FygGQ3O2xhFMrFWphQQRQ.png" /><figcaption>Fig. Display IP source binding</figcaption></figure><p>When tried to perform the hping again from kali it was not possible. These are wireshark capture when hping is performed again.</p><p>To prevent IP spoofing IP source guard needs to be enabled along with the DHCP snooping. The IP Addresses should be bind to the MAC addresses so that when attacker tries to perform spoofing it can be identified by comparing entry for that particular IP address to its MAC address in IP source binding table.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5fbbfca9025" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DHCP Snooping Attack]]></title>
            <link>https://medium.com/@ayushir/dhcp-snooping-attack-ca728e4dd84?source=rss-9a7fe2d4298b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca728e4dd84</guid>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[dhcp]]></category>
            <category><![CDATA[dhcp-snooping]]></category>
            <dc:creator><![CDATA[Ayushi Rathore]]></dc:creator>
            <pubDate>Tue, 15 Oct 2019 04:32:07 GMT</pubDate>
            <atom:updated>2019-10-17T18:07:44.193Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>*** Nothing contained in this article is intended to teach or encourage the use of security tools or methodologies for illegal or unethical purposes. Always act in a responsible manner. Make sure you have permission from the proper individuals before you use any of the tools or techniques described here.</blockquote><h3><strong>Introduction</strong></h3><p>DHCP server provide the information needed by the client to run on the network. It provides information like IP address, subnet mask, DNS, default gateway and other information. When a client request from DHCP server it create an entry in its DHCP database and assigns the IP address to client.</p><p>An attacker can perform two types of attack:</p><p>1. DHCP Starvation Attack</p><p>2. DHCP Spoofing Attack</p><p>In DHCP starvation attack client sends so many DHCP Discover messages with fake MAC addresses so that the DHCP pool gets filled and Server is not able to serve valid clients. After performing the starvation attack, the attacker can set a rogue DHCP server and starts serving the victim machine with fake IP addresses. This way the attacker can perform man in middle attack which captures the client&#39;s request forward them to the server and receives response from the server and send that to the client.</p><p>To mitigate these attacks DHCP snooping is used. In DHCP snooping, trusted ports are allowed to send DHCP offers and DHCP ACK messages. For the untrusted port, DHCP message request needs to be validated. Untrusted ports are not allowed to send messages like DHCP offer.</p><p>DHCP snooping table is used to identify the untrusted or filtered port messages. All requests coming from an untrusted port are intercepted by the switch and all replies of untrusted ports are discarded.</p><p><strong>Topology</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*zv2-SUeC09DTlDGC9YkG8A.png" /></figure><p><strong>Initial Setup</strong></p><p>Initially configure system as:</p><ul><li>Assign IP address to the router. In this case IP address of router is 192.168.60.1 with subnet mask of 255.255.255.0</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*9CLKBGUuwXlca_tDdAoT9g.png" /></figure><ul><li>Build DHCP Server on the router. The name of my DHCP server is snoopserver.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*eWy1nk4QxZyvd2C7zzv5Eg.png" /></figure><ul><li>Start DHCP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*XN5yR6Zio2sOiUjMH1vTzg.png" /></figure><ul><li>Check whether the service is running fine by checking the IP address of the systems connected with router.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*EDFmSZI5EX9TEicHXb7o9g.png" /></figure><ul><li>Run show IP binding commands to see the address binding in the DHCP database.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*_6JZsUss6Oxvr0Or1i6BJw.png" /></figure><p><strong>Attack Methodology</strong></p><p>Attack is performed in 2 parts:</p><p>· DHCP Starvation Attack</p><p>· DHCP Spoofing Attack</p><p>In DHCP starvation attack the attacker will send DHCP discover messages with fake MAC addresses and will take all the IPs available. After performing starvation attack the attacker will now start leasing out fake IP addresses to the victims by behaving as a DHCP server.</p><p>Steps to perform <strong>DHCP Starvation attack</strong>:</p><p>I. Open kali VM.</p><p>II. In terminal type command <strong>Yersinia -G.</strong></p><p>III. In yersinia select the Interface.</p><p>IV. Go to DHCP tab.</p><p>V. Click Launch Attack and click of DHCP Discover packet radio button.</p><p>VI. Run the attack for some time and exit.</p><p>VII. After the completion of attack run command <strong>show ip dhcp binding</strong>.</p><p>VIII. Run command <strong>show ip dhcp server statistics, </strong>it will tell the number of IP leased out by DHCP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*N4N8VB4a0DoqvSjQETAKag.png" /><figcaption>Fig. launching the attack</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*TIQVf7yuGyJgvgXS2XegQw.png" /><figcaption>Fig. yersinia sending DHCP Discover packets</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*WbjtqK9tgQ78Sz0II6OxCg.png" /><figcaption>Fig. wireshark captures for DHCP discover messages</figcaption></figure><p>Following results were obtained:</p><ul><li>DHCP snooping database count not be locked because of many requests</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*IP2z8XSow6FSaz8UVL1Tww.png" /><figcaption>Fig. Result after the attack</figcaption></figure><ul><li>DHCP binding with some fake MAC addresses.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*rzT3BMb3UFF7DFj3jgvXOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*jJvjO5yX06KN2Lhbp7NAlw.png" /><figcaption>Fig. number of DHCP server requests served</figcaption></figure><p>Steps to perform <strong>DHCP Spoofing attack</strong>:</p><p>I. In the kali VM, open terminal and type command Ettercap -G.</p><p>II. Select unified sniffing tab.</p><p>III. In MiTM attack, select DHCP Spoofing attack.</p><p>IV. In IP pool add spoofed addresses range in my case it is 192.10.100.10–255, in net mask field fill the original the subnet of the attacker and in DNS Server field fill the IP address of attacker which is 192.168.60.5 in our case.</p><p>V. Launch attack.</p><p>VI. Now run ipconfig command on victim machine. We can see that the victim’s IP address is changed to spoofed address and default gateway is attackers IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*cxYZGmbq6LTiPg4q5GNrhA.png" /><figcaption>Fig. Ettercap launching on interface 0</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*9p4-7AW8ti0iISJS28EE8w.png" /><figcaption>Fig. DHCP Spoofing using Ettercap</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*mItN5u5111pmzNBHrUQDRA.png" /><figcaption>Fig. Victim IP and default gateway changed.</figcaption></figure><p>Previously the IP of victim machine was 192.168.60.3 with no default gateway. But after the attack the IP changed to the range specified in Ettercap with default gateway of attacker machine IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*KQ2SLx6nfiyZZM5KwEHSWg.png" /><figcaption>Fig. Wireshark capture showing that victim accepted offer of attacker machine</figcaption></figure><p><strong>Mitigation</strong></p><p>DHCP snooping is the solution for both DHCP starvation attack and DHCP spoofing attack. Following are the steps to configure DHCP snooping:</p><ul><li>Enable DHCP snooping globally</li><li>Enable DHCP snooping on the trusted trust on the trusted interfaces.</li><li>Enable switch security on the interfaces</li><li>Check the final result by running show ip dhcp binding command.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*FXjvvOMROnXH61xsF3vLjw.png" /><figcaption>Fig. configuring dhcp snooping globally and on vlan 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*tA5f0Ywvq2ctWQi7s9xGdQ.png" /><figcaption>Fig. trust established on victim interface.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*eIjWGBvFt_IaY1Eycn4o5w.png" /><figcaption>Fig. trust established on router interface</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*XPyXwnKzaofNlBDaTgsqRw.png" /><figcaption>Fig. Enabled port security on all the used interfaces</figcaption></figure><p><strong>Results</strong></p><p>After configuring the DHCP snooping the victim PC is no longer infected. It got IP address from the legitimate server and its default gateway also got reset. I tried launching the attack again after applying the mitigation but was unsuccessful in that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*tsKfijkkNUs3yqWNY6wCNQ.png" /><figcaption>Fig. Victim IP is in range of DHCP server and have default gateway as router IP address.</figcaption></figure><p>Screenshot for second attempt for attack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*c7kOAhimfzoN9N6zocU3cQ.png" /><figcaption>Fig. attacker not able to launch the attack</figcaption></figure><p>DHCP snooping is performed to prevent layer 2 attacks. DHCP starvation attack can cause the Denial of the service which can bring down the whole system. After the DHCP starvation DHCP spoofing can also be performed which can result in the man in the middle attack where attacker can intercept all the packets between sender and receiver by being the man in the middle without letting anyone know about it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca728e4dd84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VLAN Hopping]]></title>
            <link>https://medium.com/@ayushir/vlan-hopping-668280d00e0?source=rss-9a7fe2d4298b------2</link>
            <guid isPermaLink="false">https://medium.com/p/668280d00e0</guid>
            <category><![CDATA[vlan]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[network-security]]></category>
            <dc:creator><![CDATA[Ayushi Rathore]]></dc:creator>
            <pubDate>Tue, 15 Oct 2019 03:47:58 GMT</pubDate>
            <atom:updated>2019-10-17T18:08:12.971Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>*** Nothing contained in this article is intended to teach or encourage the use of security tools or methodologies for illegal or unethical purposes. Always act in a responsible manner. Make sure you have permission from the proper individuals before you use any of the tools or techniques described here.</blockquote><h3>Introduction</h3><h3><strong>Introduction</strong></h3><p>In normal case communication is only possible between those VLAN which belongs to the same switch or from any VLAN which is related to that switch. When an attacker tries to sniff traffic from different VLAN or send packets to another VLAN than this is called VLAN Hopping attack. This also a layer 2 attack.</p><p>There are two types of VLAN hopping attacks:</p><p>1. Switch Spoofing</p><p>2. Double Tagging</p><p>In switch spoofing the attacker sends the DTP message from his computer to the switch so, that a trunk link can be formed between the attacker and the switch. Once the trunk link is formed between the attacker and the link, the attacker can easily sniffs the packets on all VLANs.</p><p>In Double Tagging attack, the attacker sends double encapsulated 802.1q messages to the switch from where switch removes the outer tag, but the inner VLAN id of the victim PC remains which allows attacker to send network traffic to the victim PC. For double tagging to occur the attacker if attacker is connected to the native VLAN interface of the trunk port. It is a unidirectional attack which can lead to denial of service kind of attacks.</p><p><strong>Topology Used</strong></p><p>The topology consists of 2 cisco switches which are connected via a trunk link on interfaces 1/0/43 and 1/0/47. The Victim PC is on VLAN 10 and is connected to switch 2 on interface 2/0/1. The host PC is on VLAN 10 connected to switch-1 on interface 1/0/1 and attacker is on interface 1/0/3.</p><p>In this exercise attacker will form a trunk link with the host vlan, accessing the native VLAN and then attack on Victim PC located on VLAN 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ntNBhnO5cfjrilEqCiLeA.png" /><figcaption>Fig. Topology used for the experiment</figcaption></figure><p><strong>Attack Methodology</strong></p><p>§ <strong>Switch Spoofing Attack</strong></p><p>The switch spoofing attack is carried as:</p><p>Firstly, I configured the VLAN of the PCs connected to different switch. After setting up their VLAN I connected both the switch by making a trunk link, keeping the native VLAN 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*-NgKrDtQPFTYxIf02ntedQ.png" /><figcaption>Fig. VLAN 10 assigned to switch-1 interface</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*dQi0M-AlIJ8T27-uBqDq6A.png" /><figcaption>Fig. VLAN 10 assigned to switch-2 interface</figcaption></figure><p>After that, I trunked the interfaces of switch-1 and switch-2. The interface number for switch 1 is 1/0/43 and for switch-2 it is 2/0/47.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*95E1FiNjRVrnTyzwPkUGmA.png" /><figcaption>Fig. Shows switch 1 interface is trunking</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*CvBB-5vrvyAuN2Q69BeBug.png" /><figcaption>Fig. Shows switch 2 interface is trunking</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*YXcOMvRwG22HaTiP2HO-Xg.png" /><figcaption>Fig. Both switches are successfully trunked.</figcaption></figure><p>After connecting both the switches. Now attacker will perform trunking with the interface of the switch 1. In this case attacker is on different VLAN and has got access to the access port of switch 1. Therefore, attacker has established connection between himself and switch.</p><p>Firstly I opened Kali and started yersinia by typing command: yersinia -I</p><p>After the yersinia started I started the attack on the switch 1 interface by launching dynamic trunking protocol attack.</p><p>After performing the trunk, the interface of the switch1 PC is showing trunks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*kUqWRRXCV06eXwC7Kd591A.png" /><figcaption>Fig. Yersinia performed DTP trunking</figcaption></figure><p>Now, from the above figure, we can see that the trunk is formed successfully and the attacker got connected to native VLAN of switch 1. This is the end of my switch spoofing attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*CMoMI5QXBERFwjiqXsr_Qw.png" /><figcaption>Fig. Trunking successfully on the interface of switch 1</figcaption></figure><p><strong>Double Tagging</strong></p><p>After that, I started the double tagging attack. Double tagging can only be performed after the switch spoofing so its required. After gaining a successful connection with native VLAN. I sent 802.1q messages to the victim PC located at VLAN 10 with the help of yersinia. The Wireshark results on attacker PC show the frame encapsulated with 2 VLAN IDs and the Wireshark result of victim PC shows the frame that it received from the attacker side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*YP4ca41pwNhw4NasCx0RVw.png" /><figcaption>Fig. attacker sending double encapsulated frame to Victim PC</figcaption></figure><p>In the above figure, we can see attacker has a spoofed MAC address. Here VLAN ID of the first tag is 0001 and second tag have ID of victim’s VLAN i.e. 0010. The destination field also contains the victim destination address.</p><p>The Wireshark results are as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*fSfDysWkB1C_VSLP5zJRig.png" /><figcaption>Fig. attacker wireshark showing double encapsulated frame being sent to victim</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*Sq3_HB8p65GMMi6XTKrLQw.png" /><figcaption>Fig. Victim received ICMP request from attacker</figcaption></figure><p>The above figures show that both the attacks were successful.</p><p><strong>Mitigation</strong></p><p>There are the following solutions for switch spoofing:</p><p>§ Never leave an access port in dynamic desirable, dynamic auto or trunk mode.</p><p>§ Hardcode all access ports and disable DTP.</p><p>§ Hardcode all trunk ports and never enable DTP.</p><p>§ Shutdown all unused interfaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*fmjLRV7LPqxTDk1ZHBj5qA.png" /><figcaption>Fig. All switchport as access port</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*TpafuavmIp1a1sDhv0g8Ag.png" /><figcaption>Fig. Hardcoded trunked port and attacker trunk removed after these commands</figcaption></figure><p>There are following solutions for Double Tagging:</p><p>§ Don’t put any host on default VLAN.</p><p>§ Change native VLAN ID to some unknown VLAN.</p><p>§ Explicit tagging of all native VLAN on all trunk port</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*qkVtWwtAsSGDn2HH1aitfw.png" /><figcaption>Fig. Changed the native VLAN to some other ID on switch-1 interface</figcaption></figure><p><strong>Result</strong></p><p>After performing the mitigation, I tried to launch the attack again. But I was not able to form a trunk link between the host interface and attackers’ interface. As I was not able to form the trunk link between two VLANs I failed in performing both the switch spoofing attack and double tagging attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*IvK7SYWQ-sACuuyK9J569Q.png" /><figcaption>Fig. DTP trunk is not formed after mitgation</figcaption></figure><p>Double tagging can be performed after the switch spoofing. Plus once the attacker is able to get access of the native VLAN he can easily perform DoS on any of the system it want in the different VLAN. Therefore, native VLANs need to be properly configured and good security precautions should be taken.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=668280d00e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Port Security]]></title>
            <link>https://medium.com/@ayushir/port-security-ff4c60670d9d?source=rss-9a7fe2d4298b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff4c60670d9d</guid>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cam-overflow]]></category>
            <dc:creator><![CDATA[Ayushi Rathore]]></dc:creator>
            <pubDate>Tue, 15 Oct 2019 03:21:11 GMT</pubDate>
            <atom:updated>2019-10-17T18:08:45.162Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>*** Nothing contained in this article is intended to teach or encourage the use of security tools or methodologies for illegal or unethical purposes. Always act in a responsible manner. Make sure you have permission from the proper individuals before you use any of the tools or techniques described here.</blockquote><h3>Introduction</h3><h3><strong>Introduction</strong></h3><p>In computer networks ports provide access to the device. When we talk about network security, we refer to the ports on the layer 2 switches. Devices connects to the switch ports to gain network access. Switches maintain the CAM (context addressable memory) table, which maps the MAC addresses to the corresponding switch port. These MAC addresses can be learned either statically or dynamically. A switch can hold the limited amount of entries in the CAM table after the CAM table gets filled switch can no more learn new MAC Addresses. Attackers use this technique to perform CAM overflow attack. The attacker connects to the switch interface and starts filling it CAM table by sending a large number of Ethernet frames with the fake MAC addresses. After the switch CAM table gets completely filled switch starts behaving like a network hub. Therefore, it starts flooding any packet it receives to all switch ports. This way the attacker can eavesdrop on the communication.</p><p>The problem of CAM overflow attacks can be solved by performing port security. Port security lets the system administrator define the maximum number of allowed MAC addresses on an interface. These addresses can either learn dynamically or can be set statically. By default, the allowed MAC address for an interface is 1 and MAC addresses are learned dynamically. Port security also allows the administrator to define the action that needs to be taken when any violation occurs. The administrator can choose between shutdown, restrict and protect depending on the usage.</p><h4><strong>Topology Used</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*13x1Fp4pDsCpnIh-0iq08w.png" /><figcaption>Topology Used for performing experiment</figcaption></figure><h4><strong>Attack Methodology</strong></h4><p>To perform the CAM overflow attack we have used the macof tool on Kali Linux. It sends large number of ethernet frame to the interface, resulting the CAM table overflow and converting the switch into the network hub.</p><p>The attack is performed as:</p><p>1. In this scenario there are 3 systems connected to single switch interface with IP address configured statistically.</p><p>2. The two communicating system have IP address of 192.168.240.2 and 192.168.240.4. The IP address of attacker is 192.168.243.3</p><p>3. So initially before the attack is performed attacker is not able to capture any packets on Wireshark of communication between the two systems.</p><p>4. The attack is performed on Kali linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*KqSmJcVV1Gf9viCSewO_lQ.png" /><figcaption>Fig: The number of available addresses in CAM (Before attack)</figcaption></figure><p>Than attacker played the MAC flooding using macof tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*YuMsiGZswxIlvXHUYALNTw.png" /><figcaption>Fig: macof executed</figcaption></figure><p>The CAM table got completely filled. (The available space is not going to 0 it stopped at 48. Its due to the fact that the switch I was using have 48 ports and its those 48 which doesn’t got filled).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*fpOeDx0KVZwvA5x2HqTBKQ.png" /><figcaption>Fig: Result after macof</figcaption></figure><p>As from the above figure we can see that the address table is filled completely therefore switch have started overflowing the packets it received. And now the attacker is able to capture the packets in Wireshark.</p><p><strong>Mitigation</strong></p><p>In Port Security the following steps are takes for the mitigation:</p><p>§ Restrict the maximum number of MAC address access from a particular switch interface.</p><p>§ By default, Port security allow only 1 mac address but it can range between 1 to 1024.</p><p>§ Also, admin can set the MAC address to port mapping statically. Instead of letting port create SAT dynamically.</p><p>§ Define the action to be taken during the CAM overflow:</p><p>— Shutdown: Shutdowns the port interface.</p><p>— Restrict: Drops the packet of restricted MAC addresses, maintain log and generate notification about the violation.</p><p>— Protect: It only drops the packets without maintaining any logs.</p><p>The mitigation I applied is as follows:</p><p>Allowed only 3 mac addresses, let them learned dynamically, perform shutdown on violation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*hsJIGN-fQVUm3nrhoZA1MA.png" /><figcaption>Fig. Wireshark packet capture by attacker of the communication b/w two hosts.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*Eun2rZitX41A2JBTPKAiYw.png" /><figcaption>Fig. Port Security Commands (shutdown)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*bKH3mVJN7wmulee4qZ3eZA.png" /><figcaption>Fig. Interface after Configuration Security (shutdown)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*2-yVnOZKIyLFp805WtqeWA.png" /><figcaption>Fig. Port Security Commands (restrict)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*9sZJPZzCVZ2kgfqK7PFcng.png" /><figcaption>Fig. Interface after Configuration Security (restrict)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*gRXMmClTxPuQcvpBjB_eMA.png" /><figcaption>Fig. Port Security Commands (protect)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*fRKU8kJIcB0-UiQ4t5u1sg.png" /><figcaption>Fig. Interface after Configuration Security (protect)</figcaption></figure><p><strong>Results</strong></p><p>These are the results that I got after implementing port security.<br>command: show port-security</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*B2qx0JWTZSIpwZg1BM89Aw.png" /><figcaption>Fig. Interfaces after applying port-security</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff4c60670d9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>