Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a660828

Browse files
committed
Implementation of crawling results normalization
1 parent 2730043 commit a660828

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
19531953
kb.mergeCookies = None
19541954
kb.multipleCtrlC = False
19551955
kb.negativeLogic = False
1956+
kb.normalizeCrawlingChoice = None
19561957
kb.nullConnection = None
19571958
kb.oldMsf = None
19581959
kb.orderByColumns = None

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.38"
21+
VERSION = "1.3.10.39"
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,26 @@ def crawlThread():
195195
for url in threadData.shared.value:
196196
kb.targets.add((urldecode(url, kb.pageEncoding), None, None, None, None))
197197

198+
if kb.normalizeCrawlingChoice is None:
199+
message = "do you want to normalize "
200+
message += "crawling results [Y/n] "
201+
202+
kb.normalizeCrawlingChoice = readInput(message, default='Y', boolean=True)
203+
204+
if kb.normalizeCrawlingChoice:
205+
seen = set()
206+
results = OrderedSet()
207+
208+
for target in kb.targets:
209+
match = re.search(r"/[^/?]*\?.*\Z", target[0])
210+
if match:
211+
key = re.sub(r"=[^=&]*", "=", match.group(0))
212+
if key not in seen:
213+
results.add(target)
214+
seen.add(key)
215+
216+
kb.targets = results
217+
198218
storeResultsToFile(kb.targets)
199219

200220
def storeResultsToFile(results):

0 commit comments

Comments
 (0)