https://github.com/mar0ls/packets_sniffer
Simple packets sniffer to learn how it work
https://github.com/mar0ls/packets_sniffer
blueteam ethernet hacking headers ip learn-to-code packet-sniffing packets python sniffer socket tcp udp wireshark
Last synced: 8 months ago
JSON representation
Simple packets sniffer to learn how it work
- Host: GitHub
- URL: https://github.com/mar0ls/packets_sniffer
- Owner: mar0ls
- Created: 2023-02-22T15:15:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-23T09:24:01.000Z (over 3 years ago)
- Last Synced: 2025-01-04T05:34:44.890Z (over 1 year ago)
- Topics: blueteam, ethernet, hacking, headers, ip, learn-to-code, packet-sniffing, packets, python, sniffer, socket, tcp, udp, wireshark
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Packets sniffer
Written as part of self-study. The python [library socket](https://docs.python.org/3/library/socket.html) was used . Below I will present what was helpful to create the above application.
# What`s i need to know ?
* Exterior Gateway Protocol in Hex format from [list of IP protocol numbers](https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers)
and you should know something about [packet reading](https://www.cs.ryerson.ca/~zereneh/linux/PacketReading.pdf)
# IP Header Struckture
#
# TCP Header Structure

# UDP Header Structure

# This program works on linux.

* If you run this program on Windows, you show this:
```bash
Traceback (most recent call last):
File "C:\packets_sniffer.py", line 165, in
main()
File "C:\packets_sniffer.py", line 141, in main
sniffer_socket = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.htons(0x0003))
^^^^^^^^^^^^^^^^
AttributeError: module 'socket' has no attribute 'PF_PACKET'
```
If you want to run it on Windows, you should PF_PACKET change to AF_INET in socket.