Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 2 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.

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

http://nemesis.sourceforge.net/

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

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.