mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-09 02:03:46 +03:00
added support for --scope in --crawl mode
This commit is contained in:
parent
42746cc706
commit
4d1fa5596b
|
@ -192,7 +192,7 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if conf.scope:
|
if conf.scope:
|
||||||
getPostReq &= re.search(conf.scope, url) is not None
|
getPostReq &= re.search(conf.scope, url, re.I) is not None
|
||||||
|
|
||||||
if getPostReq:
|
if getPostReq:
|
||||||
if not kb.targetUrls or url not in addedTargetUrls:
|
if not kb.targetUrls or url not in addedTargetUrls:
|
||||||
|
|
|
@ -58,9 +58,16 @@ class Crawler:
|
||||||
for tag in soup('a'):
|
for tag in soup('a'):
|
||||||
if tag.get("href"):
|
if tag.get("href"):
|
||||||
url = urlparse.urljoin(conf.url, tag.get("href"))
|
url = urlparse.urljoin(conf.url, tag.get("href"))
|
||||||
|
|
||||||
# flag to know if we are dealing with the same target host
|
# flag to know if we are dealing with the same target host
|
||||||
target = reduce(lambda x, y: x == y, map(lambda x: urlparse.urlparse(x).netloc.split(':')[0], [url, conf.url]))
|
target = reduce(lambda x, y: x == y, map(lambda x: urlparse.urlparse(x).netloc.split(':')[0], [url, conf.url]))
|
||||||
if target:
|
|
||||||
|
if conf.scope:
|
||||||
|
if not re.search(conf.scope, url, re.I):
|
||||||
|
continue
|
||||||
|
elif not target:
|
||||||
|
continue
|
||||||
|
|
||||||
kb.locks.outputs.acquire()
|
kb.locks.outputs.acquire()
|
||||||
threadData.shared.deeper.add(url)
|
threadData.shared.deeper.add(url)
|
||||||
if re.search(r"(.*?)\?(.+)", url):
|
if re.search(r"(.*?)\?(.+)", url):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user