mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-11 02:53:11 +00:00
Adding --openapi-tags
This commit is contained in:
parent
fc1ae6950e
commit
622cfa76c6
6 changed files with 37 additions and 4 deletions
|
|
@ -521,8 +521,13 @@ def _setOpenApiTargets():
|
|||
logger.info(infoMsg)
|
||||
content = openFile(conf.openApiFile).read()
|
||||
|
||||
tags = [_.strip() for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.openApiTags) if _.strip()] if conf.openApiTags else None
|
||||
if tags:
|
||||
infoMsg = "restricting extraction to OpenAPI/Swagger operations tagged: %s" % ", ".join(tags)
|
||||
logger.info(infoMsg)
|
||||
|
||||
try:
|
||||
targets = openApiTargets(content, origin)
|
||||
targets = openApiTargets(content, origin, tags)
|
||||
except ValueError as ex:
|
||||
errMsg = "unable to parse the OpenAPI/Swagger specification ('%s')" % getSafeExString(ex)
|
||||
raise SqlmapSyntaxException(errMsg)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ optDict = {
|
|||
"configFile": "string",
|
||||
"openApiFile": "string",
|
||||
"openApiBase": "string",
|
||||
"openApiTags": "string",
|
||||
},
|
||||
|
||||
"Request": {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.7.57"
|
||||
VERSION = "1.10.7.58"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue