{"id":19186428,"url":"https://github.com/mar0ls/packets_sniffer","last_synced_at":"2025-10-29T05:04:03.578Z","repository":{"id":193922694,"uuid":"605159345","full_name":"mar0ls/packets_sniffer","owner":"mar0ls","description":"Simple packets sniffer to learn how it work","archived":false,"fork":false,"pushed_at":"2023-02-23T09:24:01.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T05:34:44.890Z","etag":null,"topics":["blueteam","ethernet","hacking","headers","ip","learn-to-code","packet-sniffing","packets","python","sniffer","socket","tcp","udp","wireshark"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mar0ls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-22T15:15:08.000Z","updated_at":"2023-02-23T09:24:05.000Z","dependencies_parsed_at":"2023-09-10T20:22:43.358Z","dependency_job_id":null,"html_url":"https://github.com/mar0ls/packets_sniffer","commit_stats":null,"previous_names":["mar0ls/packets_sniffer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fpackets_sniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fpackets_sniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fpackets_sniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fpackets_sniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mar0ls","download_url":"https://codeload.github.com/mar0ls/packets_sniffer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240261497,"owners_count":19773474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blueteam","ethernet","hacking","headers","ip","learn-to-code","packet-sniffing","packets","python","sniffer","socket","tcp","udp","wireshark"],"created_at":"2024-11-09T11:14:46.451Z","updated_at":"2025-10-29T05:04:03.449Z","avatar_url":"https://github.com/mar0ls.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv id=\"header\" align=\"center\"\u003e\n    \u003cimg src=\"https://media1.giphy.com/media/3oKIP83aTWXTZZBgmA/200w.webp?cid=ecf05e47kc9m1dgov0kf1c38hmjvub2mgs1hlq7zr0qyp1lx\u0026rid=200w.webp\u0026ct=g\" width=\"100\"/\u003e\n\u003c/div\u003e\n\n# Packets sniffer\nWritten 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.\n\n# What`s i need to know ?\n\n* Exterior Gateway Protocol in Hex format from [list of IP protocol numbers](https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers) \n  and you should know something about  [packet reading](https://www.cs.ryerson.ca/~zereneh/linux/PacketReading.pdf)\n\n\n# IP Header Struckture\n#![image](https://user-images.githubusercontent.com/120790937/220673077-c1c9f205-037f-472d-83d3-5e3f203b086d.png)\n\n\n# TCP Header Structure\n![image](https://user-images.githubusercontent.com/120790937/220673298-210254c4-f229-4231-8c61-0fb9295a740c.png)\n\n\n# UDP Header Structure\n![image](https://user-images.githubusercontent.com/120790937/220673476-dae63136-234b-4db3-a912-1bda6b14767c.png)\n\n# This program works on linux.\n![image](https://user-images.githubusercontent.com/120790937/220696794-993f759a-aca3-455a-972a-3955c8e24286.png)\n\n* If you run this program on Windows, you show this:\n```bash\nTraceback (most recent call last):\n  File \"C:\\packets_sniffer.py\", line 165, in \u003cmodule\u003e\n    main()\n  File \"C:\\packets_sniffer.py\", line 141, in main\n    sniffer_socket = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.htons(0x0003))\n                                   ^^^^^^^^^^^^^^^^\nAttributeError: module 'socket' has no attribute 'PF_PACKET'\n```\nIf you want to run it on Windows, you should PF_PACKET change to AF_INET in socket.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar0ls%2Fpackets_sniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmar0ls%2Fpackets_sniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar0ls%2Fpackets_sniffer/lists"}