Skip to content
Pinaki Mondal edited this page Jan 30, 2021 · 3 revisions

SIPTorch supports several command line arguments as documented below.

Here is the help output from the tool itself:

$ ./siptorch.py -h

  SIPTorch - A SIP Torture Testing Suite
           Version : v0.1.0

usage: ./siptorch.py -u <url/ip> [options]

Required Arguments:
  -u TARGET, --target TARGET
                        Destination target to test

Optional Arguments:
  -p RPORT, --rport RPORT
                        Destination port to use for sending packets to (default: 5060)
  -P LPORT, --lport LPORT
                        Local source port to use for binding to (default: 5060)
  -o OUTPUT, --output OUTPUT
                        Output directory to write results to (default: ./siptorch-output/)
  -d DELAY, --delay DELAY
                        Throttle packet rate by specifying delay in seconds between two subsequent requests (default:
                        0)
  -t TIMEOUT, --timeout TIMEOUT
                        Timeout value in seconds (default: 5)
  -e EXTENSION, --extension EXTENSION
                        Extension to use during tests (default: 2000)
  -F FROMADDR, --from-addr FROMADDR
                        The `From` address of the SIP message, should strictly be of 
                        format - `"name" <sip:ext@(site.tld|ip)>`
  -T TOADDR, --to-addr TOADDR
                        The `To` address of the SIP message
  -v, --verbose         Increase output verbosity, multiple -v increase verbosity
  -q, --quiet           Decrease verbosity to lowest level
  -V, --version         Display the version number and exit
  --user-agent USER_AGENT
                        Use custom user-agent
  --spoof-ua            Spoof user-agents with every request randomly
  --build-cache         Build the modules cache (after a new module has been added)

Example Usage

Here are some exemplary usage cases:

  • Basic usage:
    ./siptorch.py -u sip.example.com --rport 5060 -v
  • Specify timeout and add a delay between requests:
    ./siptorch.py -u sip.example.com --delay 2 --timeout 10
  • Spoof useragents with every request and add a custom local port
    ./siptorch.py -u sip.example.com --spoof-ua --lport 5080

CLI Options

Specifying the target

Flag: -u | --target

The end target can be specified using this switch. Can take in both a site as well as just a bare IP address. This is a required argument.

Usage:

./siptorch.py -u sip.example.com [options]

Specifying target port

Flag: -p | --rport

This is where you specify the port on the target where the SIP service is listening for connections. By default port 5060 is used.

Usage:

./siptorch.py [options] -p 5061

Specifying local port

Flag: -P | --lport

Helps you specify the local port from where to send/receive packets from. By default the port 5060 is used. This also adds backward compatibility for older devices that just respond back to the original source port the request was made to.

Usage:

./siptorch.py [options] --lport 55600

Specifying output directory

Flag: -o | --output

SIPTorch generates a detailed report containing the summary of SIP requests and responses while the tool was running. This flag lets you specify a directory where you want the output to be stored. If a non-existent directory is specified, it creates those directories. By default it creates a folder named siptorch-output/ in your current working directory and puts the report in it.

Usage:

./siptorch.py [options] -o /home/user/asterisk-report/

Specifying custom user-agent

Flag: --user-agent

Helps you to specify a custom user-agent to send with all requests. In case your setup has whitelisted user-agent strings for which it accepts connections, this is the resort to apply to.

Usage:

./siptorch.py [options] --user-agent 'MySuperSIPClient/0.1'

Specifying delay between consecutive requests

Flag: -d | --delay

If you're on a setup where you cannot bombard the server with requests one after another, its is obvious to throttle the requests. This option lets you specify a delay in seconds between two consecutive requests.

Usage:

./siptorch.py [options] --delay 5

Specifying timeout

Flag: -t | --timeout

At times a server might decide to not respond to a SIP packet at all. This is where timeouts come in and this argument helps you specify one in seconds. By default a timeout of 5 seconds is used.

Usage:

./siptorch.py [options] --timeout 10

Using random user-agents

Flag: --spoof-ua

Using random user-agents often fun and used to experimental purposes. Usually its useful for cases where an entity responds differently for a few specific user-agents.

Usage:

./siptorch.py [options] --spoof-ua

Increasing verbosity

Flag: -v | --verbose

If you're a curious guy just like me, and want to know what goes on under the hood with this tool, you're welcome to use this switch. Multiple -vs will increase the verbosity.

Usage:

./siptorch.py [options] -vvv

Decreasing verbosity

Flag: -q | --quiet

If you do not want any verbose output while the tool is running and just interested in the report, this is switch you want. It decreases the verbosity to the lowest level possible which only sticks to error messages.

Usage:

./siptorch.py [options] --quiet

Displaying tool information

Flag: -V | --version

This flag displays the license and version number and then exits.

Usage:

./siptorch.py --version

Building modules cache

Flag: --build-cache

After addition of a new module, you will need to update the modules.json file. Simply run the command with this argument after placing your new module within the modules folder. That will automatically update the index. For more info on writing modules see here.

Usage:

./siptorch.py --build-cache