Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In order to test a firewall, I want to send malformed packets to its interface, regardless of my routing table.

Is there a way to ask linux "send this exact tcp package, to this MAC address, regardless of any network configuration on the system"? I assume I'll need root acccess, but that's OK.

share|improve this question

Scapy is commonly used tool for this purpose. It can be used for creating any kind of packets.

share|improve this answer

I would use nmap in root, it can already send quite all advanced spoofed packets with just some flags.

share|improve this answer

hping3 gets cited as a way to do this sort of thing, without having to learn Python.

share|improve this answer

All previous answers are good, there is a number of very good tools to do that. If you want to take it a step further, writing a simple injector in C is actually quite easy.

Here is a sample of code I wrote a few years back: http://jve.linuxwall.info/ressources/code/forgetcp.c

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.