{"id":20211122,"url":"https://github.com/jacknewman12/nethex","last_synced_at":"2025-03-03T10:43:25.976Z","repository":{"id":39273471,"uuid":"192030274","full_name":"JackNewman12/NetHex","owner":"JackNewman12","description":"A small rust utility for dumping and sending data-layer network traffic","archived":false,"fork":false,"pushed_at":"2023-03-01T09:57:14.000Z","size":57,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-13T21:36:59.282Z","etag":null,"topics":["data-layer","datalayer","hex","network","networking","networkingtool","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/JackNewman12.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":"2019-06-15T03:04:56.000Z","updated_at":"2022-09-26T10:41:13.000Z","dependencies_parsed_at":"2025-01-13T21:31:38.359Z","dependency_job_id":"3f715e3b-34e4-4618-870f-6a348337c0b8","html_url":"https://github.com/JackNewman12/NetHex","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackNewman12%2FNetHex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackNewman12%2FNetHex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackNewman12%2FNetHex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackNewman12%2FNetHex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JackNewman12","download_url":"https://codeload.github.com/JackNewman12/NetHex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241652944,"owners_count":19997575,"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":["data-layer","datalayer","hex","network","networking","networkingtool","rust","rust-lang"],"created_at":"2024-11-14T05:53:05.034Z","updated_at":"2025-03-03T10:43:25.955Z","avatar_url":"https://github.com/JackNewman12.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetHex\nA small rust utility for dumping data-layer network traffic\n\n[![Rust](https://github.com/JackNewman12/NetHex/actions/workflows/rust.yml/badge.svg)](https://github.com/JackNewman12/NetHex/actions/workflows/rust.yml)\n![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)\n\n```\n./nethex --help\nNetHex 0.8.0\nA small utility for reading / writing directly to a network interface\n\nUSAGE:\n    nethex [FLAGS] [OPTIONS] [ARGS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -R, --raw        Raw Hex Printing\n    -S, --stdin      Inject Hex Packets from File\n    -V, --version    Prints version information\n\nOPTIONS:\n    -b, --blacklist \u003crx-blacklist-filter\u003e    Only print Rx packets that do NOT match this regex filter\n    -c, --count \u003crx-count\u003e                   Number of packet to receive before exiting [default: -1]\n    -f, --filter \u003crx-filter\u003e                 Only print Rx packets that match this regex filter\n    -t, --timeout \u003crx-timeout\u003e               Time to receive for before exiting\n    -F, --file \u003ctx-file\u003e                     Inject Hex Packets from File\n    -r, --rate \u003ctx-rate\u003e                     Rate to transmit (Packets Per Second)\n    -s, --send \u003ctx-send\u003e                     Number of packet to transmit [default: 1]\n\nARGS:\n    \u003cinterface\u003e    The network interface to use\n    \u003cbytes\u003e        The hex bytes to send over the network\n```\n\n\n## Sending a packet\n```\n./nethex eth0 112233445566778899AABBCCDDEEFF -c 0 -s 100 -r 50\n100 / 100 [============================================] 100.00 % 50.49/s \nSending bytes: [11, 22, 33, 44, 55, 66, 77, 88, 99, AA, BB, CC, DD, EE, FF]\nSending bytes: [11, 22, 33, 44, 55, 66, 77, 88, 99, AA, BB, CC, DD, EE, FF]\nSending bytes: [11, 22, 33, 44, 55, 66, 77, 88, 99, AA, BB, CC, DD, EE, FF]\n.. etc ..\n```\n* `--count 0` to not listen after transmitting\n* `--send 100` send 100 of these packets\n* `--rate 50` send 50 per second\n\n### Sending from File or Stdin\n```\ncat mydata.txt | ./nethex eth0 -c 0 --stdin\n```\n* `--stdin` will pipe any hex strings into the network interface, newline seperated\nUseful for fuzz testing a network interface / device\n\n```\n./nethex eth0 -c 0 --file mydata.txt\n```\n* `--file` will pipe any hex strings from a file into the network interface, newline seperated\n\n## Monitoring an network interface\n```\n./nethex eth0 -c 1\n----- Recv Packet -----\n00000000  2A 1E 5F B3 8E E3 1A 8C 8C E9 2B 00 08 00 45 00  | *▲_│Ä∏→îîθ+.◘.E. |\n00000010  00 28 CB 09 40 00 31 06 2C 45 B9 15 D8 A5 C0 A8  | .(╦○@.1♠,E╣§╪Ñ└¿ |\n00000020  00 1E F3 B1 D5 CD A7 29 7E 51 D6 F6 B7 DE 50 10  | .▲≤▒╒═º)~Q╕÷╖▐P► |\n00000030  00 80 DF 02 00 00       \n```\n* `--count 1` only grab one packet before exiting\n\n### Filtering\nWhitelist and blacklist filtering can be applied to the hex data. The filter is performed on the hex string only, not the ASCII area.\nWhitespace and newlines are ignored in the filter.\n\n* `--filter \"77 77 88889999 AA\"` Must contain this hex data. Whitespace ignored. Notice how this match crosses both lines\n* `--blacklist \"123456ABC\"` Must not contain this hex data\n```\n ./nethex lo -f \"77 77 88889999 AA\" -c 1\n[2019-06-30T08:17:24Z INFO  nethex] Recv Packet\n00000000  11 11 22 22 33 33 44 44 55 55 66 66 77 77 88 88  | ◄◄\"\"33DDUUffwwêê |\n00000010  99 99 AA AA BB BB CC CC DD DD EE EE FF FF        | ÖÖ¬¬╗╗╠╠▌▌εε..   |\n\n```\n\n## Logging\nAs of v0.5.0 most of the printing has been turned into an env_logger. While the debugging features are nice, disabling prints allows for a large 20x performance bonus. Logging can be enabled/disable using an enviroment variable. \n```\nLOG=DEBUG ./nethex .........\nLOG=WARN  ./nethex .........\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacknewman12%2Fnethex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacknewman12%2Fnethex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacknewman12%2Fnethex/lists"}