mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Fixes #1931
This commit is contained in:
parent
041213f22d
commit
46736cac7b
|
@ -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")
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user