Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 9 days 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 1 year ago)
- Default Branch: main
- Last Pushed: 2023-02-23T09:24:01.000Z (over 1 year ago)
- Last Synced: 2023-09-10T20:12:11.121Z (about 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
#![image](https://user-images.githubusercontent.com/120790937/220673077-c1c9f205-037f-472d-83d3-5e3f203b086d.png)# TCP Header Structure
![image](https://user-images.githubusercontent.com/120790937/220673298-210254c4-f229-4231-8c61-0fb9295a740c.png)# UDP Header Structure
![image](https://user-images.githubusercontent.com/120790937/220673476-dae63136-234b-4db3-a912-1bda6b14767c.png)# This program works on linux.
![image](https://user-images.githubusercontent.com/120790937/220696794-993f759a-aca3-455a-972a-3955c8e24286.png)* 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.