Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

4 Answers 4

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

 
discard

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.