Skip to content

Commit cdc8289

Browse files
committed
Fix the issue 7593 where I get a stacktrace when running module auxiliary/scanner/http/blind_sql_query
Add a guard against the case when opts['vars_get'] is nil
1 parent 66ba2b0 commit cdc8289

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/rex/proto/http/client_request.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,21 @@ def to_s
108108
qstr << set_encode_uri(Rex::Text.rand_text_alphanumeric(rand(32)+1))
109109
end
110110
end
111+
if opts.key?("vars_get") && opts['vars_get']
112+
opts['vars_get'].each_pair do |var,val|
113+
var = var.to_s
111114

112-
opts['vars_get'].each_pair do |var,val|
113-
var = var.to_s
114-
115-
qstr << '&' if qstr.length > 0
116-
qstr << (opts['encode_params'] ? set_encode_uri(var) : var)
117-
# support get parameter without value
118-
# Example: uri?parameter
119-
if val
120-
val = val.to_s
121-
qstr << '='
122-
qstr << (opts['encode_params'] ? set_encode_uri(val) : val)
115+
qstr << '&' if qstr.length > 0
116+
qstr << (opts['encode_params'] ? set_encode_uri(var) : var)
117+
# support get parameter without value
118+
# Example: uri?parameter
119+
if val
120+
val = val.to_s
121+
qstr << '='
122+
qstr << (opts['encode_params'] ? set_encode_uri(val) : val)
123+
end
123124
end
124125
end
125-
126126
if (opts['pad_post_params'])
127127
1.upto(opts['pad_post_params_count'].to_i) do |i|
128128
rand_var = Rex::Text.rand_text_alphanumeric(rand(32)+1)

0 commit comments

Comments
 (0)