VoIP Protocols Reference for Pentesting
This skill provides comprehensive reference information about VoIP protocols commonly encountered during network security assessments and penetration testing.
Quick Protocol Identification
| Protocol |
Port(s) |
Type |
Primary Use |
| SIP |
5060/5061 (TCP/UDP/TLS) |
Signaling |
Call setup/teardown |
| MGCP |
2427 (UDP) |
Signaling |
Gateway control |
| SCCP |
2000 (TCP) |
Signaling |
Cisco IP phones |
| H.323 |
1720 (TCP) |
Signaling |
Video/audio conferencing |
| IAX |
4569 (UDP) |
Signaling |
Asterisk trunking |
| RTP |
10000-20000 (UDP) |
Media |
Audio/video transport |
| RTCP |
+1 from RTP (UDP) |
Control |
Quality monitoring |
| SDP |
N/A (embedded) |
Description |
Session negotiation |
Signaling Protocols
SIP (Session Initiation Protocol)
Overview: Industry standard for VoIP call signaling. Text-based protocol using methods like INVITE, ACK, BYE, REGISTER.
Key Characteristics:
- Uses ports 5060 (UDP/TCP) and 5061 (TLS)
- Text-based (human-readable)
- Decentralized architecture
- Widely supported across vendors
Pentesting Considerations:
- Check for authentication bypass vulnerabilities
- Test for SIP flooding attacks
- Verify TLS encryption on port 5061
- Look for registration hijacking opportunities
- Examine INVITE message handling
Common Attack Vectors:
- SIP INVITE flooding (DoS)
- Registration hijacking
- Call interception
- Eavesdropping on unencrypted traffic
- Malicious REGISTER requests
MGCP (Media Gateway Control Protocol)
Overview: Centralized call control protocol (RFC 3435) for managing media gateways.
Architecture:
- Call Agent/MGC: Master controller managing call setup, modification, termination
- Media Gateways (MGs): Convert media between circuit-switched and packet-switched networks
- Signaling Gateways (SGs): Convert signaling between SS7 and IP networks
Key Characteristics:
- Uses port 2427 (UDP)
- Centralized control model
- Text-based protocol
- Common in carrier networks
Pentesting Considerations:
- Target the Call Agent (single point of control)
- Test gateway command injection
- Verify authentication between MGC and gateways
- Check for unauthorized gateway registration
SCCP (Skinny Client Control Protocol)
Overview: Cisco proprietary protocol for IP phone communication with CallManager.
Architecture:
- Call Control Server: Cisco Unified Communications Manager
- SCCP Endpoints: Cisco IP phones, video endpoints
- Gateways: Media conversion devices
Key Characteristics:
- Uses port 2000 (TCP)
- Binary protocol (not human-readable)
- Lightweight, minimal bandwidth
- Cisco-only ecosystem
Pentesting Considerations:
- Requires Cisco environment knowledge
- Binary protocol needs specialized tools
- Focus on CallManager vulnerabilities
- Check for rogue device registration
- Examine SCCP message integrity
H.323
Overview: ITU-T protocol suite for multimedia communication over packet networks.
Components:
- Terminals: IP phones, video conferencing systems
- Gateways: Network conversion devices
- Gatekeepers: Optional call control and management
- MCUs: Multipoint conference management
Key Characteristics:
- Uses port 1720 (TCP) for call signaling
- Complex protocol suite
- Legacy systems still in use
- Supports audio/video codecs
Pentesting Considerations:
- Target gatekeeper services
- Test H.225/H.245 message handling
- Check for buffer overflow vulnerabilities
- Verify encryption implementation
- Examine MCU configuration
IAX (Inter-Asterisk eXchange)
Overview: Binary protocol for Asterisk PBX communication.
Key Features:
- Single UDP port 4569 for signaling and media
- Binary protocol (efficient)
- Built-in trunking support
- Native encryption (RSA/AES)
- Peer-to-peer capable
Pentesting Considerations:
- Focus on Asterisk-specific vulnerabilities
- Test IAX2 authentication mechanisms
- Verify encryption implementation
- Check for trunking abuse
- Examine peer-to-peer routing
Transmission & Transport Protocols
SDP (Session Description Protocol)
Overview: Text format (RFC 4566) for describing multimedia sessions.
Key Elements:
- Session information (name, timing)
- Media stream characteristics
- Connection information (IP, port)
- Attributes (encryption, bandwidth)
Usage Pattern:
- Initiator creates SDP description
- SDP sent via signaling protocol (SIP, RTSP)
- Receiver processes and responds
- Negotiation completes
Pentesting Considerations:
- Analyze SDP for information disclosure
- Check for IP address leakage
- Verify codec negotiation security
- Examine encryption attribute handling
RTP / RTCP / SRTP / ZRTP
RTP (Real-time Transport Protocol)
- Purpose: Audio/video delivery over IP
- RFC: 3550
- Features: Synchronization, sequencing, timestamping
- Ports: Typically 10000-20000 (UDP)
RTCP (Real-time Transport Control Protocol)
- Purpose: QoS monitoring and feedback
- RFC: 3550
- Features: Packet loss, jitter, round-trip time reporting
- Ports: RTP port + 1 (UDP)
SRTP (Secure Real-time Transport Protocol)
- Purpose: Encrypted media transmission
- RFC: 3711
- Features: AES encryption, HMAC-SHA1 authentication, replay protection
- Usage: Combined with SIP over TLS for end-to-end security
ZRTP (Zimmermann Real-time Transport Protocol)
- Purpose: End-to-end encryption without PKI
- RFC: 6189
- Features: Diffie-Hellman key exchange, Short Authentication Strings (SAS)
- Advantage: Works independently of signaling protocol
Pentesting Considerations:
- Capture and analyze RTP streams for eavesdropping
- Test for weak encryption implementation
- Verify SRTP key exchange mechanisms
- Check for RTCP information disclosure
- Examine ZRTP SAS verification
Protocol Analysis Workflow
Step 1: Identify Active Protocols
Port Scanning: Check common VoIP ports
nmap -p 5060,5061,2427,2000,1720,4569,10000-20000 <target>
Service Detection: Identify running services
nmap -sV -p 5060,5061 <target>
Traffic Analysis: Use Wireshark/tcpdump to identify protocols
tcpdump -i <interface> -s 0 -w voip.pcap port 5060 or port 4569
Step 2: Enumerate Services
- SIP: Send OPTIONS request to enumerate endpoints
- MGCP: Query Call Agent for gateway information
- SCCP: Analyze Cisco phone registration patterns
- H.323: Query gatekeeper for terminal information
- IAX: Check Asterisk peer configurations
Step 3: Test Security Controls
- Authentication: Test credential validation
- Encryption: Verify TLS/SRTP implementation
- Authorization: Check access control mechanisms
- Integrity: Test message tampering detection
Step 4: Document Findings
- Protocol versions and configurations
- Encryption status and implementation
- Authentication mechanisms
- Identified vulnerabilities
- Risk assessment
Common Tools
| Tool |
Purpose |
Protocols |
| Wireshark |
Packet capture/analysis |
All |
| SIPVicious |
SIP testing |
SIP |
| Responder |
LLMNR/NBT-NS spoofing |
Network |
| tcpdump |
Packet capture |
All |
| Asterisk CLI |
Asterisk management |
IAX, SIP |
| VoIPcrack |
SIP password cracking |
SIP |
Security Best Practices
- Encryption: Use TLS for signaling (SIPS) and SRTP for media
- Authentication: Strong credentials, certificate-based where possible
- Network Segmentation: Isolate VoIP traffic from general network
- Firewall Rules: Restrict VoIP ports to necessary sources
- Monitoring: Log and monitor VoIP traffic for anomalies
- Updates: Keep PBX and endpoint firmware current
- VLANs: Separate voice and data traffic
- QoS: Prioritize voice traffic appropriately
References
- RFC 3261: SIP Specification
- RFC 3435: MGCP Specification
- RFC 4566: SDP Specification
- RFC 3550: RTP/RTCP Specification
- RFC 3711: SRTP Specification
- RFC 6189: ZRTP Specification
1---2name: voip-protocols-reference3description: Reference guide for VoIP protocols in pentesting. Use this skill when analyzing VoIP infrastructure, identifying protocols in network traffic, or understanding VoIP attack surfaces. Covers SIP, MGCP, SCCP, H.323, IAX, SDP, RTP, RTCP, SRTP, and ZRTP. Make sure to use this skill whenever the user mentions VoIP, SIP, phone systems, PBX, Asterisk, Cisco Unified Communications, or any voice-over-IP related pentesting or analysis.4---56# VoIP Protocols Reference for Pentesting78This skill provides comprehensive reference information about VoIP protocols commonly encountered during network security assessments and penetration testing.910## Quick Protocol Identification1112| Protocol | Port(s) | Type | Primary Use |13|----------|---------|------|-------------|14| SIP | 5060/5061 (TCP/UDP/TLS) | Signaling | Call setup/teardown |15| MGCP | 2427 (UDP) | Signaling | Gateway control |16| SCCP | 2000 (TCP) | Signaling | Cisco IP phones |17| H.323 | 1720 (TCP) | Signaling | Video/audio conferencing |18| IAX | 4569 (UDP) | Signaling | Asterisk trunking |19| RTP | 10000-20000 (UDP) | Media | Audio/video transport |20| RTCP | +1 from RTP (UDP) | Control | Quality monitoring |21| SDP | N/A (embedded) | Description | Session negotiation |2223## Signaling Protocols2425### SIP (Session Initiation Protocol)2627**Overview**: Industry standard for VoIP call signaling. Text-based protocol using methods like INVITE, ACK, BYE, REGISTER.2829**Key Characteristics**:30- Uses ports 5060 (UDP/TCP) and 5061 (TLS)31- Text-based (human-readable)32- Decentralized architecture33- Widely supported across vendors3435**Pentesting Considerations**:36- Check for authentication bypass vulnerabilities37- Test for SIP flooding attacks38- Verify TLS encryption on port 506139- Look for registration hijacking opportunities40- Examine INVITE message handling4142**Common Attack Vectors**:43- SIP INVITE flooding (DoS)44- Registration hijacking45- Call interception46- Eavesdropping on unencrypted traffic47- Malicious REGISTER requests4849### MGCP (Media Gateway Control Protocol)5051**Overview**: Centralized call control protocol (RFC 3435) for managing media gateways.5253**Architecture**:541. **Call Agent/MGC**: Master controller managing call setup, modification, termination552. **Media Gateways (MGs)**: Convert media between circuit-switched and packet-switched networks563. **Signaling Gateways (SGs)**: Convert signaling between SS7 and IP networks5758**Key Characteristics**:59- Uses port 2427 (UDP)60- Centralized control model61- Text-based protocol62- Common in carrier networks6364**Pentesting Considerations**:65- Target the Call Agent (single point of control)66- Test gateway command injection67- Verify authentication between MGC and gateways68- Check for unauthorized gateway registration6970### SCCP (Skinny Client Control Protocol)7172**Overview**: Cisco proprietary protocol for IP phone communication with CallManager.7374**Architecture**:751. **Call Control Server**: Cisco Unified Communications Manager762. **SCCP Endpoints**: Cisco IP phones, video endpoints773. **Gateways**: Media conversion devices7879**Key Characteristics**:80- Uses port 2000 (TCP)81- Binary protocol (not human-readable)82- Lightweight, minimal bandwidth83- Cisco-only ecosystem8485**Pentesting Considerations**:86- Requires Cisco environment knowledge87- Binary protocol needs specialized tools88- Focus on CallManager vulnerabilities89- Check for rogue device registration90- Examine SCCP message integrity9192### H.3239394**Overview**: ITU-T protocol suite for multimedia communication over packet networks.9596**Components**:971. **Terminals**: IP phones, video conferencing systems982. **Gateways**: Network conversion devices993. **Gatekeepers**: Optional call control and management1004. **MCUs**: Multipoint conference management101102**Key Characteristics**:103- Uses port 1720 (TCP) for call signaling104- Complex protocol suite105- Legacy systems still in use106- Supports audio/video codecs107108**Pentesting Considerations**:109- Target gatekeeper services110- Test H.225/H.245 message handling111- Check for buffer overflow vulnerabilities112- Verify encryption implementation113- Examine MCU configuration114115### IAX (Inter-Asterisk eXchange)116117**Overview**: Binary protocol for Asterisk PBX communication.118119**Key Features**:120- Single UDP port 4569 for signaling and media121- Binary protocol (efficient)122- Built-in trunking support123- Native encryption (RSA/AES)124- Peer-to-peer capable125126**Pentesting Considerations**:127- Focus on Asterisk-specific vulnerabilities128- Test IAX2 authentication mechanisms129- Verify encryption implementation130- Check for trunking abuse131- Examine peer-to-peer routing132133## Transmission & Transport Protocols134135### SDP (Session Description Protocol)136137**Overview**: Text format (RFC 4566) for describing multimedia sessions.138139**Key Elements**:140- Session information (name, timing)141- Media stream characteristics142- Connection information (IP, port)143- Attributes (encryption, bandwidth)144145**Usage Pattern**:1461. Initiator creates SDP description1472. SDP sent via signaling protocol (SIP, RTSP)1483. Receiver processes and responds1494. Negotiation completes150151**Pentesting Considerations**:152- Analyze SDP for information disclosure153- Check for IP address leakage154- Verify codec negotiation security155- Examine encryption attribute handling156157### RTP / RTCP / SRTP / ZRTP158159#### RTP (Real-time Transport Protocol)160- **Purpose**: Audio/video delivery over IP161- **RFC**: 3550162- **Features**: Synchronization, sequencing, timestamping163- **Ports**: Typically 10000-20000 (UDP)164165#### RTCP (Real-time Transport Control Protocol)166- **Purpose**: QoS monitoring and feedback167- **RFC**: 3550168- **Features**: Packet loss, jitter, round-trip time reporting169- **Ports**: RTP port + 1 (UDP)170171#### SRTP (Secure Real-time Transport Protocol)172- **Purpose**: Encrypted media transmission173- **RFC**: 3711174- **Features**: AES encryption, HMAC-SHA1 authentication, replay protection175- **Usage**: Combined with SIP over TLS for end-to-end security176177#### ZRTP (Zimmermann Real-time Transport Protocol)178- **Purpose**: End-to-end encryption without PKI179- **RFC**: 6189180- **Features**: Diffie-Hellman key exchange, Short Authentication Strings (SAS)181- **Advantage**: Works independently of signaling protocol182183**Pentesting Considerations**:184- Capture and analyze RTP streams for eavesdropping185- Test for weak encryption implementation186- Verify SRTP key exchange mechanisms187- Check for RTCP information disclosure188- Examine ZRTP SAS verification189190## Protocol Analysis Workflow191192### Step 1: Identify Active Protocols1931941. **Port Scanning**: Check common VoIP ports195 ```196 nmap -p 5060,5061,2427,2000,1720,4569,10000-20000 <target>197 ```1981992. **Service Detection**: Identify running services200 ```201 nmap -sV -p 5060,5061 <target>202 ```2032043. **Traffic Analysis**: Use Wireshark/tcpdump to identify protocols205 ```206 tcpdump -i <interface> -s 0 -w voip.pcap port 5060 or port 4569207 ```208209### Step 2: Enumerate Services210211- **SIP**: Send OPTIONS request to enumerate endpoints212- **MGCP**: Query Call Agent for gateway information213- **SCCP**: Analyze Cisco phone registration patterns214- **H.323**: Query gatekeeper for terminal information215- **IAX**: Check Asterisk peer configurations216217### Step 3: Test Security Controls2182191. **Authentication**: Test credential validation2202. **Encryption**: Verify TLS/SRTP implementation2213. **Authorization**: Check access control mechanisms2224. **Integrity**: Test message tampering detection223224### Step 4: Document Findings225226- Protocol versions and configurations227- Encryption status and implementation228- Authentication mechanisms229- Identified vulnerabilities230- Risk assessment231232## Common Tools233234| Tool | Purpose | Protocols |235|------|---------|----------|236| Wireshark | Packet capture/analysis | All |237| SIPVicious | SIP testing | SIP |238| Responder | LLMNR/NBT-NS spoofing | Network |239| tcpdump | Packet capture | All |240| Asterisk CLI | Asterisk management | IAX, SIP |241| VoIPcrack | SIP password cracking | SIP |242243## Security Best Practices2442451. **Encryption**: Use TLS for signaling (SIPS) and SRTP for media2462. **Authentication**: Strong credentials, certificate-based where possible2473. **Network Segmentation**: Isolate VoIP traffic from general network2484. **Firewall Rules**: Restrict VoIP ports to necessary sources2495. **Monitoring**: Log and monitor VoIP traffic for anomalies2506. **Updates**: Keep PBX and endpoint firmware current2517. **VLANs**: Separate voice and data traffic2528. **QoS**: Prioritize voice traffic appropriately253254## References255256- RFC 3261: SIP Specification257- RFC 3435: MGCP Specification258- RFC 4566: SDP Specification259- RFC 3550: RTP/RTCP Specification260- RFC 3711: SRTP Specification261- RFC 6189: ZRTP Specification