{"id":18464949,"url":"https://github.com/shadowy-pycoder/mshark","last_synced_at":"2025-04-30T22:11:08.282Z","repository":{"id":253554098,"uuid":"843725929","full_name":"shadowy-pycoder/mshark","owner":"shadowy-pycoder","description":"Simple packet capture tool","archived":false,"fork":false,"pushed_at":"2024-12-15T18:10:11.000Z","size":212,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T20:01:59.031Z","etag":null,"topics":["golang","packet-analyser","packet-capture","packet-sniffer","tcpdump","tshark","wireshark"],"latest_commit_sha":null,"homepage":"","language":"Go","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/shadowy-pycoder.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,"zenodo":null}},"created_at":"2024-08-17T08:25:01.000Z","updated_at":"2025-04-15T04:05:50.000Z","dependencies_parsed_at":"2024-09-14T18:17:52.377Z","dependency_job_id":"4e7dfa2c-903b-4d42-af0b-3f35f1f72370","html_url":"https://github.com/shadowy-pycoder/mshark","commit_stats":null,"previous_names":["shadowy-pycoder/minishark","shadowy-pycoder/mshark"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fmshark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fmshark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fmshark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fmshark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadowy-pycoder","download_url":"https://codeload.github.com/shadowy-pycoder/mshark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251782722,"owners_count":21642979,"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":["golang","packet-analyser","packet-capture","packet-sniffer","tcpdump","tshark","wireshark"],"created_at":"2024-11-06T09:11:36.184Z","updated_at":"2025-04-30T22:11:08.232Z","avatar_url":"https://github.com/shadowy-pycoder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![mshark_new](https://github.com/user-attachments/assets/ee1b9526-dcae-4ff8-962d-315897e49ed0)\n# mShark - Mini [Wireshark](https://www.wireshark.org/) written in Go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/shadowy-pycoder/mshark.svg)](https://pkg.go.dev/github.com/shadowy-pycoder/mshark)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/shadowy-pycoder/mshark)\n[![Go Report Card](https://goreportcard.com/badge/github.com/shadowy-pycoder/mshark)](https://goreportcard.com/report/github.com/shadowy-pycoder/mshark)\n![GitHub Release](https://img.shields.io/github/v/release/shadowy-pycoder/mshark)\n![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/shadowy-pycoder/mshark/total)\n\n\n## Installation\n\nDownload release from [Releases](https://github.com/shadowy-pycoder/mshark/releases) Page.\n\nOr install using `go install` (requires Go 1.23+ but may work with older versions):\n\n```shell\nCGO_ENABLED=0 go install -ldflags \"-s -w\" -trimpath github.com/shadowy-pycoder/mshark/cmd/mshark@latest\n```\nThis will install the `mshark` binary to your `$GOPATH/bin` directory.\n\nIf you are getting a `Permission denied` error when running `mshark`, try running \n```shell\nsudo setcap cap_net_raw+ep ~/go/bin/mshark\n```\n\n## Usage\n\n```shell\nmshark -h\n\n                ______   __                            __       \n               /      \\ |  \\                          |  \\      \n ______ ____  |  $$$$$$\\| $$____    ______    ______  | $$   __ \n|      \\    \\ | $$___\\$$| $$    \\  |      \\  /      \\ | $$  /  \\\n| $$$$$$\\$$$$\\ \\$$    \\ | $$$$$$$\\  \\$$$$$$\\|  $$$$$$\\| $$_/  $$\n| $$ | $$ | $$ _\\$$$$$$\\| $$  | $$ /      $$| $$   \\$$| $$   $$ \n| $$ | $$ | $$|  \\__| $$| $$  | $$|  $$$$$$$| $$      | $$$$$$\\ \n| $$ | $$ | $$ \\$$    $$| $$  | $$ \\$$    $$| $$      | $$  \\$$\\\n \\$$  \\$$  \\$$  \\$$$$$$  \\$$   \\$$  \\$$$$$$$ \\$$       \\$$   \\$$\n                                                                                                                                                                                              \nPacket Capture Tool by shadowy-pycoder \n\nGitHub: https://github.com/shadowy-pycoder/mshark\n\nUsage: mshark [OPTIONS]\nOptions:\n  -h    Show this help message and exit.\n  -D    Display list of interfaces and exit.\n  -c int\n        The maximum number of packets to capture.\n  -e string\n        BPF filter expression. Example: \"ip proto tcp\"\n  -f value\n        File extension(s) to write captured data. Supported formats: stdout, txt, pcap, pcapng\n  -i string\n        The name of the network interface. Example: eth0 (default \"any\")\n  -p    Promiscuous mode. This setting is ignored for \"any\" interface. Defaults to false.\n  -s int\n        The maximum length of each packet snapshot. Defaults to 65535.\n  -t duration\n        The maximum duration of the packet capture process. Example: 5s\n  -v\tDisplay full packet info when capturing to stdout or txt.\n``` \n\n### Example\n\n```shell\nmshark -p -f=txt -f=stdout -f=pcapng -i eth0 -e=\"port 53\"\n```\nThe above command will capture packets containing `port 53` (assumed to be DNS queries) from the `eth0` interface and write the captured data to `stdout`, `txt`, and file in `pcapng` format. Files are created in the current working directory.\n\nOutput:\n\n```shell\n- Interface: eth0\n- Snapshot Length: 65535\n- Promiscuous Mode: true\n- Timeout: 0s\n- Number of Packets: 0\n- BPF Filter: \"port 53\"\n- Verbose: false\n```\n![Screenshot from 2024-09-17 09-37-50](https://github.com/user-attachments/assets/44c233ee-85a4-43f2-8f65-1ef239362bab)\n\nWith `-v` flag enabled, you will see more detailed information:\n\n\n![Screenshot from 2024-09-17 09-56-20](https://github.com/user-attachments/assets/11539ea7-779e-4faf-8fce-2eea9ab653c7)\n![Screenshot from 2024-09-17 09-56-47](https://github.com/user-attachments/assets/26b6353d-d312-40c5-9917-3f2f7bb8abdc)\n\n## Supported layers\n\n- [Ethernet](https://en.wikipedia.org/wiki/Ethernet_frame) \n- [IPv4](https://en.wikipedia.org/wiki/IPv4)\n- [IPv6](https://en.wikipedia.org/wiki/IPv6)\n- [ARP](https://en.wikipedia.org/wiki/Address_Resolution_Protocol)\n- [ICMP](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol)\n- [ICMPv6](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol_for_IPv6)\n- [TCP](https://en.wikipedia.org/wiki/Transmission_Control_Protocol)\n- [UDP](https://en.wikipedia.org/wiki/User_Datagram_Protocol)\n- [DNS](https://en.wikipedia.org/wiki/Domain_Name_System)\n- [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol)\n- [SNMP](https://en.wikipedia.org/wiki/Simple_Network_Management_Protocol)\n- [FTP](https://en.wikipedia.org/wiki/File_Transfer_Protocol)\n- [SSH](https://en.wikipedia.org/wiki/Secure_Shell)\n- [TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security)\n\n\n## Roadmap\n\n- [x] Online packet capture to `stdout`, `txt`, `pcap` and `pcapng` files\n- [ ] Offline packet capture from `pcap` and `pcapng` files\n- [ ] Add proper parsing for `SNMP` messages\n- [ ] Add packet generation and packet injection functionality\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowy-pycoder%2Fmshark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadowy-pycoder%2Fmshark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowy-pycoder%2Fmshark/lists"}