A SIP scanning attack usually has the following steps:
- Randomly send SIP OPTIONS messages to the wide Internet on port 5060 to see which services are out there. The IP addresses that get probed can be completely random or targeting a given company or service provider or a complete country. This way, the attacker gathers a list of IP addresses that host SIP services.
- For each IP target, a set of commonly used extensions (00, 01, 001, 002, etc.) are probed to see if they are configured. This is done usually with a REGISTER message for each extension. If the server responds with “404 Not found”, the extension is not configured. But if the server responds with “401 Unauthorized”, then the extension exists.
- For each extension, a large set of REGISTER messages are sent, each with a different password, usually taken from dictionaries. If for any of these requests the answer is “200 OK’, it means that the password was found. The attacker can now use it to place calls.
For better or worse, the open-source Sipvicious tools (also known as “friendly scanners” after the user agent string they use) make running the steps above ridiculously easy. As you can see from their website, a python script is provided for each of the above steps. They support saving of sessions between runs, distributing scans across computers and generating the list of commonly used extensions. The website also links to a set of dictionaries that can be used for password cracking.
One thing to note is that potentially a very large number of SIP requests are transmitted. For example, if there are 5 PBXes in a network, each with 100 extensions and the attacker uses a dictionary with 10,000 words, a total of 2 * 5 * 100 * 10,000 = 10 millions SIP messages will be generated. This is where the friendly scanner becomes a bit rude and transforms itself in an unintentional DoS attack. Newer versions of Sipvicious have more generous delays between requests, but they are easily modifiable by the too-eager script kiddies.
Another interesting observation is that step 2 above relies on the server responding with different response codes depending on whether the extension exists or not (401 and 404 in the example above). By setting your server to always reply with 401 for unauthorized requests, you are making the job of the attacker much harder.
An easy way to test if your VoIP service has weak extensions is to run our free online SIP scanner. It runs Sip vicious behind the scenes and presents you a nice report about how your server looks like when scanned by an attacker.


