mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
minor improvements
This commit is contained in:
parent
4c13e0e5a1
commit
df3cc38cd9
|
@ -169,14 +169,16 @@ def liveTest():
|
||||||
msg = "running live test case: %s (%d/%d)" % (name, count, length)
|
msg = "running live test case: %s (%d/%d)" % (name, count, length)
|
||||||
logger.info(msg)
|
logger.info(msg)
|
||||||
|
|
||||||
try:
|
initCase(switches)
|
||||||
result = runCase(switches, parse)
|
|
||||||
except SqlmapNotVulnerableException:
|
|
||||||
vulnerable = False
|
|
||||||
|
|
||||||
test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING)
|
test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING)
|
||||||
test_case_fd.write("%s\n" % name)
|
test_case_fd.write("%s\n" % name)
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = runCase(parse)
|
||||||
|
except SqlmapNotVulnerableException:
|
||||||
|
vulnerable = False
|
||||||
|
|
||||||
if result is True:
|
if result is True:
|
||||||
logger.info("test passed")
|
logger.info("test passed")
|
||||||
cleanCase()
|
cleanCase()
|
||||||
|
@ -250,13 +252,11 @@ def initCase(switches=None):
|
||||||
def cleanCase():
|
def cleanCase():
|
||||||
shutil.rmtree(paths.SQLMAP_OUTPUT_PATH, True)
|
shutil.rmtree(paths.SQLMAP_OUTPUT_PATH, True)
|
||||||
|
|
||||||
def runCase(switches=None, parse=None):
|
def runCase(parse):
|
||||||
global failedItem
|
global failedItem
|
||||||
global failedParseOn
|
global failedParseOn
|
||||||
global failedTraceBack
|
global failedTraceBack
|
||||||
|
|
||||||
initCase(switches)
|
|
||||||
|
|
||||||
LOGGER_HANDLER.stream = sys.stdout = tempfile.SpooledTemporaryFile(max_size=0, mode="w+b", prefix="sqlmapstdout-")
|
LOGGER_HANDLER.stream = sys.stdout = tempfile.SpooledTemporaryFile(max_size=0, mode="w+b", prefix="sqlmapstdout-")
|
||||||
retVal = True
|
retVal = True
|
||||||
handled_exception = None
|
handled_exception = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user