Awesome Open Source
Awesome Open Source

Network Socket and Packet Sniffing on Linux


This is about socket connection and packet sniffing on the network. PL is Python, and the driving test was performed through Linux.


JEONGMUK LIM
Department of Computer Science
Chungbuk National University

- Conditions

  1. Output of Ethernet and IP headers
  2. Using while statement to write multiple times
  3. Read the part that contains the length of the IP header first, then cut the IP header part based on the value and parse it.
  4. The IP header option does not need to be considered.
  5. Write only when Ethernet Type is IPv4


● packet_sniffer.py
○ -i : NIC Name

● server.py
○ -p: port number for connection

● client.py
○ -p: port number for connection
○ -i: host address

Input Example (Packet Sniffing)

$ python3 packet_sniffer.py -i lo

Input Example (Client-Server)

$ python server.py -p 8888
$ python client.py -i 127.0.0.1 -p 8888

● Result for Packet Sniffing by packet_sniffer.py

alt text

● Result for Socket Communication between Server-Client by server.py and client.py

alt text


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (1,118,602
Linux (16,394
Network (3,636
Socket (2,320
Related Projects