Minor enhancement

This commit is contained in:
Miroslav Stampar 2015-01-22 09:17:45 +01:00
parent b7cfaa6ca5
commit 779db7cbc3
2 changed files with 16 additions and 4 deletions

View File

@ -582,10 +582,15 @@ def paramToDict(place, parameters=None):
warnMsg += "so sqlmap could be able to run properly"
logger.warn(warnMsg)
message = "are you sure you want to continue? [y/N] "
message = "are you really sure that you want to continue (sqlmap could have problems)? [y/N] "
test = readInput(message, default="N")
if test[0] not in ("y", "Y"):
raise SqlmapSilentQuitException
else:
original = [_ for _ in string.ascii_letters + string.digits]
shuffled = list(original)
random.shuffle(shuffled)
kb.easterEgg = dict(_ for _ in zip(original, shuffled))
elif not _:
warnMsg = "provided value for parameter '%s' is empty. " % parameter
warnMsg += "Please, always use only valid parameter values "
@ -824,6 +829,9 @@ def dataToStdout(data, forceOutput=False, bold=False, content_type=None, status=
else:
message = data
if kb.easterEgg:
message = "".join(kb.easterEgg.get(_, _) for _ in message)
if hasattr(conf, "api"):
sys.stdout.write(message, status, content_type)
else:

View File

@ -477,11 +477,14 @@ def _adjustLoggingFormatter():
return
def format(record):
_ = boldifyMessage(FORMATTER._format(record))
message = FORMATTER._format(record)
if kb.easterEgg:
message = "".join(kb.easterEgg.get(_, _) for _ in message)
message = boldifyMessage(message)
if kb.prependFlag:
_ = "\n%s" % _
message = "\n%s" % message
kb.prependFlag = False
return _
return message
FORMATTER._format = FORMATTER.format
FORMATTER.format = format
@ -1712,6 +1715,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
kb.followSitemapRecursion = None
kb.forcedDbms = None
kb.forcePartialUnion = False
kb.easterEgg = None
kb.headersFp = {}
kb.heuristicDbms = None
kb.heuristicMode = False