Super User is a question and answer site for computer enthusiasts and power users. 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

For testing the error and timeout handling of a custom SIP stack, it is sometimes useful to send UDP packets from multiple source addresses (even ones that are assigned to other hosts) to the host running the SIP stack.

Nmap has the ability to spoof it's source address (-S) and port (-g), I now need to specify what data should be sent to the specified address and port as a UDP packet.

It seems possible to do using the Nmap Scripting Engine, but I haven't found out how to use it.

Is there a straight-forward way to do this using Nmap or another tool readily available on UNIX platforms?

share|improve this question
up vote 4 down vote accepted

You can have a look at Scapy tool is very easy to use to craft packets. It is a python based-tool. You can find a basic example here.

As for spoofing SIP traffic, you can capture actual SIP traffic with wireshark. Export the payload as file and use that file as payload with any of the traffic generation tools.

Other tools available are easy , CLI easy , GUI

share|improve this answer
Scapy looks mighty powerful! I'll look into it. – Feuermurmel Jan 15 '12 at 20:44

netcat can do the job. You can send arbitrary UDP data and spoof the address via -s.

share|improve this answer
How can I specify the payload of a UDP packet? BTW, the option to spoof the source address is written with a capital S. – Feuermurmel Jan 15 '12 at 20:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .