mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-26 03:23:48 +03:00
Unbiased approach for searching appropriate usable column
This commit is contained in:
parent
f958b21613
commit
66adf23532
|
@ -7,6 +7,7 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -98,10 +99,15 @@ def __unionPosition(comment, place, parameter, value, prefix, suffix, count, whe
|
||||||
validPayload = None
|
validPayload = None
|
||||||
vector = None
|
vector = None
|
||||||
|
|
||||||
|
positions = range(0, count)
|
||||||
|
|
||||||
|
# Unbiased approach for searching appropriate usable column
|
||||||
|
random.shuffle(positions)
|
||||||
|
|
||||||
# For each column of the table (# of NULL) perform a request using
|
# For each column of the table (# of NULL) perform a request using
|
||||||
# the UNION ALL SELECT statement to test it the target url is
|
# the UNION ALL SELECT statement to test it the target url is
|
||||||
# affected by an exploitable inband SQL injection vulnerability
|
# affected by an exploitable inband SQL injection vulnerability
|
||||||
for position in range(count-1, 0, -1):
|
for position in positions:
|
||||||
# Prepare expression with delimiters
|
# Prepare expression with delimiters
|
||||||
randQuery = randomStr()
|
randQuery = randomStr()
|
||||||
phrase = "%s%s%s" % (kb.misc.start, randQuery, kb.misc.stop)
|
phrase = "%s%s%s" % (kb.misc.start, randQuery, kb.misc.stop)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user