{"id":13498147,"url":"https://github.com/phaethon/kamene","last_synced_at":"2025-05-15T12:05:39.922Z","repository":{"id":26561640,"uuid":"30015633","full_name":"phaethon/kamene","owner":"phaethon","description":"Network packet and pcap file crafting/sniffing/manipulation/visualization security tool. Originally forked from scapy in 2015 and providing python3 compatibility since then.","archived":false,"fork":false,"pushed_at":"2021-08-04T10:48:43.000Z","size":2657,"stargazers_count":871,"open_issues_count":72,"forks_count":190,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-05-10T23:02:56.329Z","etag":null,"topics":["network-scanner","packet-crafting","pcap","python3","scapy","security","sniff"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phaethon.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}},"created_at":"2015-01-29T10:36:27.000Z","updated_at":"2025-04-04T08:04:48.000Z","dependencies_parsed_at":"2022-09-05T05:30:37.521Z","dependency_job_id":null,"html_url":"https://github.com/phaethon/kamene","commit_stats":null,"previous_names":["phaethon/scapy"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaethon%2Fkamene","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaethon%2Fkamene/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaethon%2Fkamene/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaethon%2Fkamene/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phaethon","download_url":"https://codeload.github.com/phaethon/kamene/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337613,"owners_count":22054253,"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":["network-scanner","packet-crafting","pcap","python3","scapy","security","sniff"],"created_at":"2024-07-31T20:00:52.085Z","updated_at":"2025-05-15T12:05:34.907Z","avatar_url":"https://github.com/phaethon.png","language":"Python","readme":"# kamene (formerly known as \"scapy for python3\" or scapy3k) \n\n## General\n\n[Follow @pkt_kamene](https://twitter.com/pkt_kamene) for recent news. [Original documentation updated for kamene](http://kamene.readthedocs.io/en/latest/)\n\n## News\n\nWe underwent naming transition (of github repo, pip package name, and python package name), which will be followed by new functionality. More updates to follow.\n\nKamene is included in the [Network Security Toolkit](http://www.networksecuritytoolkit.org/nst/index.html) Release 28. It used to be included in NST since Release 22 under former name.\n\n## History\n\nThis is a fork of scapy (http://www.secdev.org) originally developed to implement python3 compatibility. It has been used in production on python3 since 2015 (while secdev/scapy implemented python3 compatibility in 2018). The fork was renamed to kamene in 2018 to reduce any confusion.\n\nThese features were first implemented in kamene and some of them might have been reimplemented in scapy by now:\n* replaced PyCrypto with cryptography.io (thanks to @ThomasFaivre)\n* Windows support without a need for libdnet\n* option to return Networkx graphs instead of image, e.g. for conversations\n* replaced gnuplot with Matplotlib\n* Reading PCAP Next Generation (PCAPNG) files (please, add issues on GitHub for block types and options, which need support. Currently, reading packets only from Enhanced Packet Block)\n* new command tdecode to call tshark decoding on one packet and display results, this is handy for interactive work and debugging\n* python3 support\n\n## Installation\n\nInstall with `python3 setup.py install` from source tree (get it with `git clone https://github.com/phaethon/kamene.git`) or `pip3 install kamene` for latest published version.\n\nOn all OS except Linux libpcap should be installed for sending and receiving packets (not python modules - just C libraries) or winpcap driver on Windows. On some OS and configurations installing libdnet may improve experience (for MacOS: `brew install libdnet`). On Windows libdnet is not required. On some less common configurations netifaces may improve experience.\n\n## Usage\n\nUse `bytes()` (not `str()`) when converting packet to bytes. Most arguments expect `bytes` value instead of `str `value except the ones, which are naturally suited for human input (e.g. domain name).*\n\nYou can use kamene running `kamene` command or by importing kamene as library from interactive python shell (python or ipython) or code.\nSimple example that you can try from interactive shell:\n```python\nfrom kamene.all import *\np = IP(dst = 'www.somesite.ex') / TCP(dport = 80) / Raw(b'Some raw bytes')\n# to see packet content as bytes use bytes(p) not str(p)\nsr1(p)\n```\nNotice `'www.somesite.ex'` as a string, and `b'Some raw bytes'` as bytes. Domain name is normal human input, thus it is string, raw packet content is byte data. Once you start using, it will seem easier than it looks.\n\nUse `ls()` to list all supported layers. Use `lsc()` to list all commands.\n\nCurrently, works on Linux, Darwin, Unix and co. Using python 3.4+ on Ubuntu, MacOS, FreeBSD, Windows 10 for testing.\n\nCompatible with [scapy-http module](https://github.com/invernizzi/scapy-http)\n\n### Reading huge pcap file\nrdpcap reads whole pcap file into memory. If you need to process huge file and perform some operation per packet or calculate some statistics, you can use PcapReader with iterator interface.\n\n```python\nwith PcapReader('filename.pcap') as pcap_reader:\n  for pkt in pcap_reader:\n    #do something with the packet\n```\n","funding_links":[],"categories":["Python","\u003ca id=\"79499aeece9a2a9f64af6f61ee18cbea\"\u003e\u003c/a\u003e浏览嗅探\u0026\u0026流量拦截\u0026\u0026流量分析\u0026\u0026中间人","\u003ca id=\"7bf0f5839fb2827fdc1b93ae6ac7f53d\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"99398a5a8aaf99228829dadff48fb6a7\"\u003e\u003c/a\u003e未分类-Network","\u003ca id=\"32739127f0c38d61b14448c66a797098\"\u003e\u003c/a\u003e嗅探\u0026\u0026Sniff"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaethon%2Fkamene","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphaethon%2Fkamene","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaethon%2Fkamene/lists"}