Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46736ca

Browse files
committed
Fixes #1931
1 parent 041213f commit 46736ca

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.6.32"
22+
VERSION = "1.0.6.33"
2323
REVISION = getRevisionNumber()
2424
STABLE = VERSION.count('.') <= 2
2525
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

lib/parse/cmdline.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from lib.core.common import checkDeprecatedOptions
1919
from lib.core.common import checkSystemEncoding
20+
from lib.core.common import dataToStdout
2021
from lib.core.common import expandMnemonics
2122
from lib.core.common import getUnicode
2223
from lib.core.data import cmdLineOptions
@@ -862,13 +863,13 @@ def _(self, *args):
862863
continue
863864
elif command.lower() == "clear":
864865
clearHistory()
865-
print "[i] history cleared"
866+
dataToStdout("[i] history cleared\n")
866867
saveHistory(AUTOCOMPLETE_TYPE.SQLMAP)
867868
elif command.lower() in ("x", "q", "exit", "quit"):
868869
raise SqlmapShellQuitException
869870
elif command[0] != '-':
870-
print "[!] invalid option(s) provided"
871-
print "[i] proper example: '-u http://www.site.com/vuln.php?id=1 --banner'"
871+
dataToStdout("[!] invalid option(s) provided\n")
872+
dataToStdout("[i] proper example: '-u http://www.site.com/vuln.php?id=1 --banner'\n")
872873
else:
873874
saveHistory(AUTOCOMPLETE_TYPE.SQLMAP)
874875
loadHistory(AUTOCOMPLETE_TYPE.SQLMAP)
@@ -885,7 +886,8 @@ def _(self, *args):
885886
if argv[i] == "-hh":
886887
argv[i] = "-h"
887888
elif re.search(r"\A-\w=.+", argv[i]):
888-
print "[!] potentially miswritten (illegal '=') short option detected ('%s')" % argv[i]
889+
dataToStdout("[!] potentially miswritten (illegal '=') short option detected ('%s')\n" % argv[i])
890+
raise SystemExit
889891
elif argv[i] == "-H":
890892
if i + 1 < len(argv):
891893
extraHeaders.append(argv[i + 1])
@@ -910,11 +912,11 @@ def _(self, *args):
910912
try:
911913
(args, _) = parser.parse_args(argv)
912914
except UnicodeEncodeError, ex:
913-
print "\n[!] %s" % ex.object.encode("unicode-escape")
915+
dataToStdout("\n[!] %s\n" % ex.object.encode("unicode-escape"))
914916
raise SystemExit
915917
except SystemExit:
916918
if "-h" in argv and not advancedHelp:
917-
print "\n[!] to see full list of options run with '-hh'"
919+
dataToStdout("\n[!] to see full list of options run with '-hh'\n")
918920
raise
919921

920922
if extraHeaders:
@@ -946,7 +948,7 @@ def _(self, *args):
946948
except SystemExit:
947949
# Protection against Windows dummy double clicking
948950
if IS_WIN:
949-
print "\nPress Enter to continue...",
951+
dataToStdout("\nPress Enter to continue...")
950952
raw_input()
951953
raise
952954

0 commit comments

Comments
 (0)