|
19 | 19 | from lib.core.common import pushValue |
20 | 20 | from lib.core.common import randomInt |
21 | 21 | from lib.core.common import randomStr |
| 22 | +from lib.core.common import readInput |
22 | 23 | from lib.core.common import removeReflectiveValues |
23 | 24 | from lib.core.common import singleTimeLogMessage |
24 | 25 | from lib.core.common import singleTimeWarnMessage |
@@ -254,16 +255,26 @@ def __unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix |
254 | 255 | if not all([validPayload, vector]) and not all([conf.uChar, conf.dbms]): |
255 | 256 | warnMsg = "if UNION based SQL injection is not detected, " |
256 | 257 | warnMsg += "please consider " |
| 258 | + |
257 | 259 | 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 | + |
260 | 269 | if not conf.dbms: |
261 | 270 | if not conf.uChar: |
262 | 271 | warnMsg += "and/or try to force the " |
263 | 272 | else: |
264 | 273 | warnMsg += "forcing the " |
265 | 274 | warnMsg += "back-end DBMS (e.g. --dbms=mysql) " |
266 | | - singleTimeWarnMessage(warnMsg) |
| 275 | + |
| 276 | + if not all([validPayload, vector]): |
| 277 | + singleTimeWarnMessage(warnMsg) |
267 | 278 |
|
268 | 279 | return validPayload, vector |
269 | 280 |
|
|
0 commit comments