{"id":28486103,"url":"https://github.com/fox-it/pcap-broker","last_synced_at":"2025-09-10T20:36:53.848Z","repository":{"id":180465310,"uuid":"665152972","full_name":"fox-it/pcap-broker","owner":"fox-it","description":"PCAP-over-IP server written in Golang","archived":false,"fork":false,"pushed_at":"2025-06-02T18:54:14.000Z","size":26,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-07-02T12:48:17.862Z","etag":null,"topics":["attack-defense-ctf","ctf","ctf-tool","network-analysis","pcap","pcap-over-ip","peecap","tcpdump"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fox-it.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":"2023-07-11T14:50:28.000Z","updated_at":"2025-05-29T06:59:26.000Z","dependencies_parsed_at":"2023-11-11T15:23:12.805Z","dependency_job_id":"25f33afc-087c-46fa-b4fe-bdb38d1cbce4","html_url":"https://github.com/fox-it/pcap-broker","commit_stats":null,"previous_names":["fox-it/pcap-broker"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fox-it/pcap-broker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-it%2Fpcap-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-it%2Fpcap-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-it%2Fpcap-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-it%2Fpcap-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fox-it","download_url":"https://codeload.github.com/fox-it/pcap-broker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-it%2Fpcap-broker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266375737,"owners_count":23919616,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["attack-defense-ctf","ctf","ctf-tool","network-analysis","pcap","pcap-over-ip","peecap","tcpdump"],"created_at":"2025-06-08T01:10:15.957Z","updated_at":"2025-07-21T20:37:10.276Z","avatar_url":"https://github.com/fox-it.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pcap-broker\n\n`pcap-broker` is a tool to capture network traffic and make this available to one or more clients via PCAP-over-IP.\n\nPCAP-over-IP can be useful in situations where low latency is a priority, for example during Attack and Defend CTFs.\nMore information on PCAP-over-IP can be found here:\n\n * https://www.netresec.com/?page=Blog\u0026month=2022-08\u0026post=What-is-PCAP-over-IP\n\n`pcap-broker` supports the following features:\n\n * Distributing packet data to one or more PCAP-over-IP clients\n * Execute a command to capture traffic, usually `tcpdump` (expects stdout to be pcap data)\n * `pcap-broker` will exit if the capture command exits\n\n## Building\n\nBuilding `pcap-broker` requires the `libpcap` development headers, on Debian you can install it with:\n\n```shell\n$ apt install libpcap-dev\n```\n\nTo build from source, clone this repository and run:\n\n```shell\n$ go build .\n$ ./pcap-broker --help\n```\n\nOr you can build the Docker container:\n\n```shell\n$ docker build -t pcap-broker .\n$ docker run -it pcap-broker --help\n```\n\nAlternatively, install directly using `go`:\n\n```shell\n$ go install github.com/fox-it/pcap-broker@latest\n$ pcap-broker --help\n```\n\n## Running\n\n```shell\n$ ./pcap-broker --help\nUsage of ./pcap-broker:\n  -cmd string\n        command to execute for pcap data (eg: tcpdump -i eth0 -n --immediate-mode -s 65535 -U -w -)\n  -debug\n        enable debug logging\n  -json\n        enable json logging\n  -listen string\n        listen address for pcap-over-ip (eg: localhost:4242)\n  -n    disable reverse lookup of connecting PCAP-over-IP client IP address\n```\n\nArguments can be passed via commandline:\n\n```shell\n$ ./pcap-broker -cmd \"sudo tcpdump -i eth0 -n --immediate-mode -s 65535 -U -w -\"\n```\n\nOr alternatively via environment variables:\n\n```shell\nLISTEN_ADDRESS=:4242 PCAP_COMMAND='sudo tcpdump -i eth0 -n --immediate-mode -s 65535 -U -w -' ./pcap-broker\n```\n\nUsing environment variables is useful when you are using `pcap-broker` in a Docker setup.\n\nNow you can connect to it via TCP and stream PCAP data using `nc` and `tcpdump`:\n\n```shell\n$ nc -v localhost 4242 | tcpdump -nr -\n```\n\nOr use a tool that natively supports PCAP-over-IP, for example `tshark`:\n\n```shell\n$ tshark -i TCP@localhost:4242\n```\n\n# Acquiring PCAP data over SSH\n\nOne use case is to acquire PCAP from a remote machine over SSH and make this available via PCAP-over-IP.\nSuch a use case, including an example SSH command to bootstrap this, has been documented in the `docker-compose.yml.example` file:\n\n```yaml\nservices:\n\n  pcap-broker-remote-host:\n    image: pcap-broker:latest\n    container_name: pcap-broker-remote-host\n    restart: always\n    volumes:\n      # Mount the private key into container that wil be used for SSH\n      # Ensure that on the `remote-host` the public key is in the /root/.ssh/authorized_keys file.\n      - ~/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro \n    environment:\n      # Command that will be executed by pcap-broker to read PCAP data.\n      # Which is to SSH into `remote-host` and run tcpdump on eth0 and write PCAP data to stdout.\n      # The `not port 22` BPF is necessary to avoid any traffic loops as the PCAP data is transferred over SSH.\n      PCAP_COMMAND: |-\n        ssh root@remote-host -oStrictHostKeyChecking=no\n        tcpdump -U --immediate-mode -ni eth0 -s 65535 -w - not port 22\n\n      # Bind on 0.0.0.0 port 4242. From within the same Docker network you can reach it using the `container_name`\n      # For example in another Docker service you can reach this pcap-broker using `pcap-broker-remote-host:4242`\n      LISTEN_ADDRESS: \"0.0.0.0:4242\"\n    ports:\n      # This is optional, but makes the PCAP-over-IP port also available locally on the Docker host on port 4200.\n      # Handy for debugging, for example: `nc -v localhost 4200 | tcpdump -nr -`\n      - 127.0.0.1:4200:4242\n```\n\n## Background\n\nThis tool was initially written for Attack \u0026 Defend CTF purposes but can be useful in other situations where low latency is preferred, or whenever a no-nonsense PCAP-over-IP server is needed. During the CTF that Fox-IT participated in, `pcap-broker` allowed the Blue Team to capture network data once and disseminate this to other tools that natively support PCAP-over-IP, such as:\n\n* [Arkime](https://arkime.com/) ([docs](https://arkime.com/settings#reader-poi))\n* [Tulip](https://github.com/OpenAttackDefenseTools/tulip) ([#24](https://github.com/OpenAttackDefenseTools/tulip/pull/24))\n* [Shovel](https://github.com/FCSC-FR/shovel)\n* [Pkappa2](https://github.com/spq/pkappa2)\n* WireShark's [dumpcap](https://www.wireshark.org/docs/man-pages/dumpcap.html) and [tshark](https://www.wireshark.org/docs/man-pages/tshark.html) (`-i TCP@\u003chost\u003e:\u003cport\u003e`)\n* Zeek's [zeek-pcapovertcp-plugin](https://github.com/emnahum/zeek-pcapovertcp-plugin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-it%2Fpcap-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffox-it%2Fpcap-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-it%2Fpcap-broker/lists"}