Skip to content

Commit 1e7c86c

Browse files
committed
fix prometheus ppof check
1 parent 78984e4 commit 1e7c86c

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

modules/auxiliary/gather/prometheus_api_gather.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ def run
153153
'method' => 'GET'
154154
)
155155
fail_with(Failure::Unreachable, "#{peer} - Could not connect to web service - no response") if res.nil?
156-
fail_with(Failure::UnexpectedReply, "#{peer} - Unexpected response from server (response code #{res.code})") unless res.code == 200
157-
158-
print_good("#{peer}#{target_uri.path}debug/pprof/ found, potential DoS and information disclosure. Should be manually reviewed.") if res.body.include?('Profile Descriptions')
156+
print_good("#{peer}#{target_uri.path}debug/pprof/ found, potential DoS and information disclosure. Should be manually reviewed.") if res.code == 200 && res.body.include?('Profile Descriptions')
159157
rescue ::Rex::ConnectionError
160158
fail_with(Failure::Unreachable, "#{peer} - Could not connect to the web service")
161159
end

modules/auxiliary/gather/prometheus_node_exporter_gather.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ def run
316316
'method' => 'GET'
317317
)
318318
fail_with(Failure::Unreachable, "#{peer} - Could not connect to web service - no response") if res.nil?
319-
fail_with(Failure::UnexpectedReply, "#{peer} - Unexpected response from server (response code #{res.code})") unless res.code == 200
320-
321-
print_good("#{peer}#{target_uri.path}debug/pprof/ found, potential DoS and information disclosure. Should be manually reviewed.") if res.body.include?('Profile Descriptions')
319+
print_good("#{peer}#{target_uri.path}debug/pprof/ found, potential DoS and information disclosure. Should be manually reviewed.") if res.code == 200 && res.body.include?('Profile Descriptions')
322320
rescue ::Rex::ConnectionError
323321
fail_with(Failure::Unreachable, "#{peer} - Could not connect to the web service")
324322
end

0 commit comments

Comments
 (0)