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

Skip to content

Commit f358ab2

Browse files
committed
Implementation of an Issue #147
1 parent 74ee0ce commit f358ab2

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/controller/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def start():
237237
return True
238238

239239
if conf.url and not any([conf.forms, conf.crawlDepth]):
240-
kb.targetUrls.add(( conf.url, conf.method, conf.data, conf.cookie ))
240+
kb.targetUrls.add((conf.url, conf.method, conf.data, conf.cookie))
241241

242242
if conf.configFile and not kb.targetUrls:
243243
errMsg = "you did not edit the configuration file properly, set "

lib/core/common.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ def parseTargetUrl():
10291029
if not conf.url:
10301030
return
10311031

1032+
originalUrl = conf.url
1033+
10321034
if re.search("\[.+\]", conf.url) and not socket.has_ipv6:
10331035
errMsg = "IPv6 addressing is not supported "
10341036
errMsg += "on this platform"
@@ -1091,6 +1093,9 @@ def parseTargetUrl():
10911093
conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.HOST, conf.httpHeaders)
10921094
conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url)))
10931095

1096+
if originalUrl != conf.url:
1097+
kb.originalUrls[conf.url] = originalUrl
1098+
10941099
def expandAsteriskForColumns(expression):
10951100
"""
10961101
If the user provided an asterisk rather than the column(s)

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
15191519
kb.originalCode = None
15201520
kb.originalPage = None
15211521
kb.originalTimeDelay = None
1522+
kb.originalUrls = dict()
15221523

15231524
# Back-end DBMS underlying operating system fingerprint via banner (-b)
15241525
# parsing

lib/core/target.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ def __createTargetDirs():
398398

399399
conf.outputPath = tempDir
400400

401+
with open(os.path.join(conf.outputPath, "target.txt"), "w+") as f:
402+
f.write(kb.originalUrls.get(conf.url) or conf.url or conf.hostname)
403+
401404
__createDumpDir()
402405
__createFilesDir()
403406
__configureDumper()

0 commit comments

Comments
 (0)