Minor style update

This commit is contained in:
Miroslav Stampar 2019-07-12 14:19:25 +02:00
parent eb14f296f6
commit 34ed2c51ac
3 changed files with 227 additions and 229 deletions

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.7.21" VERSION = "1.3.7.22"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -88,33 +88,32 @@ def cmdLineParser(argv=None):
parser = ArgumentParser(usage=usage) parser = ArgumentParser(usage=usage)
try: try:
parser.add_argument("--hh", dest="advancedHelp", parser.add_argument("--hh", dest="advancedHelp", action="store_true",
action="store_true",
help="Show advanced help message and exit") help="Show advanced help message and exit")
parser.add_argument("--version", dest="showVersion", parser.add_argument("--version", dest="showVersion", action="store_true",
action="store_true",
help="Show program's version number and exit") help="Show program's version number and exit")
parser.add_argument("-v", dest="verbose", type=int, parser.add_argument("-v", dest="verbose", type=int,
help="Verbosity level: 0-6 (default %d)" % defaults.verbose) help="Verbosity level: 0-6 (default %d)" % defaults.verbose)
# Target options # Target options
target = parser.add_argument_group("Target", "At least one of these " target = parser.add_argument_group("Target", "At least one of these options has to be provided to define the target(s)")
"options has to be provided to define the target(s)")
target.add_argument("-d", dest="direct", help="Connection string " target.add_argument("-d", dest="direct",
"for direct database connection") help="Connection string for direct database connection")
target.add_argument("-u", "--url", dest="url", help="Target URL (e.g. \"http://www.site.com/vuln.php?id=1\")") target.add_argument("-u", "--url", dest="url",
help="Target URL (e.g. \"http://www.site.com/vuln.php?id=1\")")
target.add_argument("-l", dest="logFile", help="Parse target(s) from Burp " target.add_argument("-l", dest="logFile",
"or WebScarab proxy log file") help="Parse target(s) from Burp or WebScarab proxy log file")
target.add_argument("-x", dest="sitemapUrl", help="Parse target(s) from remote sitemap(.xml) file") target.add_argument("-x", dest="sitemapUrl",
help="Parse target(s) from remote sitemap(.xml) file")
target.add_argument("-m", dest="bulkFile", help="Scan multiple targets given " target.add_argument("-m", dest="bulkFile",
"in a textual file ") help="Scan multiple targets given in a textual file ")
target.add_argument("-r", dest="requestFile", target.add_argument("-r", dest="requestFile",
help="Load HTTP request from a file") help="Load HTTP request from a file")
@ -126,8 +125,7 @@ def cmdLineParser(argv=None):
help="Load options from a configuration INI file") help="Load options from a configuration INI file")
# Request options # Request options
request = parser.add_argument_group("Request", "These options can be used " request = parser.add_argument_group("Request", "These options can be used to specify how to connect to the target URL")
"to specify how to connect to the target URL")
request.add_argument("--method", dest="method", request.add_argument("--method", dest="method",
help="Force usage of given HTTP method (e.g. PUT)") help="Force usage of given HTTP method (e.g. PUT)")
@ -271,8 +269,7 @@ def cmdLineParser(argv=None):
help="Retrieve page length without actual HTTP response body") help="Retrieve page length without actual HTTP response body")
optimization.add_argument("--threads", dest="threads", type=int, optimization.add_argument("--threads", dest="threads", type=int,
help="Max number of concurrent HTTP(s) " help="Max number of concurrent HTTP(s) requests (default %d)" % defaults.threads)
"requests (default %d)" % defaults.threads)
# Injection options # Injection options
injection = parser.add_argument_group("Injection", "These options can be used to specify which parameters to test for, provide custom injection payloads and optional tampering scripts") injection = parser.add_argument_group("Injection", "These options can be used to specify which parameters to test for, provide custom injection payloads and optional tampering scripts")
@ -718,12 +715,10 @@ def cmdLineParser(argv=None):
# Hidden and/or experimental options # Hidden and/or experimental options
parser.add_argument("--base64", dest="base64Parameter", parser.add_argument("--base64", dest="base64Parameter",
help=SUPPRESS) help=SUPPRESS) # "Parameter(s) containing Base64 encoded values"
# help="Parameter(s) containing Base64 encoded values")
parser.add_argument("--crack", dest="hashFile", parser.add_argument("--crack", dest="hashFile",
help=SUPPRESS) help=SUPPRESS) # "Load and crack hashes from a file (standalone)"
# help="Load and crack hashes from a file (standalone)")
parser.add_argument("--dummy", dest="dummy", action="store_true", parser.add_argument("--dummy", dest="dummy", action="store_true",
help=SUPPRESS) help=SUPPRESS)
@ -764,15 +759,18 @@ def cmdLineParser(argv=None):
parser.add_argument("--stop-fail", dest="stopFail", action="store_true", parser.add_argument("--stop-fail", dest="stopFail", action="store_true",
help=SUPPRESS) help=SUPPRESS)
parser.add_argument("--run-case", dest="runCase", help=SUPPRESS) parser.add_argument("--run-case", dest="runCase",
help=SUPPRESS)
# API options # API options
parser.add_argument("--api", dest="api", action="store_true", parser.add_argument("--api", dest="api", action="store_true",
help=SUPPRESS) help=SUPPRESS)
parser.add_argument("--taskid", dest="taskid", help=SUPPRESS) parser.add_argument("--taskid", dest="taskid",
help=SUPPRESS)
parser.add_argument("--database", dest="database", help=SUPPRESS) parser.add_argument("--database", dest="database",
help=SUPPRESS)
# Dirty hack to display longer options without breaking into two lines # Dirty hack to display longer options without breaking into two lines
if hasattr(parser, "formatter"): if hasattr(parser, "formatter"):
@ -805,7 +803,7 @@ def cmdLineParser(argv=None):
action.option_strings = ["-hh"] action.option_strings = ["-hh"]
break break
## Dirty hack for inherent help message of switch '-h' # Dirty hack for inherent help message of switch '-h'
if hasattr(parser, "get_option"): if hasattr(parser, "get_option"):
option = parser.get_option("-h") option = parser.get_option("-h")
option.help = option.help.capitalize().replace("this help", "basic help") option.help = option.help.capitalize().replace("this help", "basic help")