Network Security Exploitation & Mitigation: ARP Poisoning, TCP, and DNS Spoofing Attacks
Task 1 .1— ARP Cache Poisoning
Network Security Exploitation & Mitigation: ARP Poisoning, TCP, and DNS Spoofing Attacks

Task 1 .1— ARP Cache Poisoning
Objective: The goal is to perform an ARP cache poisoning attack, where Host M intercepts communication between Host A and Host B by poisoning their ARP caches.
Step 1: Task Environment Setup
- Set Up Containers: Create three Docker containers (Host A, Host B, Host M) as shown in the figure. These containers must be on the same LAN for the ARP poisoning attack to work.
- Check IP and MAC Addresses:
For each container (A, B, and M), open a terminal and run
ifconfigto note down the IP and MAC addresses of each container's network interface.

Network Setup

Build the container image

Start the containers

To find the ID of the containers

Start the shell on particular container

IP and MAC Address of each container
Step 2: ARP Cache Poisoning
- Modify the
task1_1.pyScript: Inside the SEEDLab VM, modify thetask1_1.pyscript to send an ARP packet from Host M targeting Host A. The packet should map Host B's IP address to Host M's MAC address, poisoning Host A's ARP cache. - Execute the Script on Host M:
Once the script is modified, execute it in Host M using the command:
python3 /volumes/task1_1.py

The modified task1.py file will target container A to add a fake entry to its ARP cache, such that B’s IP address is mapped to M’s MAC address.

Launching the attack

B’s IP Address is mapped to M’s MAC Address
Task 1 .2 — MITM Attack on Telnet using ARP Cache Poisoning
Step 1: Launch ARP Cache Poisoning Attack
- Host M will conduct an ARP poisoning attack on Hosts A and B. This will make Host M the intermediary for packets between A and B.
- In Host A’s ARP cache, B’s IP address will map to M’s MAC address, and vice versa for B’s ARP cache.
- Edit and execute the script
task1_2_1.pyin container M using the command:python3 /volumes/task1_2_1.py

Telnet B from A



Launch the attack

Step 2: Testing (Without IP Forwarding)
- Ensure that IP forwarding is off on Host M with the command:
sysctl net.ipv4.ip_forward=0 - On Host A, ping Host B using:
ping -c20 <B’s IP> - Capture Wireshark results and note any anomalies during the ping test.

Ping from Host A to B when IP Forwarding on Host M is turned off.

Wireshark Analysis
Step 3: Turn On IP Forwarding
- Enable IP forwarding on Host M using:
sysctl net.ipv4.ip_forward=1 - Repeat Step 2 and observe the changes in the ping test and network traffic.

Ping from Host A to B when IP Forwarding on Host M is turned on.

Wireshark Analysis
Step 4: Launch MITM Attack (Modify Telnet Data)
- Keep IP forwarding enabled to establish the Telnet connection from A to B.
- Turn off IP forwarding on Host M with:
sysctl net.ipv4.ip_forward=0 - Type on A’s Telnet window and observe the behavior.
- Modify the
task1_2_2.pyscript on Host M to spoof the Telnet data. For packets from A to B, replace each typed character with a fixed character (e.g., Z). Leave packets from B to A unchanged. - Run the modified script and verify the changes by typing on A’s Telnet window.

task1_2_2.py

When IP Forwarding is OFF and we are running task1_2_1.py and task1_2_2.py

For every keystroke typed in A’s telnet window, each typed character is replaced with ‘z’ on Telnet Server B.
Task 1.3: Modifying Netcat Messages Using ARP Cache Poisoning
- Start Netcat Communication:
On Host B (Server, IP: 10.9.0.6), run
nc -lp 9090. On Host A (Client), connect usingnc 10.9.0.6 9090. - Launch ARP Cache Poisoning:
Modify
task1_1.pyto poison A and B’s ARP caches. Execute on Host M:python3 /volumes/task1_1.py. Verify witharp -aon A and B. - Modify Netcat Traffic:
Edit
task1_3.pyto replace your first name with A’s. Run on Host M:python3 /volumes/task3.py. Test by sending messages from A; check B for modifications.

On container B (server)

On container A (Client)

task1_3.py (python script replaces every occurrence of my first name (Archana) in the message with a sequence of A’s.)


메타데이터
- post_id
- 4ac3fa282dc7
- slug
- network-security-exploitation-mitigation-arp-poisoning-tcp-and-dns-spoofing-attacks-4ac3fa282dc7
- url
- https://medium.com/@kumar677/network-security-exploitation-mitigation-arp-poisoning-tcp-and-dns-spoofing-attacks-4ac3fa282dc7
- canonical_url
- https://medium.com/@kumar677/network-security-exploitation-mitigation-arp-poisoning-tcp-and-dns-spoofing-attacks-4ac3fa282dc7
- author_url
- https://medium.com/@kumar677
- status
- ok
- fetched_at
- 2026-08-16 17:17:32