Sense of Security VoIP Security Testing Training (PDFDrive)
Sense of Security VoIP Security Testing Training (PDFDrive)
Fatih Ozavci
Christos Archimandritis
8 August 2015
Sydney Melbourne
Level 8, 66 King Street Level 10, 401 Docklands Drv T: 1300 922 923 [email protected]
Sydney NSW 2000 Docklands VIC 3008 T: +61 (0) 2 9290 4444 www.senseofsecurity.com.au
Australia Australia F: +61 (0) 2 9290 4455 ABN: 14 098 237 908
• Network Infrastructure
• VoIP Server Security
• Signalling Security
• Media Transport Security
• Cloud VoIP Solutions Security
• VoIP Client Security
General assumptions:
• The VoIP Networks are isolated
• Hacking VoIP requires detailed knowledge
• Attacks target only privacy and toll fraud
• Pretending VoIP services are configured well
Real life:
• Broken physical security, weak network auth
• After Viproy, no knowledge required anymore
• How about client attacks, intelligence and APT
• Default passwords, obsolete systems…
Plan
• Identifying the network design issues
• Unauthorised access to the Voice LAN/WAN
• Attacking network services
• Persistent access
Goals
• Persistent unauthorised network access
• Mass compromise of clients and services
• Eavesdropping
www.senseofsecurity.com.au © Sense of Security 2015 Page 16 – 8 August 2015
A Recipe for Network Attacks
• Client Types
• Soft phones (IP Communicator, Android/iOS Apps)
• IP phones and handsets (Cisco 7945, Yealink)
• Video conference equipment (Cisco Presence)
• External meeting services (Webex, GoMeeting)
• Service Purpose
• International/National landline/Cell endpoints
• Call centre (commercial vs Open Source)
• Commercial VoIP services (mobile, hosted)
• Internal usage (VLAN, conference rooms)
• VoIP protocols (Skinny, SIP, RTP, IAX, H.323)
• Attack Types
• PC Ports of the IP phone and handsets
• CDP sniffing/spoofing for Voice VLAN
• DTP and VLAN Trunking Protocol attacks
• ARP spoofing for MITM attacks
• HSRP spoofing for MITM attacks
• DHCP spoofing & snooping
• Persistent access
• Tapberry Pi (a.k.a berry-tap)
• Tampered phone + PoE
• 3G/4G for connectivity
www.senseofsecurity.com.au © Sense of Security 2015 Page 22 – 8 August 2015
Getting Access Using PC Port
• Authentication of IP Phones
• 802.1x - using Hub to bypass
• EAP-MD5 dictionary attack
Speaker Power
• ARP Scan
• ARP Spoofing
• MITM Attack
• Hijacking
• SSL
• SSH keys
• Rogue service
• Tools
• Cain & Abel
• Ettercap
• Dsniff
• ARP Scanning
• Find MAC and IPs to guess names of configuration
files stored on TFTP/HTTP servers
• SIP/Skinny authentication with MAC address
• ARP Spoofing and being the …
• TFTP server (configuration, updates, SSH keys)
• DNS server
• Web server (management, IP phone services)
• SIP/Skinny server/Proxy
• RTP proxy
• MAC based filtering and authentication
www.senseofsecurity.com.au © Sense of Security 2015 Page 32 – 8 August 2015
DHCP Spoofing
• DHCP Sniffing
• Finding IP range
• Finding TFTP/HTTP
• Finding DNS
• DHCP Spoofing
• Suspend the DHCP server
• DHCP consumption (request all IP addresses)
• Become a Rogue DHCP Server
• Send spoofed DHCP responses to the IP phones
• Custom TFTP and DNS server
www.senseofsecurity.com.au © Sense of Security 2015 Page 33 – 8 August 2015
Attacking the TFTP Server
<deviceProtocol>SCCP</deviceProtocol>
<sshUserId>USER</sshUserId>
<sshPassword>PASSWORD</sshPassword>
<webAccess>1</webAccess>
<settingsAccess>1</settingsAccess>
<sideToneLevel>0</sideToneLevel>
<spanToPCPort>1</spanToPCPort>
<sshAccess>1</sshAccess>
<phonePassword>1234</phonePassword>
reg.1.address="3047"
reg.1.label="3047“
reg.1.auth.userId="7d5b905ecc1b1efa7077868
70276a940"
reg.1.auth.password="d9429ad54c3ee623f6e2
0ae39de758ee“
divert.fwd.1.enabled="0"
• SNMP protocol
• UDP protocol, IP spoofing, no encryption
• Authentication
• Community name (public, private, cisco)
• SNMPv3 username/password attacks
• SNMP Software
• SNMP management software vulnerabilities
• Buffer overflows, memory corruptions
• Practical Attacks
• Device configuration download and upload
• Information gathering, code execution
Plan
• Discover the VoIP servers and devices
• Identify insecure software and management
• Exploit the identified vulnerabilities
Goals
• Persistent unauthorised server access
• Mass compromise of clients and services
• Persistent call and toll fraud attacks
• Voice recordings, CDR, VAS services
www.senseofsecurity.com.au © Sense of Security 2015 Page 43 – 8 August 2015
Discovering VoIP Servers
• Looking for
• Signalling servers (e.g. SIP, Skinny, H.323, H.248)
• Proxy servers (e.g. RTP, SIP, SDP)
• Contact Centre services
• Voicemail and email integration
• Call recordings, call data records, log servers
• Discovering
• Operating systems, versions and patch level
• Management services (e.g. SNMP, RDP, Telnet,
HTTP, SSH)
• Weak or default credentials
www.senseofsecurity.com.au © Sense of Security 2015 Page 44 – 8 August 2015
Discovering VoIP Servers
• NMAP
• Port scanning, service identification
• # nmap –sS –sV –A –p1-65535 192.168.1.1/24
• Metasploit Framework
• Viproy modules to discover VoIP services
• UDP, ARP, SNMP, SSH, telnet discovery modules
• Brute-force and enumeration modules
• Commercial & Open Source Vulnerability
Scanners
• Nessus, Qualys, Nexpose, OpenVAS
CVE-2014-6271
env X='() { :; }; echo "CVE-2014-6271 vulnerable"' bash -c id
CVE-2014-7169
env X='() { (a)=>\' bash -c "echo date"; cat echo
CVE-2014-7186
bash -c 'true <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF
<<EOF <<EOF <<EOF <<EOF <<EOF' || echo "CVE-2014-7186 vulnerable,
redir_stack“
CVE-2014-7187
(for x in {1..200} ; do echo "for x$x in ; do :"; done; for x in {1..200} ; do
echo done ; done) | bash || echo "CVE-2014-7187 vulnerable,
word_lineno“
CVE-2014-6278
env X='() { _; } >_[$($())] { echo CVE-2014-6278 vulnerable; id; }' bash -c :
CVE-2014-6277
env X='() { x() { _; }; x() { _; } <<a; }' bash -c :
CVE-2014-0160
www.senseofsecurity.com.au © Sense of Security 2015 Page 52 – 8 August 2015
Major Vulnerabilities: Heartbleed
Plan
• Discovering signalling services
• Authentication and authorisation analysis
• Bypass tests for call restrictions and billing
• Server load analysis
Goals
• Call and toll fraud
• Compromising the billing system
• Blackmail using TDoS and DoS
www.senseofsecurity.com.au © Sense of Security 2015 Page 61 – 8 August 2015
SIP Signalling
1- REGISTER
1- 200 OK
SIP Server
2- INVITE
RTP
3- 200 OK
Phone B
• Essential analysis
• Registration and invitation analysis
• User enumeration, brute force for credentials
• Discovery for SIP trunks, gateways and trusts
• Caller ID spoofing (w/wo register or trunk)
• Advanced analysis
• Finding value added services and voicemail
• SIP trust hacking
• SIP proxy bounce attack
• Unauthenticated Registration
• Special trunks
• Special VAS numbers
• Gateways
• Enumeration
• Extensions, Users, Realms, MAC addresses
• De-Registration for Valid Users
• Brute-Forcing Valid Accounts and Passwords
• With well-known user list
• Numeric user ranges
v=0
o=Cisco-SIPUA 158056866 158056866 IN IP4 192.168.0.11
s=Source
t=0 0
m=audio 16392 RTP/AVP 0 8 18 102 9 116 101
c=IN IP4 192.168.0.11
a=rtpmap:3 GSM/8000a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:102 L16/16000
a=rtpmap:9 G722/8000
a=rtpmap:116 iLBC/8000
a=fmtp:116 mode=20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
* https://tools.cisco.com/bugsearch/bug/CSCuo51517
Remote-Party-ID header
Remote-Party-ID: <sip:[email protected]>;party=called;screen=yes;privacy=off
• Caller ID spoofing
• Billing bypass
• Accessing voicemail
• 3rd party operators
• Business Impact
• SIP trust relationship hacking
• Attacking inaccessible servers
• Attacking the SIP software and protocol
• Software, Version, Type, Realm
192.168.1.145 - Sydney
Production SIP Service
192.168.1.146 192.168.1.202
Melbourne Brisbane
192.168.1.145 - Sydney
Production SIP Service IP spoofed UDP SIP request
192.168.1.146
Melbourne
192.168.1.202
Brisbane
Steps:
• Finding Trusted SIP Networks (Mostly B Class)
• Sending IP Spoofed Requests from Each IP:Port
• Each Call Should Contain IP:Port in "From" Section
• If We Have a Call, We Have The Trusted SIP Gateway
IP and Port
v=0
o=root 1716603896 1716603896 IN IP4 10.1.1.1
s=Test Source
c=IN IP4 10.1.1.1
t=0 0
m=audio 10024 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrec
192.168.1.145 - Sydney
Production SIP Service
UDP Trust
192.168.1.146 192.168.1.202
Melbourne Brisbane
Universal
Trust
192.168.1.145 - Sydney
Production SIP Service
UDP Trust
192.168.1.146 192.168.1.202
Melbourne Brisbane
It’s a TRAP!
Universal
Trust
• Denial of Service
• Calling all numbers at same time
• Overloading SIP server's call limits
• Overloading VAS service or international limits
• Overloading CDR records with spoofed calls
• Short Message Service and Billing Attacks
• Attacking Server Software
• Crashing/exploiting inaccessible features
• Call redirection (working on it, not yet :/)
• Attacking a Client?
• Basic attacks
• Register as a phone
• Disconnect other phones
• Call forwarding
• Unauthorised calls Source: Cisco
Plan
• Performing the MITM attacks
• Obtaining unauthorised access to the media
transport
• Decoding the RTP stream to extract the raw
audio/video of the conversation
Goals
• Eavesdropping
• Injection audio or video to the conversations
www.senseofsecurity.com.au © Sense of Security 2015 Page 117 – 8 August 2015
Media Transport Flow
1- REGISTER
1- 200 OK
SIP Server
2- INVITE
RTP
3- 200 OK
Plan
• Discovering the cloud services as tenant
• Attacking to the dedicated tenant services
• Attacking to the shared services for tenants
• Jailbreaking the cloud tenant isolation
Goals
• Call and toll fraud
• Compromising all tenants in the cloud
• Eavesdropping
www.senseofsecurity.com.au © Sense of Security 2015 Page 131 – 8 August 2015
Discovery for hosted VoIP networks
Weaknesses
• Cross-site scripting vulnerabilities
Weaknesses
• User enumeration
• Privilege escalation vulnerabilities
• Cross-site scripting vulnerabilities
• SQL injections and SOAP manipulations
www.senseofsecurity.com.au © Sense of Security 2015 Page 136 – 8 August 2015
Errors, Information Leakage
• /emapp/EMAppServlet?device=USER
• /bvsm/iptusermgt/disassociateuser.cgi
• /bvsm/iptbulkadmin
• /bvsm/iptbulkloadmgt/bulkloaduploadform.cgi
/bvsm/iptnumtransmgt/editnumbertranslationform.cgi?id=1
http://1.2.3.4/bvsmweb/SRV.cgi?device=ID&cfoption=ACT
Services Actions
• speeddials • CallForwardAll
• changepinform • CallForwardBusy
• showcallfwd
• callfwdmenu
www.senseofsecurity.com.au © Sense of Security 2015 Page 140 – 8 August 2015
IP Phone management
• Viproy Modules
• Call Forwarding
• Speed Dial
viproy.com 142
www.senseofsecurity.com.au © Sense of Security 2015 Page 142 – 8 August 2015
Solutions
Plan
• Analysing the VoIP clients which use the
commercial services
• Finding the published and unpublished bugs
on the clients
• Trying to exploit those bugs from remote
Goals
• Mass compromise of clients
• Injecting a persistent backdoor to the clients
www.senseofsecurity.com.au © Sense of Security 2015 Page 146 – 8 August 2015
Attacking a client using SIP service
192.168.1.145 - Sydney
Production SIP Service
UDP Trust
192.168.1.146 192.168.1.202
Melbourne Brisbane
Universal
Trust Crash!