In my daily work I sometimes want to copy and modify raw frames as hexdumps. I will usually copy a hexdump from Wireshark or Tcpdump. Some times I have, however, written frames from scratch. Not very complex ones; nevertheless, it is nice to have the possibility to.

There are plenty of tools out there for building and sending frames. Two good ones I use are Nemesis and EasyFrames. They provide many options for creating different types of frames. Though sometimes you just want full freedom and not have to think about how to do something with the tool. I did not find any complete project that did this. I spent a lot of time googling. I found an easy way to send raw hex frames in Python on StackOverflow that I used for a bit. Eventually I decided to make it into a proper application. I wanted it in C, with the reason being that I might want to use it in an embedded enviroment where Python is not available. I also considered if Bash or any other common shell commands could do this, but nothing that I came up with. Most did not support raw frames. Otherwise, it would have been really sweet to have it as a simple shell script.

Hexend provides an easy way to repeatedly send any frame you want. A specific type of frame is causing you issues? Don’t bother with pcap playbacks or recreating the scenario to trigger the problem. Copy the hexdump (don’t include any line numbers) and start sending the frames. You can specify an amount of frames and an interval for sending them.

Hexend is also scriptable; it supports piping the frame to stdin. However, I’m not entirely sure of any use-case for this yet. Normally you will probably place the hexdump in a file and pass the filename as an argument to Hexend.

Here is an example of piping a minimal frame (dst MAC, src MAC, EtherType) to hexend that gets sent to eth0 1000 times with no interval.

echo ffffffffffffaaaaaaaaaaaa0000 | hexend eth0 -c 1000 -i 0

Edit:

I found a way to do it with shell scripting, depending on xxd and socat. The performance isn’t great for sending many frames quickly. But it is able to use the same input methods. I added a script file to the repo as an alternative. But all it does right now is just this:

cat $2 | xxd -r -p | socat -u STDIN interface:$1