mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 14:11:29 +00:00
basic live tests against 3 major DBMSes
This commit is contained in:
@@ -1349,7 +1349,7 @@ def __setVerbosity():
|
||||
elif conf.verbose >= 5:
|
||||
logger.setLevel(7)
|
||||
|
||||
def __mergeOptions(inputOptions):
|
||||
def __mergeOptions(inputOptions, overrideOptions):
|
||||
"""
|
||||
Merge command line options with configuration file options.
|
||||
|
||||
@@ -1367,7 +1367,7 @@ def __mergeOptions(inputOptions):
|
||||
|
||||
for key, value in inputOptionsItems:
|
||||
if key not in conf or (conf[key] is False and value is True) or \
|
||||
value not in (None, False):
|
||||
value not in (None, False) or overrideOptions:
|
||||
conf[key] = value
|
||||
|
||||
def __setTrafficOutputFP():
|
||||
@@ -1425,7 +1425,7 @@ def __basicOptionValidation():
|
||||
errMsg = "value for --time-sec option must be an integer greater than 0"
|
||||
raise sqlmapSyntaxException, errMsg
|
||||
|
||||
def init(inputOptions=advancedDict()):
|
||||
def init(inputOptions=advancedDict(), overrideOptions=False):
|
||||
"""
|
||||
Set attributes into both configuration and knowledge base singletons
|
||||
based upon command line and configuration file options.
|
||||
@@ -1433,7 +1433,7 @@ def init(inputOptions=advancedDict()):
|
||||
|
||||
__setConfAttributes()
|
||||
__setKnowledgeBaseAttributes()
|
||||
__mergeOptions(inputOptions)
|
||||
__mergeOptions(inputOptions, overrideOptions)
|
||||
__setVerbosity()
|
||||
__saveCmdline()
|
||||
__setRequestFromFile()
|
||||
|
||||
@@ -17,6 +17,7 @@ import tempfile
|
||||
import time
|
||||
|
||||
from lib.controller.controller import start
|
||||
from lib.core.common import beep
|
||||
from lib.core.common import clearConsoleLine
|
||||
from lib.core.common import dataToStdout
|
||||
from lib.core.common import getCompiledRegex
|
||||
@@ -74,6 +75,10 @@ def smokeTest():
|
||||
return retVal
|
||||
|
||||
def adjustValueType(tagName, value):
|
||||
# as it's not part of optDict
|
||||
if tagName == "technique":
|
||||
value = int(value)
|
||||
|
||||
for family in optDict.keys():
|
||||
for name, type_ in optDict[family].items():
|
||||
if type(type_) == tuple:
|
||||
@@ -146,6 +151,7 @@ def liveTest():
|
||||
logger.info("test passed")
|
||||
else:
|
||||
logger.error("test failed")
|
||||
beep()
|
||||
retVal &= result
|
||||
|
||||
dataToStdout("\n")
|
||||
@@ -169,7 +175,7 @@ def initCase(switches=None):
|
||||
cmdLineOptions.__dict__[key] = value
|
||||
|
||||
conf.sessionFile = None
|
||||
init(cmdLineOptions)
|
||||
init(cmdLineOptions, True)
|
||||
__setVerbosity()
|
||||
|
||||
def cleanCase():
|
||||
@@ -194,7 +200,7 @@ def runCase(switches=None, log=None, session=None):
|
||||
ifile.close()
|
||||
for item in session:
|
||||
if item.startswith("r'") and item.endswith("'"):
|
||||
if not re.search(item[2:-1], content):
|
||||
if not re.search(item[2:-1], content, re.DOTALL):
|
||||
retVal = False
|
||||
break
|
||||
elif content.find(item) < 0:
|
||||
@@ -207,7 +213,7 @@ def runCase(switches=None, log=None, session=None):
|
||||
ifile.close()
|
||||
for item in log:
|
||||
if item.startswith("r'") and item.endswith("'"):
|
||||
if not re.search(item[2:-1], content):
|
||||
if not re.search(item[2:-1], content, re.DOTALL):
|
||||
retVal = False
|
||||
break
|
||||
elif content.find(item) < 0:
|
||||
|
||||
Reference in New Issue
Block a user