This commit is contained in:
Miroslav Stampar 2016-06-10 18:41:41 +02:00
parent 041213f22d
commit 46736cac7b
2 changed files with 10 additions and 8 deletions

View File

@ -19,7 +19,7 @@ from lib.core.enums import OS
from lib.core.revision import getRevisionNumber from lib.core.revision import getRevisionNumber
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.0.6.32" VERSION = "1.0.6.33"
REVISION = getRevisionNumber() REVISION = getRevisionNumber()
STABLE = VERSION.count('.') <= 2 STABLE = VERSION.count('.') <= 2
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

View File

@ -17,6 +17,7 @@ from optparse import SUPPRESS_HELP
from lib.core.common import checkDeprecatedOptions from lib.core.common import checkDeprecatedOptions
from lib.core.common import checkSystemEncoding from lib.core.common import checkSystemEncoding
from lib.core.common import dataToStdout
from lib.core.common import expandMnemonics from lib.core.common import expandMnemonics
from lib.core.common import getUnicode from lib.core.common import getUnicode
from lib.core.data import cmdLineOptions from lib.core.data import cmdLineOptions
@ -862,13 +863,13 @@ def cmdLineParser(argv=None):
continue continue
elif command.lower() == "clear": elif command.lower() == "clear":
clearHistory() clearHistory()
print "[i] history cleared" dataToStdout("[i] history cleared\n")
saveHistory(AUTOCOMPLETE_TYPE.SQLMAP) saveHistory(AUTOCOMPLETE_TYPE.SQLMAP)
elif command.lower() in ("x", "q", "exit", "quit"): elif command.lower() in ("x", "q", "exit", "quit"):
raise SqlmapShellQuitException raise SqlmapShellQuitException
elif command[0] != '-': elif command[0] != '-':
print "[!] invalid option(s) provided" dataToStdout("[!] invalid option(s) provided\n")
print "[i] proper example: '-u http://www.site.com/vuln.php?id=1 --banner'" dataToStdout("[i] proper example: '-u http://www.site.com/vuln.php?id=1 --banner'\n")
else: else:
saveHistory(AUTOCOMPLETE_TYPE.SQLMAP) saveHistory(AUTOCOMPLETE_TYPE.SQLMAP)
loadHistory(AUTOCOMPLETE_TYPE.SQLMAP) loadHistory(AUTOCOMPLETE_TYPE.SQLMAP)
@ -885,7 +886,8 @@ def cmdLineParser(argv=None):
if argv[i] == "-hh": if argv[i] == "-hh":
argv[i] = "-h" argv[i] = "-h"
elif re.search(r"\A-\w=.+", argv[i]): elif re.search(r"\A-\w=.+", argv[i]):
print "[!] potentially miswritten (illegal '=') short option detected ('%s')" % argv[i] dataToStdout("[!] potentially miswritten (illegal '=') short option detected ('%s')\n" % argv[i])
raise SystemExit
elif argv[i] == "-H": elif argv[i] == "-H":
if i + 1 < len(argv): if i + 1 < len(argv):
extraHeaders.append(argv[i + 1]) extraHeaders.append(argv[i + 1])
@ -910,11 +912,11 @@ def cmdLineParser(argv=None):
try: try:
(args, _) = parser.parse_args(argv) (args, _) = parser.parse_args(argv)
except UnicodeEncodeError, ex: except UnicodeEncodeError, ex:
print "\n[!] %s" % ex.object.encode("unicode-escape") dataToStdout("\n[!] %s\n" % ex.object.encode("unicode-escape"))
raise SystemExit raise SystemExit
except SystemExit: except SystemExit:
if "-h" in argv and not advancedHelp: if "-h" in argv and not advancedHelp:
print "\n[!] to see full list of options run with '-hh'" dataToStdout("\n[!] to see full list of options run with '-hh'\n")
raise raise
if extraHeaders: if extraHeaders:
@ -946,7 +948,7 @@ def cmdLineParser(argv=None):
except SystemExit: except SystemExit:
# Protection against Windows dummy double clicking # Protection against Windows dummy double clicking
if IS_WIN: if IS_WIN:
print "\nPress Enter to continue...", dataToStdout("\nPress Enter to continue...")
raw_input() raw_input()
raise raise