mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-26 07:59:52 +03:00
finish change logger format(time to datetime)
This commit is contained in:
parent
bf125be101
commit
737e648862
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -5,4 +5,5 @@ __pycache__/
|
||||||
traffic.txt
|
traffic.txt
|
||||||
*~
|
*~
|
||||||
req*.txt
|
req*.txt
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode/
|
|
@ -306,7 +306,7 @@ def start():
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
if not checkInternet():
|
if not checkInternet():
|
||||||
warnMsg = "[%s] [WARNING] no connection detected" % time.strftime("%X")
|
warnMsg = "[%s] [WARNING] no connection detected" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
||||||
dataToStdout(warnMsg)
|
dataToStdout(warnMsg)
|
||||||
|
|
||||||
valid = False
|
valid = False
|
||||||
|
|
|
@ -109,7 +109,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
LOGGER_HANDLER = logging.StreamHandler(sys.stdout)
|
LOGGER_HANDLER = logging.StreamHandler(sys.stdout)
|
||||||
|
|
||||||
FORMATTER = logging.Formatter("\r[%(asctime)s] [%(levelname)s] %(message)s", "%H:%M:%S")
|
FORMATTER = logging.Formatter("\r[%(asctime)s] [%(levelname)s] [%(module)s] [%(filename)s] [Line: %(lineno)d] %(message)s", "%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
LOGGER_HANDLER.setFormatter(FORMATTER)
|
LOGGER_HANDLER.setFormatter(FORMATTER)
|
||||||
LOGGER.addHandler(LOGGER_HANDLER)
|
LOGGER.addHandler(LOGGER_HANDLER)
|
||||||
|
|
|
@ -517,7 +517,7 @@ def _findPageForms():
|
||||||
|
|
||||||
if conf.verbose in (1, 2):
|
if conf.verbose in (1, 2):
|
||||||
status = '%d/%d links visited (%d%%)' % (i + 1, len(targets), round(100.0 * (i + 1) / len(targets)))
|
status = '%d/%d links visited (%d%%)' % (i + 1, len(targets), round(100.0 * (i + 1) / len(targets)))
|
||||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
|
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status), True)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
break
|
break
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|
|
@ -128,7 +128,7 @@ MAX_MURPHY_SLEEP_TIME = 3
|
||||||
GOOGLE_REGEX = r"webcache\.googleusercontent\.com/search\?q=cache:[^:]+:([^+]+)\+&cd=|url\?\w+=((?![^>]+webcache\.googleusercontent\.com)http[^>]+)&(sa=U|rct=j)"
|
GOOGLE_REGEX = r"webcache\.googleusercontent\.com/search\?q=cache:[^:]+:([^+]+)\+&cd=|url\?\w+=((?![^>]+webcache\.googleusercontent\.com)http[^>]+)&(sa=U|rct=j)"
|
||||||
|
|
||||||
# Google Search consent cookie
|
# Google Search consent cookie
|
||||||
GOOGLE_CONSENT_COOKIE = "CONSENT=YES+shp.gws-%s-0-RC1.%s+FX+740" % (time.strftime("%Y%m%d"), "".join(random.sample(string.ascii_lowercase, 2)))
|
GOOGLE_CONSENT_COOKIE = "CONSENT=YES+shp.gws-%s-0-RC1.%s+FX+740" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "".join(random.sample(string.ascii_lowercase, 2)))
|
||||||
|
|
||||||
# Regular expression used for extracting results from DuckDuckGo search
|
# Regular expression used for extracting results from DuckDuckGo search
|
||||||
DUCKDUCKGO_REGEX = r'<a class="result__url" href="(htt[^"]+)'
|
DUCKDUCKGO_REGEX = r'<a class="result__url" href="(htt[^"]+)'
|
||||||
|
|
|
@ -174,7 +174,7 @@ def vulnTest():
|
||||||
|
|
||||||
for options, checks in TESTS:
|
for options, checks in TESTS:
|
||||||
status = '%d/%d (%d%%) ' % (count, len(TESTS), round(100.0 * count / len(TESTS)))
|
status = '%d/%d (%d%%) ' % (count, len(TESTS), round(100.0 * count / len(TESTS)))
|
||||||
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
|
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status))
|
||||||
|
|
||||||
if IS_WIN and "uraj" in options:
|
if IS_WIN and "uraj" in options:
|
||||||
options = options.replace(u"\u0161u\u0107uraj", "sucuraj")
|
options = options.replace(u"\u0161u\u0107uraj", "sucuraj")
|
||||||
|
@ -265,7 +265,7 @@ def smokeTest():
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
status = '%d/%d (%d%%) ' % (count, length, round(100.0 * count / length))
|
status = '%d/%d (%d%%) ' % (count, length, round(100.0 * count / length))
|
||||||
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
|
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status))
|
||||||
|
|
||||||
def _(node):
|
def _(node):
|
||||||
for __ in dir(node):
|
for __ in dir(node):
|
||||||
|
|
|
@ -46,7 +46,7 @@ def update():
|
||||||
debugMsg = "sqlmap will try to update itself using 'pip' command"
|
debugMsg = "sqlmap will try to update itself using 'pip' command"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
dataToStdout("\r[%s] [INFO] update in progress" % time.strftime("%X"))
|
dataToStdout("\r[%s] [INFO] update in progress" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
||||||
|
|
||||||
output = ""
|
output = ""
|
||||||
try:
|
try:
|
||||||
|
@ -133,7 +133,7 @@ def update():
|
||||||
debugMsg = "sqlmap will try to update itself using 'git' command"
|
debugMsg = "sqlmap will try to update itself using 'git' command"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
dataToStdout("\r[%s] [INFO] update in progress" % time.strftime("%X"))
|
dataToStdout("\r[%s] [INFO] update in progress" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
||||||
|
|
||||||
output = ""
|
output = ""
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -331,7 +331,7 @@ class Connect(object):
|
||||||
if conf.liveCookies:
|
if conf.liveCookies:
|
||||||
with kb.locks.liveCookies:
|
with kb.locks.liveCookies:
|
||||||
if not checkFile(conf.liveCookies, raiseOnError=False) or os.path.getsize(conf.liveCookies) == 0:
|
if not checkFile(conf.liveCookies, raiseOnError=False) or os.path.getsize(conf.liveCookies) == 0:
|
||||||
warnMsg = "[%s] [WARNING] live cookies file '%s' is empty or non-existent. Waiting for timeout (%d seconds)" % (time.strftime("%X"), conf.liveCookies, LIVE_COOKIES_TIMEOUT)
|
warnMsg = "[%s] [WARNING] live cookies file '%s' is empty or non-existent. Waiting for timeout (%d seconds)" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), conf.liveCookies, LIVE_COOKIES_TIMEOUT)
|
||||||
dataToStdout(warnMsg)
|
dataToStdout(warnMsg)
|
||||||
|
|
||||||
valid = False
|
valid = False
|
||||||
|
@ -1478,7 +1478,7 @@ class Connect(object):
|
||||||
warnMsg += "time-based injections because of inherent high latency time"
|
warnMsg += "time-based injections because of inherent high latency time"
|
||||||
singleTimeWarnMessage(warnMsg)
|
singleTimeWarnMessage(warnMsg)
|
||||||
|
|
||||||
warnMsg = "[%s] [WARNING] %stime-based comparison requires " % (time.strftime("%X"), "(case) " if kb.responseTimeMode else "")
|
warnMsg = "[%s] [WARNING] %stime-based comparison requires " % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "(case) " if kb.responseTimeMode else "")
|
||||||
warnMsg += "%s statistical model, please wait" % ("larger" if len(kb.responseTimes) == 1 else "reset of")
|
warnMsg += "%s statistical model, please wait" % ("larger" if len(kb.responseTimes) == 1 else "reset of")
|
||||||
dataToStdout(warnMsg)
|
dataToStdout(warnMsg)
|
||||||
|
|
||||||
|
|
|
@ -594,7 +594,7 @@ class Metasploit(object):
|
||||||
logger.debug("executing local command: %s" % self._payloadCmd)
|
logger.debug("executing local command: %s" % self._payloadCmd)
|
||||||
process = execute(self._payloadCmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False)
|
process = execute(self._payloadCmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False)
|
||||||
|
|
||||||
dataToStdout("\r[%s] [INFO] creation in progress " % time.strftime("%X"))
|
dataToStdout("\r[%s] [INFO] creation in progress " % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
||||||
pollProcess(process)
|
pollProcess(process)
|
||||||
payloadStderr = process.communicate()[1]
|
payloadStderr = process.communicate()[1]
|
||||||
|
|
||||||
|
|
|
@ -203,10 +203,10 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
|
|
||||||
if conf.verbose in (1, 2) and not any((showEta, conf.api, kb.bruteMode)):
|
if conf.verbose in (1, 2) and not any((showEta, conf.api, kb.bruteMode)):
|
||||||
if isinstance(length, int) and numThreads > 1:
|
if isinstance(length, int) and numThreads > 1:
|
||||||
dataToStdout("[%s] [INFO] retrieved: %s" % (time.strftime("%X"), "_" * min(length, conf.progressWidth)))
|
dataToStdout("[%s] [INFO] retrieved: %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "_" * min(length, conf.progressWidth)))
|
||||||
dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%X"))
|
dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
||||||
else:
|
else:
|
||||||
dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%X"))
|
dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
||||||
|
|
||||||
def tryHint(idx):
|
def tryHint(idx):
|
||||||
with kb.locks.hint:
|
with kb.locks.hint:
|
||||||
|
@ -561,7 +561,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
status = ' %d/%d (%d%%)' % (_, length, int(100.0 * _ / length))
|
status = ' %d/%d (%d%%)' % (_, length, int(100.0 * _ / length))
|
||||||
output += status if _ != length else " " * len(status)
|
output += status if _ != length else " " * len(status)
|
||||||
|
|
||||||
dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), output))
|
dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), output))
|
||||||
|
|
||||||
runThreads(numThreads, blindThread, startThreadMsg=False)
|
runThreads(numThreads, blindThread, startThreadMsg=False)
|
||||||
|
|
||||||
|
@ -580,10 +580,10 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
partialValue = "".join(value[:value.index(None)])
|
partialValue = "".join(value[:value.index(None)])
|
||||||
|
|
||||||
if partialValue:
|
if partialValue:
|
||||||
infoMsg = "\r[%s] [INFO] partially retrieved: %s" % (time.strftime("%X"), filterControlChars(partialValue))
|
infoMsg = "\r[%s] [INFO] partially retrieved: %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), filterControlChars(partialValue))
|
||||||
else:
|
else:
|
||||||
finalValue = "".join(value)
|
finalValue = "".join(value)
|
||||||
infoMsg = "\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), filterControlChars(finalValue))
|
infoMsg = "\r[%s] [INFO] retrieved: %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), filterControlChars(finalValue))
|
||||||
|
|
||||||
if conf.verbose in (1, 2) and infoMsg and not any((showEta, conf.api, kb.bruteMode)):
|
if conf.verbose in (1, 2) and infoMsg and not any((showEta, conf.api, kb.bruteMode)):
|
||||||
dataToStdout(infoMsg)
|
dataToStdout(infoMsg)
|
||||||
|
@ -700,7 +700,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
hashDBWrite(expression, "%s%s" % (PARTIAL_VALUE_MARKER if not conf.hexConvert else PARTIAL_HEX_VALUE_MARKER, partialValue))
|
hashDBWrite(expression, "%s%s" % (PARTIAL_VALUE_MARKER if not conf.hexConvert else PARTIAL_HEX_VALUE_MARKER, partialValue))
|
||||||
|
|
||||||
if conf.hexConvert and not any((abortedFlag, conf.api, kb.bruteMode)):
|
if conf.hexConvert and not any((abortedFlag, conf.api, kb.bruteMode)):
|
||||||
infoMsg = "\r[%s] [INFO] retrieved: %s %s\n" % (time.strftime("%X"), filterControlChars(finalValue), " " * retrievedLength)
|
infoMsg = "\r[%s] [INFO] retrieved: %s %s\n" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), filterControlChars(finalValue), " " * retrievedLength)
|
||||||
dataToStdout(infoMsg)
|
dataToStdout(infoMsg)
|
||||||
else:
|
else:
|
||||||
if conf.verbose in (1, 2) and not any((showEta, conf.api, kb.bruteMode)):
|
if conf.verbose in (1, 2) and not any((showEta, conf.api, kb.bruteMode)):
|
||||||
|
|
|
@ -102,7 +102,7 @@ def dnsUse(payload, expression):
|
||||||
retVal = output
|
retVal = output
|
||||||
|
|
||||||
if kb.dnsTest is not None:
|
if kb.dnsTest is not None:
|
||||||
dataToStdout("[%s] [INFO] %s: %s\n" % (time.strftime("%X"), "retrieved" if count > 0 else "resumed", safecharencode(output)))
|
dataToStdout("[%s] [INFO] %s: %s\n" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "retrieved" if count > 0 else "resumed", safecharencode(output)))
|
||||||
|
|
||||||
if count > 0:
|
if count > 0:
|
||||||
hashDBWrite(expression, output)
|
hashDBWrite(expression, output)
|
||||||
|
|
|
@ -255,7 +255,7 @@ def _errorFields(expression, expressionFields, expressionFieldsList, num=None, e
|
||||||
if kb.fileReadMode and output and output.strip():
|
if kb.fileReadMode and output and output.strip():
|
||||||
print()
|
print()
|
||||||
elif output is not None and not (threadData.resumed and kb.suppressResumeInfo) and not (emptyFields and field in emptyFields):
|
elif output is not None and not (threadData.resumed and kb.suppressResumeInfo) and not (emptyFields and field in emptyFields):
|
||||||
status = "[%s] [INFO] %s: '%s'" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", output if kb.safeCharEncode else safecharencode(output))
|
status = "[%s] [INFO] %s: '%s'" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "resumed" if threadData.resumed else "retrieved", output if kb.safeCharEncode else safecharencode(output))
|
||||||
|
|
||||||
if len(status) > width:
|
if len(status) > width:
|
||||||
status = "%s..." % status[:width - 3]
|
status = "%s..." % status[:width - 3]
|
||||||
|
|
|
@ -412,7 +412,7 @@ def unionUse(expression, unpack=True, dump=False):
|
||||||
|
|
||||||
if conf.verbose == 1 and not (threadData.resumed and kb.suppressResumeInfo) and not threadData.shared.showEta and not kb.bruteMode:
|
if conf.verbose == 1 and not (threadData.resumed and kb.suppressResumeInfo) and not threadData.shared.showEta and not kb.bruteMode:
|
||||||
_ = ','.join("'%s'" % _ for _ in (flattenValue(arrayizeValue(items)) if not isinstance(items, six.string_types) else [items]))
|
_ = ','.join("'%s'" % _ for _ in (flattenValue(arrayizeValue(items)) if not isinstance(items, six.string_types) else [items]))
|
||||||
status = "[%s] [INFO] %s: %s" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", _ if kb.safeCharEncode else safecharencode(_))
|
status = "[%s] [INFO] %s: %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "resumed" if threadData.resumed else "retrieved", _ if kb.safeCharEncode else safecharencode(_))
|
||||||
|
|
||||||
if len(status) > width:
|
if len(status) > width:
|
||||||
status = "%s..." % status[:width - 3]
|
status = "%s..." % status[:width - 3]
|
||||||
|
|
|
@ -154,7 +154,7 @@ class Database(object):
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
self.execute(
|
self.execute(
|
||||||
"CREATE TABLE logs(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, time TEXT, level TEXT, message TEXT)")
|
"CREATE TABLE logs(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, datetime TEXT, level TEXT, message TEXT)")
|
||||||
self.execute(
|
self.execute(
|
||||||
"CREATE TABLE data(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, status INTEGER, content_type INTEGER, value TEXT)")
|
"CREATE TABLE data(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, status INTEGER, content_type INTEGER, value TEXT)")
|
||||||
self.execute(
|
self.execute(
|
||||||
|
@ -327,8 +327,8 @@ class LogRecorder(logging.StreamHandler):
|
||||||
Record emitted events to IPC database for asynchronous I/O
|
Record emitted events to IPC database for asynchronous I/O
|
||||||
communication with the parent process
|
communication with the parent process
|
||||||
"""
|
"""
|
||||||
conf.databaseCursor.execute("INSERT INTO logs VALUES(NULL, ?, ?, ?, ?)", (conf.taskid, time.strftime(
|
conf.databaseCursor.execute("INSERT INTO logs VALUES(NULL, ?, ?, ?, ?)", (conf.taskid, time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
|
||||||
"%X"), record.levelname, record.msg % record.args if record.args else record.msg))
|
record.levelname, record.msg % record.args if record.args else record.msg))
|
||||||
|
|
||||||
|
|
||||||
def setRestAPILog():
|
def setRestAPILog():
|
||||||
|
@ -962,9 +962,9 @@ def scan_log_limited(taskid, start, end):
|
||||||
end = max(1, int(end))
|
end = max(1, int(end))
|
||||||
|
|
||||||
# Read a subset of log messages from the IPC database
|
# Read a subset of log messages from the IPC database
|
||||||
for time_, level, message in DataStore.current_db.execute("SELECT time, level, message FROM logs WHERE taskid = ? AND id >= ? AND id <= ? ORDER BY id ASC", (taskid, start, end)):
|
for datetime_, level, message in DataStore.current_db.execute("SELECT datetime, level, message FROM logs WHERE taskid = ? AND id >= ? AND id <= ? ORDER BY id ASC", (taskid, start, end)):
|
||||||
json_log_messages.append(
|
json_log_messages.append(
|
||||||
{"time": time_, "level": level, "message": message})
|
{"datetime": datetime_, "level": level, "message": message})
|
||||||
|
|
||||||
logger.debug("(%s) Retrieved scan log messages subset" % taskid)
|
logger.debug("(%s) Retrieved scan log messages subset" % taskid)
|
||||||
return jsonize({"success": True, "log": json_log_messages})
|
return jsonize({"success": True, "log": json_log_messages})
|
||||||
|
@ -987,13 +987,13 @@ def scan_log_details(taskid):
|
||||||
# Read all log messages from the IPC database
|
# Read all log messages from the IPC database
|
||||||
logs = []
|
logs = []
|
||||||
result_cursor = DataStore.current_db.only_execute(
|
result_cursor = DataStore.current_db.only_execute(
|
||||||
"SELECT time, level, message FROM logs WHERE taskid = ? ORDER BY id ASC", (taskid,))
|
"SELECT datetime, level, message FROM logs WHERE taskid = ? ORDER BY id ASC", (taskid,))
|
||||||
query_result = result_cursor.fetchall()
|
query_result = result_cursor.fetchall()
|
||||||
|
|
||||||
index = 0
|
index = 0
|
||||||
for time_, level, message in query_result:
|
for datetime_, level, message in query_result:
|
||||||
index += 1
|
index += 1
|
||||||
logs.append({"index": index, "time": time_,
|
logs.append({"index": index, "datetime": datetime_,
|
||||||
"level": level, "message": message})
|
"level": level, "message": message})
|
||||||
|
|
||||||
logger.debug("(%s) Retrieved scan log messages" % taskid)
|
logger.debug("(%s) Retrieved scan log messages" % taskid)
|
||||||
|
@ -1013,9 +1013,9 @@ def scan_log(taskid):
|
||||||
return jsonize({"success": False, "message": "Invalid task ID"})
|
return jsonize({"success": False, "message": "Invalid task ID"})
|
||||||
|
|
||||||
# Read all log messages from the IPC database
|
# Read all log messages from the IPC database
|
||||||
for time_, level, message in DataStore.current_db.execute("SELECT time, level, message FROM logs WHERE taskid = ? ORDER BY id ASC", (taskid,)):
|
for datetime_, level, message in DataStore.current_db.execute("SELECT datetime, level, message FROM logs WHERE taskid = ? ORDER BY id ASC", (taskid,)):
|
||||||
json_log_messages.append(
|
json_log_messages.append(
|
||||||
{"time": time_, "level": level, "message": message})
|
{"datetime": datetime_, "level": level, "message": message})
|
||||||
|
|
||||||
logger.debug("(%s) Retrieved scan log messages" % taskid)
|
logger.debug("(%s) Retrieved scan log messages" % taskid)
|
||||||
return jsonize({"success": True, "log": json_log_messages})
|
return jsonize({"success": True, "log": json_log_messages})
|
||||||
|
|
|
@ -145,12 +145,12 @@ def tableExists(tableFile, regex=None):
|
||||||
|
|
||||||
if conf.verbose in (1, 2) and not conf.api:
|
if conf.verbose in (1, 2) and not conf.api:
|
||||||
clearConsoleLine(True)
|
clearConsoleLine(True)
|
||||||
infoMsg = "[%s] [INFO] retrieved: %s\n" % (time.strftime("%X"), unsafeSQLIdentificatorNaming(table))
|
infoMsg = "[%s] [INFO] retrieved: %s\n" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), unsafeSQLIdentificatorNaming(table))
|
||||||
dataToStdout(infoMsg, True)
|
dataToStdout(infoMsg, True)
|
||||||
|
|
||||||
if conf.verbose in (1, 2):
|
if conf.verbose in (1, 2):
|
||||||
status = '%d/%d items (%d%%)' % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
|
status = '%d/%d items (%d%%)' % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
|
||||||
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%X"), status), True)
|
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status), True)
|
||||||
|
|
||||||
kb.locks.io.release()
|
kb.locks.io.release()
|
||||||
|
|
||||||
|
@ -266,12 +266,12 @@ def columnExists(columnFile, regex=None):
|
||||||
|
|
||||||
if conf.verbose in (1, 2) and not conf.api:
|
if conf.verbose in (1, 2) and not conf.api:
|
||||||
clearConsoleLine(True)
|
clearConsoleLine(True)
|
||||||
infoMsg = "[%s] [INFO] retrieved: %s\n" % (time.strftime("%X"), unsafeSQLIdentificatorNaming(column))
|
infoMsg = "[%s] [INFO] retrieved: %s\n" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), unsafeSQLIdentificatorNaming(column))
|
||||||
dataToStdout(infoMsg, True)
|
dataToStdout(infoMsg, True)
|
||||||
|
|
||||||
if conf.verbose in (1, 2):
|
if conf.verbose in (1, 2):
|
||||||
status = "%d/%d items (%d%%)" % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
|
status = "%d/%d items (%d%%)" % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
|
||||||
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%X"), status), True)
|
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status), True)
|
||||||
|
|
||||||
kb.locks.io.release()
|
kb.locks.io.release()
|
||||||
|
|
||||||
|
@ -376,12 +376,12 @@ def fileExists(pathFile):
|
||||||
|
|
||||||
if not conf.api:
|
if not conf.api:
|
||||||
clearConsoleLine(True)
|
clearConsoleLine(True)
|
||||||
infoMsg = "[%s] [INFO] retrieved: '%s'\n" % (time.strftime("%X"), path)
|
infoMsg = "[%s] [INFO] retrieved: '%s'\n" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), path)
|
||||||
dataToStdout(infoMsg, True)
|
dataToStdout(infoMsg, True)
|
||||||
|
|
||||||
if conf.verbose in (1, 2):
|
if conf.verbose in (1, 2):
|
||||||
status = '%d/%d items (%d%%)' % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
|
status = '%d/%d items (%d%%)' % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
|
||||||
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%X"), status), True)
|
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status), True)
|
||||||
|
|
||||||
kb.locks.io.release()
|
kb.locks.io.release()
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ def crawl(target, post=None, cookie=None):
|
||||||
if conf.verbose in (1, 2):
|
if conf.verbose in (1, 2):
|
||||||
threadData.shared.count += 1
|
threadData.shared.count += 1
|
||||||
status = '%d/%d links visited (%d%%)' % (threadData.shared.count, threadData.shared.length, round(100.0 * threadData.shared.count / threadData.shared.length))
|
status = '%d/%d links visited (%d%%)' % (threadData.shared.count, threadData.shared.length, round(100.0 * threadData.shared.count / threadData.shared.length))
|
||||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
|
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status), True)
|
||||||
|
|
||||||
threadData.shared.deeper = set()
|
threadData.shared.deeper = set()
|
||||||
threadData.shared.unprocessed = set([target])
|
threadData.shared.unprocessed = set([target])
|
||||||
|
|
|
@ -848,7 +848,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
|
||||||
|
|
||||||
clearConsoleLine()
|
clearConsoleLine()
|
||||||
|
|
||||||
infoMsg = "\r[%s] [INFO] cracked password '%s'" % (time.strftime("%X"), word)
|
infoMsg = "\r[%s] [INFO] cracked password '%s'" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), word)
|
||||||
|
|
||||||
if user and not user.startswith(DUMMY_USER_PREFIX):
|
if user and not user.startswith(DUMMY_USER_PREFIX):
|
||||||
infoMsg += " for user '%s'\n" % user
|
infoMsg += " for user '%s'\n" % user
|
||||||
|
@ -868,7 +868,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
|
||||||
status = "current status: %s... %s" % (word.ljust(5)[:5], ROTATING_CHARS[rotator])
|
status = "current status: %s... %s" % (word.ljust(5)[:5], ROTATING_CHARS[rotator])
|
||||||
|
|
||||||
if not api:
|
if not api:
|
||||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status))
|
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status))
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
|
@ -924,7 +924,7 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
|
||||||
|
|
||||||
clearConsoleLine()
|
clearConsoleLine()
|
||||||
|
|
||||||
infoMsg = "\r[%s] [INFO] cracked password '%s'" % (time.strftime("%X"), word)
|
infoMsg = "\r[%s] [INFO] cracked password '%s'" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), word)
|
||||||
|
|
||||||
if user and not user.startswith(DUMMY_USER_PREFIX):
|
if user and not user.startswith(DUMMY_USER_PREFIX):
|
||||||
infoMsg += " for user '%s'\n" % user
|
infoMsg += " for user '%s'\n" % user
|
||||||
|
@ -947,7 +947,7 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
|
||||||
status += " (user: %s)" % user
|
status += " (user: %s)" % user
|
||||||
|
|
||||||
if not api:
|
if not api:
|
||||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status))
|
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), status))
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -11,7 +11,7 @@ import time
|
||||||
PYVERSION = sys.version.split()[0]
|
PYVERSION = sys.version.split()[0]
|
||||||
|
|
||||||
if PYVERSION < "2.6":
|
if PYVERSION < "2.6":
|
||||||
sys.exit("[%s] [CRITICAL] incompatible Python version detected ('%s'). To successfully run sqlmap you'll have to use version 2.6, 2.7 or 3.x (visit 'https://www.python.org/downloads/')" % (time.strftime("%X"), PYVERSION))
|
sys.exit("[%s] [CRITICAL] incompatible Python version detected ('%s'). To successfully run sqlmap you'll have to use version 2.6, 2.7 or 3.x (visit 'https://www.python.org/downloads/')" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), PYVERSION))
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
extensions = ("bz2", "gzip", "pyexpat", "ssl", "sqlite3", "zlib")
|
extensions = ("bz2", "gzip", "pyexpat", "ssl", "sqlite3", "zlib")
|
||||||
|
@ -22,7 +22,7 @@ for _ in extensions:
|
||||||
errors.append(_)
|
errors.append(_)
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
errMsg = "[%s] [CRITICAL] missing one or more core extensions (%s) " % (time.strftime("%X"), ", ".join("'%s'" % _ for _ in errors))
|
errMsg = "[%s] [CRITICAL] missing one or more core extensions (%s) " % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), ", ".join("'%s'" % _ for _ in errors))
|
||||||
errMsg += "most likely because current version of Python has been "
|
errMsg += "most likely because current version of Python has been "
|
||||||
errMsg += "built without appropriate dev packages"
|
errMsg += "built without appropriate dev packages"
|
||||||
sys.exit(errMsg)
|
sys.exit(errMsg)
|
||||||
|
|
|
@ -98,7 +98,7 @@ except KeyboardInterrupt:
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
else:
|
else:
|
||||||
import time
|
import time
|
||||||
sys.exit("\r[%s] [CRITICAL] %s" % (time.strftime("%X"), errMsg))
|
sys.exit("\r[%s] [CRITICAL] %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), errMsg))
|
||||||
|
|
||||||
def modulePath():
|
def modulePath():
|
||||||
"""
|
"""
|
||||||
|
@ -172,7 +172,7 @@ def main():
|
||||||
|
|
||||||
conf.showTime = True
|
conf.showTime = True
|
||||||
dataToStdout("[!] legal disclaimer: %s\n\n" % LEGAL_DISCLAIMER, forceOutput=True)
|
dataToStdout("[!] legal disclaimer: %s\n\n" % LEGAL_DISCLAIMER, forceOutput=True)
|
||||||
dataToStdout("[*] starting @ %s\n\n" % time.strftime("%X /%Y-%m-%d/"), forceOutput=True)
|
dataToStdout("[*] starting @ %s\n\n" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), forceOutput=True)
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ def main():
|
||||||
logger.warning(warnMsg)
|
logger.warning(warnMsg)
|
||||||
|
|
||||||
if conf.get("showTime"):
|
if conf.get("showTime"):
|
||||||
dataToStdout("\n[*] ending @ %s\n\n" % time.strftime("%X /%Y-%m-%d/"), forceOutput=True)
|
dataToStdout("\n[*] ending @ %s\n\n" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), forceOutput=True)
|
||||||
|
|
||||||
kb.threadException = True
|
kb.threadException = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user