mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-09 10:02:31 +00:00
Minor update
This commit is contained in:
parent
87eb93db15
commit
e0269acc0d
5 changed files with 48 additions and 14 deletions
|
|
@ -32,6 +32,7 @@ from lib.core.compat import xrange
|
|||
from lib.core.convert import encodeBase64
|
||||
from lib.core.convert import getBytes
|
||||
from lib.core.convert import getText
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.data import paths
|
||||
|
|
@ -114,6 +115,20 @@ def vulnTest():
|
|||
TESTS = tuple(_ for _ in TESTS if "--ssti" not in _[0])
|
||||
logger.warning("skipping the SSTI vuln-test entry ('jinja2' not available)")
|
||||
|
||||
# --test-filter / --test-skip narrow a (slow) full run to just the entries touching a change:
|
||||
# the needle is matched case-insensitively against each entry's command line and its expected
|
||||
# checks (e.g. '--vuln-test --test-filter=ssti' runs only the SSTI entry).
|
||||
def _entryMatches(entry, needle):
|
||||
needle = needle.lower()
|
||||
return needle in entry[0].lower() or any(needle in getText(_).lower() for _ in entry[1])
|
||||
|
||||
if conf.get("testFilter"):
|
||||
TESTS = tuple(_ for _ in TESTS if _entryMatches(_, conf.testFilter))
|
||||
logger.info("'--test-filter' selected %d vuln-test entr%s" % (len(TESTS), "y" if len(TESTS) == 1 else "ies"))
|
||||
if conf.get("testSkip"):
|
||||
TESTS = tuple(_ for _ in TESTS if not _entryMatches(_, conf.testSkip))
|
||||
logger.info("'--test-skip' left %d vuln-test entr%s" % (len(TESTS), "y" if len(TESTS) == 1 else "ies"))
|
||||
|
||||
retVal = True
|
||||
count = 0
|
||||
cleanups = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue