https://github.com/cappe987/hexend
Send hexdumps copied from Wireshark/Tcpdump
https://github.com/cappe987/hexend
c hacktoberfest linux networking tcpdump wireshark
Last synced: about 1 year ago
JSON representation
Send hexdumps copied from Wireshark/Tcpdump
- Host: GitHub
- URL: https://github.com/cappe987/hexend
- Owner: cappe987
- License: mit
- Created: 2022-08-24T20:08:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-12T10:29:51.000Z (over 2 years ago)
- Last Synced: 2023-10-13T04:57:13.800Z (over 2 years ago)
- Topics: c, hacktoberfest, linux, networking, tcpdump, wireshark
- Language: C
- Homepage:
- Size: 43 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hexend - Send raw hex frames
> /hɛksɛnd/ (pronunciation)
For when you want to manually craft frames, or to copy the hexdump from
Tcpdump/Wireshark and repeat or modify the frame afterwards.
```
hexend [FILE] [OPTIONS]
```
File may only contain hexadecimal characters and whitespace.
# Installation
```
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
```
# Examples
Send a frame from file to `eth0`. Repeats until stopped.
```
hexend eth0 my_frames/frame.hex
```
Send a frame from file, repeat 10 times and suppress output
```
hexend eth0 my_frames/frame.hex -c 10 -q
```
Pipe file contents to input, repeat 5 times with 0.1 second interval
```
cat my_frames/frame.hex | hexend eth0 -c 5 -i 0.1
```
Pipe raw string to input, repeat 1000 times with no interval
```
echo ffffffffffffaaaaaaaaaaaa0000 | hexend eth0 -c 1000 -i 0
```
# Test
The test script depends on `tshark` and requires you to have access to running
it. If you have Wireshark and is part of the "wireshark" group it should work.
To run the full test suite do
```
make test
```
To select an individual test you can do
```
make test t=zero_interval
```
# Hexend shell script
After creating this project I found a way to do this with shell scripts, which is what I initially would have wanted. But the performance of the shell script (found in `script/hexend`) is much worse if you want to send a lot of packets. On the upside, it doesn't require escalated privileges. The script is very basic right now and depends on `xxd` and `socat`. It is used the same, either by piping to `stdin`, or by providing a filename. It currently does not support any of the argument flags.