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?

| |

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.

http://trac.secdev.org/scapy/wiki/ScapyRecipes http://www.secdev.org/projects/scapy/build_your_own_tools.html

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

http://www.hping.org/ easy , CLI

http://code.google.com/p/ostinato/ easy , GUI


| |
  • 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.

| |
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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