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

Skip to content

Commit ad039c3

Browse files
committed
Implementation for an Issue #423
1 parent 3740a97 commit ad039c3

4 files changed

Lines changed: 13 additions & 1 deletion

File tree

lib/core/agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,10 @@ def forgeUnionQuery(self, query, position, count, comment, prefix, suffix, char,
647647
@rtype: C{str}
648648
"""
649649

650-
fromTable = fromTable or FROM_DUMMY_TABLE.get(Backend.getIdentifiedDbms(), "")
650+
if conf.uFrom:
651+
fromTable = " FROM %s" % conf.uFrom
652+
else:
653+
fromTable = fromTable or FROM_DUMMY_TABLE.get(Backend.getIdentifiedDbms(), "")
651654

652655
if query.startswith("SELECT "):
653656
query = query[len("SELECT "):]

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"timeSec": "integer",
8989
"uCols": "string",
9090
"uChar": "string",
91+
"uFrom": "string",
9192
"dnsName": "string",
9293
"secondOrder": "string",
9394
},

lib/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ def cmdLineParser():
287287
techniques.add_option("--union-char", dest="uChar",
288288
help="Character to use for bruteforcing number of columns")
289289

290+
techniques.add_option("--union-from", dest="uFrom",
291+
help="Table to use in FROM part of UNION query SQL injection")
292+
290293
techniques.add_option("--dns-domain", dest="dnsName",
291294
help="Domain name used for DNS exfiltration attack")
292295

sqlmap.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ uCols =
303303
# Example: NULL
304304
uChar =
305305

306+
# Table to use in FROM part of UNION query SQL injection
307+
# Valid: string
308+
# Example: INFORMATION_SCHEMA.COLLATIONS
309+
uFrom =
310+
306311
# Domain name used for DNS exfiltration attack
307312
# Valid: string
308313
dnsName =

0 commit comments

Comments
 (0)