Skip to content

Commit 88036a7

Browse files
committed
Check for nil before using the decoder in test_vulnerable
1 parent 5331c34 commit 88036a7

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

lib/msf/core/exploit/sqli/mssqli/common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def test_vulnerable
185185
query_string = "'#{random_string}'"
186186
query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
187187
output = run_sql("select #{query_string}")
188+
return false if output.nil?
188189
(@encoder ? @encoder[:decode].call(output) : output) == random_string
189190
end
190191

lib/msf/core/exploit/sqli/mysqli/common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def test_vulnerable
200200
query_string = "'#{random_string}'"
201201
query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
202202
output = run_sql("select #{query_string}")
203+
return false if output.nil?
203204
(@encoder ? @encoder[:decode].call(output) : output) == random_string
204205
end
205206

lib/msf/core/exploit/sqli/postgresqli/common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def test_vulnerable
192192
query_string = "'#{random_string}'"
193193
query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
194194
output = run_sql("select #{query_string}")
195+
return false if output.nil?
195196
(@encoder ? @encoder[:decode].call(output) : output) == random_string
196197
end
197198

lib/msf/core/exploit/sqli/sqlitei/common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def test_vulnerable
146146
query_string = "'#{random_string}'"
147147
query_string = @encoder[:encode].sub(/\^DATA\^/, query_string) if @encoder
148148
output = run_sql("select #{query_string}")
149+
return false if output.nil?
149150
(@encoder ? @encoder[:decode].call(output) : output) == random_string
150151
end
151152

0 commit comments

Comments
 (0)