Packet sniffing and spoofing are essential techniques in cybersecurity, used for both network monitoring and penetration testing. This project explores these techniques by implementing various sniffing and spoofing tasks using the Scapy library in Python and the pcap library in C. The goal was to understand how attackers manipulate network traffic and to develop countermeasures against such threats.
A controlled lab environment was configured using Docker and Oracle VirtualBox running Ubuntu 20.04. The network topology consisted of:

All machines were connected within the same subnet, enabling direct ARP and ICMP-based communication.
This phase focused on capturing and analyzing network packets using Scapy and C with pcap. Filters were applied to isolate ICMP and TCP traffic, allowing for targeted network monitoring.

Using Scapy and raw sockets, custom packets were crafted to manipulate ICMP echo requests and UDP traffic, demonstrating how attackers forge network communications.

Wireshark was used to capture and analyze network packets, allowing for the identification of protocol behaviors, anomalies, and security vulnerabilities in network traffic.

A packet sniffer was created to extract plaintext data from unencrypted protocols such as Telnet, highlighting risks associated with unsecured communications.

The lab exercises demonstrated how easily an attacker can intercept and modify network packets when security mechanisms are not in place. The major takeaways include:
This project reinforced the importance of network security measures such as encryption, secure protocols, and intrusion detection systems. Understanding packet sniffing and spoofing techniques provides insight into securing networks against similar threats.