mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Implementation for an Issue #128
This commit is contained in:
parent
098e446ca4
commit
ebc7088f94
|
@ -218,3 +218,8 @@ class PAYLOAD:
|
|||
ORIGINAL = 1
|
||||
NEGATIVE = 2
|
||||
REPLACE = 3
|
||||
|
||||
class WIZARD:
|
||||
BASIC = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba")
|
||||
SMART = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getUsers", "getDbs", "getTables", "getSchema", "excludeSysDbs")
|
||||
ALL = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getHostname", "getUsers", "getPasswordHashes", "getPrivileges", "getRoles", "dumpAll")
|
||||
|
|
|
@ -67,6 +67,7 @@ from lib.core.enums import PAYLOAD
|
|||
from lib.core.enums import PRIORITY
|
||||
from lib.core.enums import PROXYTYPE
|
||||
from lib.core.enums import REFLECTIVE_COUNTER
|
||||
from lib.core.enums import WIZARD
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import sqlmapFilePathException
|
||||
from lib.core.exception import sqlmapGenericException
|
||||
|
@ -1382,6 +1383,9 @@ def __cleanupOptions():
|
|||
if conf.string:
|
||||
conf.string = conf.string.decode("unicode_escape")
|
||||
|
||||
if conf.getAll:
|
||||
map(lambda x: conf.__setitem__(x, True), WIZARD.ALL)
|
||||
|
||||
threadData = getCurrentThreadData()
|
||||
threadData.reset()
|
||||
|
||||
|
@ -1613,19 +1617,20 @@ def __useWizardInterface():
|
|||
conf.risk = 1
|
||||
conf.level = 1
|
||||
|
||||
choice = None
|
||||
if not conf.getAll:
|
||||
choice = None
|
||||
|
||||
while choice is None or choice not in ("", "1", "2", "3"):
|
||||
message = "Enumeration (--banner/--current-user/etc). Please choose:\n"
|
||||
message += "[1] Basic (default)\n[2] Smart\n[3] All"
|
||||
choice = readInput(message, default='1')
|
||||
while choice is None or choice not in ("", "1", "2", "3"):
|
||||
message = "Enumeration (--banner/--current-user/etc). Please choose:\n"
|
||||
message += "[1] Basic (default)\n[2] Smart\n[3] All"
|
||||
choice = readInput(message, default='1')
|
||||
|
||||
if choice == '2':
|
||||
map(lambda x: conf.__setitem__(x, True), ['getBanner', 'getCurrentUser', 'getCurrentDb', 'isDba', 'getUsers', 'getDbs', 'getTables', 'getSchema', 'excludeSysDbs'])
|
||||
elif choice == '3':
|
||||
map(lambda x: conf.__setitem__(x, True), ['getBanner', 'getCurrentUser', 'getCurrentDb', 'isDba', 'getUsers', 'getPasswordHashes', 'getPrivileges', 'getRoles', 'dumpAll'])
|
||||
else:
|
||||
map(lambda x: conf.__setitem__(x, True), ['getBanner', 'getCurrentUser', 'getCurrentDb', 'isDba'])
|
||||
if choice == '2':
|
||||
map(lambda x: conf.__setitem__(x, True), WIZARD.SMART)
|
||||
elif choice == '3':
|
||||
map(lambda x: conf.__setitem__(x, True), WIZARD.ALL)
|
||||
else:
|
||||
map(lambda x: conf.__setitem__(x, True), WIZARD.BASIC)
|
||||
|
||||
logger.debug("muting sqlmap.. it will do the magic for you")
|
||||
conf.verbose = 0
|
||||
|
|
|
@ -96,6 +96,7 @@ optDict = {
|
|||
},
|
||||
|
||||
"Enumeration": {
|
||||
"getAll": "boolean",
|
||||
"getBanner": ("boolean", "Banners"),
|
||||
"getCurrentUser": ("boolean", "Users"),
|
||||
"getCurrentDb": ("boolean", "Databases"),
|
||||
|
|
|
@ -183,6 +183,7 @@ BASIC_HELP_ITEMS = (
|
|||
"level",
|
||||
"risk",
|
||||
"tech",
|
||||
"getAll",
|
||||
"getBanner",
|
||||
"getCurrentUser",
|
||||
"getCurrentDb",
|
||||
|
|
|
@ -302,6 +302,9 @@ def cmdLineParser():
|
|||
"and data contained in the tables. Moreover "
|
||||
"you can run your own SQL statements")
|
||||
|
||||
enumeration.add_option("-a", "--all", dest="getAll",
|
||||
action="store_true", help="Retrieve everything")
|
||||
|
||||
enumeration.add_option("-b", "--banner", dest="getBanner",
|
||||
action="store_true", help="Retrieve DBMS banner")
|
||||
|
||||
|
|
|
@ -324,6 +324,10 @@ extensiveFp = False
|
|||
# tables. Moreover you can run your own SQL statements.
|
||||
[Enumeration]
|
||||
|
||||
# Retrieve everything
|
||||
# Valid: True or False
|
||||
getAll = False
|
||||
|
||||
# Retrieve back-end database management system banner.
|
||||
# Valid: True or False
|
||||
getBanner = False
|
||||
|
|
Loading…
Reference in New Issue
Block a user