Exit codes

Each SIPVicious tool will return an exit code that indicates the result of the test. The following exit codes are standard across each tool:

  • 0 is reserved for when no problems are encountered
  • 1 is reserved for catch-all of errors
  • 2 is reserved for command syntax or flag related errors
  • 3 means security issue detected
  • 4 means network connectivity problems

In the case of security issues, each tool will define what constitutes a security issue. Please refer to the tool’s documentation to learn more about this. In the case of network connectivity issues, this is typically when the target system is not found to be responding, or, for example, the network is down.

The following is an example of a bash script running SIPVicious PRO and checking the exit codes for errors:

set -xu

do_test() {
    if [ $? -ne $1 ]; then exit 1; fi

do_test 3 "sipvicious rtp bleed udp://demo.sipvicious.pro -p35000-40000" 
do_test 0 "sipvicious rtp inject udp://demo.sipvicious.pro -p 35000-40000" 
do_test 0 "sipvicious rtp flood udp://demo.sipvicious.pro:5060 -e 1100 -u 1000:1500 --duration 1s"
do_test 3 "sipvicious sip crack online udp://demo.sipvicious.pro:5060 -e 1000 -r 1000-2000"
do_test 3 "sipvicious sip crack digestleak udp://demo.sipvicious.pro:5060 -e 2000"
do_test 3 "sipvicious sip enumerate extensions udp://demo.sipvicious.pro:5060"
do_test 0 "sipvicious sip enumerate methods udp://demo.sipvicious.pro:5060"
do_test 0 "sipvicious sip utils call udp://demo.sipvicious.pro:5060 -e 1400 -u 1000:1500 --invite-mode hangup-call:10s"
do_test 0 "sipvicious sip utils ping udp://demo.sipvicious.pro:5060 --max-requests 3"
do_test 0 "sipvicious sip utils ping udp://demo.sipvicious.pro:5060 -e 1000 --max-requests 3"
do_test 0 "sipvicious sip utils repeater udp://demo.sipvicious.pro:5060"

In this case, the script checks that particular vulnerabilities are detected by looking for exit code 3, to ensure that the demo server is functional. In the case of an automated system for testing an RTC product or service, it is likely that the script would be rewritten so that all tools should return exit code 0.