Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 938d9ff

Browse files
committed
doing all the work for the users so they wouldn't strain their little hands
1 parent 524dd75 commit 938d9ff

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

lib/techniques/union/test.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from lib.core.common import pushValue
2020
from lib.core.common import randomInt
2121
from lib.core.common import randomStr
22+
from lib.core.common import readInput
2223
from lib.core.common import removeReflectiveValues
2324
from lib.core.common import singleTimeLogMessage
2425
from lib.core.common import singleTimeWarnMessage
@@ -254,16 +255,26 @@ def __unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix
254255
if not all([validPayload, vector]) and not all([conf.uChar, conf.dbms]):
255256
warnMsg = "if UNION based SQL injection is not detected, "
256257
warnMsg += "please consider "
258+
257259
if not conf.uChar:
258-
warnMsg += "usage of option '--union-char' "
259-
warnMsg += "(e.g. --union-char=1) "
260+
message = "injection not exploitable with NULL values. Do you want to try with a random integer value for '--union-char'? [Y/n] "
261+
test = readInput(message, default="Y")
262+
if test[0] not in ("y", "Y"):
263+
warnMsg += "usage of option '--union-char' "
264+
warnMsg += "(e.g. --union-char=1) "
265+
else:
266+
conf.uChar = str(randomInt(2))
267+
validPayload, vector = __unionConfirm(comment, place, parameter, prefix, suffix, count)
268+
260269
if not conf.dbms:
261270
if not conf.uChar:
262271
warnMsg += "and/or try to force the "
263272
else:
264273
warnMsg += "forcing the "
265274
warnMsg += "back-end DBMS (e.g. --dbms=mysql) "
266-
singleTimeWarnMessage(warnMsg)
275+
276+
if not all([validPayload, vector]):
277+
singleTimeWarnMessage(warnMsg)
267278

268279
return validPayload, vector
269280

0 commit comments

Comments
 (0)