mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 08:14:24 +03:00
Implementing switch --no-logging (#4484)
This commit is contained in:
parent
582bb2fec9
commit
e2f48a9346
|
@ -79,18 +79,19 @@ class Dump(object):
|
|||
elif console:
|
||||
dataToStdout(text)
|
||||
|
||||
multiThreadMode = kb.multiThreadMode
|
||||
if multiThreadMode:
|
||||
self._lock.acquire()
|
||||
if self._outputFP:
|
||||
multiThreadMode = kb.multiThreadMode
|
||||
if multiThreadMode:
|
||||
self._lock.acquire()
|
||||
|
||||
try:
|
||||
self._outputFP.write(text)
|
||||
except IOError as ex:
|
||||
errMsg = "error occurred while writing to log file ('%s')" % getSafeExString(ex)
|
||||
raise SqlmapGenericException(errMsg)
|
||||
try:
|
||||
self._outputFP.write(text)
|
||||
except IOError as ex:
|
||||
errMsg = "error occurred while writing to log file ('%s')" % getSafeExString(ex)
|
||||
raise SqlmapGenericException(errMsg)
|
||||
|
||||
if multiThreadMode:
|
||||
self._lock.release()
|
||||
if multiThreadMode:
|
||||
self._lock.release()
|
||||
|
||||
kb.dataOutputFlag = True
|
||||
|
||||
|
@ -102,6 +103,10 @@ class Dump(object):
|
|||
pass
|
||||
|
||||
def setOutputFile(self):
|
||||
if conf.noLogging:
|
||||
self._outputFP = None
|
||||
return
|
||||
|
||||
self._outputFile = os.path.join(conf.outputPath, "log")
|
||||
try:
|
||||
self._outputFP = openFile(self._outputFile, "ab" if not conf.flushSession else "wb")
|
||||
|
|
|
@ -243,6 +243,7 @@ optDict = {
|
|||
"dependencies": "boolean",
|
||||
"disableColoring": "boolean",
|
||||
"listTampers": "boolean",
|
||||
"noLogging": "boolean",
|
||||
"offline": "boolean",
|
||||
"purge": "boolean",
|
||||
"resultsFile": "string",
|
||||
|
|
|
@ -20,7 +20,7 @@ from thirdparty import six
|
|||
from thirdparty.six import unichr as _unichr
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.6.3.18"
|
||||
VERSION = "1.6.3.19"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
@ -745,6 +745,9 @@ def cmdLineParser(argv=None):
|
|||
miscellaneous.add_argument("--list-tampers", dest="listTampers", action="store_true",
|
||||
help="Display list of available tamper scripts")
|
||||
|
||||
miscellaneous.add_argument("--no-logging", dest="noLogging", action="store_true",
|
||||
help="Disable logging to a file")
|
||||
|
||||
miscellaneous.add_argument("--offline", dest="offline", action="store_true",
|
||||
help="Work in offline mode (only use session data)")
|
||||
|
||||
|
|
|
@ -833,10 +833,14 @@ dependencies = False
|
|||
# Valid: True or False
|
||||
disableColoring = False
|
||||
|
||||
# Display list of available tamper scripts
|
||||
# Display list of available tamper scripts.
|
||||
# Valid: True or False
|
||||
listTampers = False
|
||||
|
||||
# Disable logging to a file.
|
||||
# Valid: True or False
|
||||
noLogging = False
|
||||
|
||||
# Work in offline mode (only use session data)
|
||||
# Valid: True or False
|
||||
offline = False
|
||||
|
|
Loading…
Reference in New Issue
Block a user