Master the fundamental concepts of raw sockets through this focused micro-challenge.
Normally a NIC delivers only frames addressed to its MAC, broadcast (ff:ff:ff:ff:ff:ff), or subscribed multicast groups. Promiscuous mode removes that filter so every frame on the wire reaches user space. For example, you might see ARP exchanges between 192.168.1.1 and other hosts even though neither endpoint is your machine.
Two common paths:
AF_PACKET socket + setsockopt(PACKET_ADD_MEMBERSHIP, PACKET_MR_PROMISC)pcap_open_live() with promiscuous flag enabledBoth require root or CAP_NET_RAW. On a switched network you still mostly see broadcast and flooded traffic unless you use port mirroring or ARP spoofing.
0x0800In normal mode your NIC might deliver only a few hundred frames per second addressed to its MAC. In promiscuous mode on a busy hub or mirrored switch port, you could see thousands of frames per second including ARP broadcasts, DHCP offers, and unicast traffic between other hosts on 192.168.1.0/24.
This task asks you to document promiscuous mode setup and simulate receiving packets. libpcap uses this exact PACKET_MR_PROMISC path under Wireshark and tcpdump, and understanding it explains why switched networks limit what you can sniff without extra techniques. The 2010 Firesheep tool demonstrated how much session data was exposed on shared Wi-Fi networks when anyone could capture HTTP cookies in promiscuous mode.
Implement a C program that documents promiscuous mode setup.
Requirements:
Success Criteria:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github