mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Fixing --openapi-only config file rejection and HAR export header-name casing
This commit is contained in:
parent
1c869b7430
commit
0a6dbd260f
3 changed files with 5 additions and 5 deletions
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty import six
|
from thirdparty import six
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.10.7.231"
|
VERSION = "1.10.7.232"
|
||||||
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)
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,14 @@ def configFileParser(configFile):
|
||||||
|
|
||||||
mandatory = False
|
mandatory = False
|
||||||
|
|
||||||
for option in ("direct", "url", "logFile", "bulkFile", "googleDork", "requestFile", "wizard"):
|
for option in ("direct", "url", "logFile", "bulkFile", "googleDork", "requestFile", "openApiFile", "wizard"):
|
||||||
if config.has_option("Target", option) and config.get("Target", option) or cmdLineOptions.get(option):
|
if config.has_option("Target", option) and config.get("Target", option) or cmdLineOptions.get(option):
|
||||||
mandatory = True
|
mandatory = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if not mandatory:
|
if not mandatory:
|
||||||
errMsg = "missing a mandatory option in the configuration file "
|
errMsg = "missing a mandatory option in the configuration file "
|
||||||
errMsg += "(direct, url, logFile, bulkFile, googleDork, requestFile or wizard)"
|
errMsg += "(direct, url, logFile, bulkFile, googleDork, requestFile, openApiFile or wizard)"
|
||||||
raise SqlmapMissingMandatoryOptionException(errMsg)
|
raise SqlmapMissingMandatoryOptionException(errMsg)
|
||||||
|
|
||||||
for family, optionData in optDict.items():
|
for family, optionData in optDict.items():
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ class Request(object):
|
||||||
"httpVersion": self.httpVersion,
|
"httpVersion": self.httpVersion,
|
||||||
"method": self.method,
|
"method": self.method,
|
||||||
"url": self.url,
|
"url": self.url,
|
||||||
"headers": [dict(name=key.capitalize(), value=value) for key, value in self.headers.items()],
|
"headers": [dict(name="-".join(_.capitalize() for _ in key.split("-")), value=value) for key, value in self.headers.items()],
|
||||||
"cookies": [],
|
"cookies": [],
|
||||||
"queryString": [],
|
"queryString": [],
|
||||||
"headersSize": -1,
|
"headersSize": -1,
|
||||||
|
|
@ -202,7 +202,7 @@ class Response(object):
|
||||||
"httpVersion": self.httpVersion,
|
"httpVersion": self.httpVersion,
|
||||||
"status": self.status,
|
"status": self.status,
|
||||||
"statusText": self.statusText,
|
"statusText": self.statusText,
|
||||||
"headers": [dict(name=key.capitalize(), value=value) for key, value in self.headers.items() if key.lower() != "uri"],
|
"headers": [dict(name="-".join(_.capitalize() for _ in key.split("-")), value=value) for key, value in self.headers.items() if key.lower() != "uri"],
|
||||||
"cookies": [],
|
"cookies": [],
|
||||||
"content": content,
|
"content": content,
|
||||||
"headersSize": -1,
|
"headersSize": -1,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue