Skip to content

Commit 5cc36b4

Browse files
committed
Minor improvement for crawling
1 parent d72660e commit 5cc36b4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.10.0"
21+
VERSION = "1.3.10.1"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/utils/crawler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from lib.core.common import checkSameHost
1616
from lib.core.common import clearConsoleLine
1717
from lib.core.common import dataToStdout
18+
from lib.core.common import extractRegexResult
1819
from lib.core.common import findPageForms
1920
from lib.core.common import getSafeExString
2021
from lib.core.common import openFile
@@ -92,7 +93,7 @@ def crawlThread():
9293
soup = BeautifulSoup(content)
9394
tags = soup('a')
9495

95-
tags += re.finditer(r'(?i)<a[^>]+href=["\'](?P<href>[^>"\']+)', content)
96+
tags += re.finditer(r'(?i)\b(href|src)=["\'](?P<href>[^>"\']+)', content)
9697

9798
for tag in tags:
9899
href = tag.get("href") if hasattr(tag, "get") else tag.group("href")
@@ -111,7 +112,7 @@ def crawlThread():
111112
elif not _:
112113
continue
113114

114-
if url.split('.')[-1].lower() not in CRAWL_EXCLUDE_EXTENSIONS:
115+
if (extractRegexResult(r"\A[^?]+\.(?P<result>\w+)(\?|\Z)", url) or "").lower() not in CRAWL_EXCLUDE_EXTENSIONS:
115116
with kb.locks.value:
116117
threadData.shared.deeper.add(url)
117118
if re.search(r"(.*?)\?(.+)", url):

0 commit comments

Comments
 (0)