{"id":25102886,"url":"https://github.com/secoats/agora_network_sniffer","last_synced_at":"2025-07-11T15:01:51.958Z","repository":{"id":266305974,"uuid":"340026735","full_name":"secoats/agora_network_sniffer","owner":"secoats","description":"Python3 Network Sniffer","archived":false,"fork":false,"pushed_at":"2021-12-29T15:40:55.000Z","size":146,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T21:36:21.930Z","etag":null,"topics":["networking","pentesting","python3","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secoats.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-18T11:19:35.000Z","updated_at":"2024-03-15T14:06:10.000Z","dependencies_parsed_at":"2024-12-03T16:33:01.078Z","dependency_job_id":"4e16faf3-6e08-4d70-aebd-4e45c82b069d","html_url":"https://github.com/secoats/agora_network_sniffer","commit_stats":null,"previous_names":["secoats/agora_network_sniffer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secoats%2Fagora_network_sniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secoats%2Fagora_network_sniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secoats%2Fagora_network_sniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secoats%2Fagora_network_sniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secoats","download_url":"https://codeload.github.com/secoats/agora_network_sniffer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246769980,"owners_count":20830771,"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":["networking","pentesting","python3","tutorial"],"created_at":"2025-02-07T21:33:25.234Z","updated_at":"2025-04-02T07:12:13.734Z","avatar_url":"https://github.com/secoats.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"This code was created for a tutorial on my blog [Tutorial: Build a Network Sniffer From Scratch](https://secoats.github.io/tutorial/ethernet_sniffer/).  \n\nYou can find the original code from that blog post in the git branch [\"tutorial\"](https://github.com/secoats/agora_sniffer/tree/tutorial).  \nI might add some more features over time on the \"main\" branch.\n\n# Agora Network Sniffer\n\nThis is a rudimentary Python3 Network Sniffer (Ethernet II, ARP, IPv4, IPv6, TCP, UDP). Only run this code in a network you personally own and control. This code is still work-in-progress.\n\nIt must be run as root (because of Layer 2 socket access) and only works on unix-like systems at the moment.\n\n![](./docs/sniffer_a4.png)\n\n## Usage\n\nBasic usage:\n\n```bash\nsudo python3 ./agora.py\n```\n\n```bash\nusage: agora.py [-h] [-v] [-l {2,3,4}] [-n] [-c] [-m {hex,char,both}] [-b BYTEWIDTH]\n\nAgora Network Sniffer\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -v, --verbose         Print ALL header fields\n  -l {2,3,4}, --layer {2,3,4}\n                        Set MAXIMUM layer to parse and print (OSI). Default: 4 (Transport Layer)\n  -n, --nohexdump       Do NOT print a hexdump for protocols with payload.\n  -c, --nocolor         Do NOT print in color\n  -m {hex,char,both}, --dumpmode {hex,char,both}\n                        Hexdump: Print mode. Default: both\n  -b BYTEWIDTH, --bytewidth BYTEWIDTH\n                        Hexdump: number of bytes to print per line.\n```\n\n### Hexdump\n\nThe sniffer will attempt to unpack protocol layers as far as it can (or is allowed to by the `-l` parameter) and then print payloads as an `xxd`-style hexdump.\n\nThe hexdump-feature has three modes:\n\n```bash\n-m both\n-m hex\n-m char\n```\n\nThe `both` mode is the default:\n```bash\nF2 9D 81 80 00 01 00 01 00 00 00 00 04 69 65 65   .............iee\n65 03 6F 72 67 00 00 01 00 01 C0 0C 00 01 00 01   e.org...........                                                                                                          \n00 00 05 BD 00 04 8C 62 C1 98                     .......b..\n```\n\nThe `hex` mode only prints the hex field:\n```bash\nD5 6B 81 80 00 01 00 00 00 01 00 00 04 69 65 65 65 03 6F 72 67 00 00 1C \n00 01 C0 0C 00 06 00 01 00 00 06 5B 00 27 03 6E 73 31 C0 0C 0A 68 6F 73                                                                                                     \n74 6D 61 73 74 65 72 C0 0C 77 FC 7E D1 00 00 1C 20 00 00 0E 10 00 09 3A                                                                                                     \n80 00 00 0E 10\n```\n\nThe `char` mode only prints the character representation:\n```bash\n5............ieee.org................'.ns1...hostmaster..w.~.... ......:.....\n```\n\nThe default number of bytes printed per line are 16 (both), 24 (hex), 96 (char).\n\nYou can set a custom number of bytes per line with:\n```bash\n-b 64, --bytewidth 64\n```\n\nYou can turn off the hexdump-feature completely with:\n\n```bash\n-n, --nohexdump\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecoats%2Fagora_network_sniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecoats%2Fagora_network_sniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecoats%2Fagora_network_sniffer/lists"}