Implementation of an Issue #147

This commit is contained in:
Miroslav Stampar 2012-08-15 16:37:18 +02:00
parent 74ee0ce78a
commit f358ab2e73
4 changed files with 10 additions and 1 deletions

View File

@ -237,7 +237,7 @@ def start():
return True return True
if conf.url and not any([conf.forms, conf.crawlDepth]): if conf.url and not any([conf.forms, conf.crawlDepth]):
kb.targetUrls.add(( conf.url, conf.method, conf.data, conf.cookie )) kb.targetUrls.add((conf.url, conf.method, conf.data, conf.cookie))
if conf.configFile and not kb.targetUrls: if conf.configFile and not kb.targetUrls:
errMsg = "you did not edit the configuration file properly, set " errMsg = "you did not edit the configuration file properly, set "

View File

@ -1029,6 +1029,8 @@ def parseTargetUrl():
if not conf.url: if not conf.url:
return return
originalUrl = conf.url
if re.search("\[.+\]", conf.url) and not socket.has_ipv6: if re.search("\[.+\]", conf.url) and not socket.has_ipv6:
errMsg = "IPv6 addressing is not supported " errMsg = "IPv6 addressing is not supported "
errMsg += "on this platform" errMsg += "on this platform"
@ -1091,6 +1093,9 @@ def parseTargetUrl():
conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.HOST, conf.httpHeaders) conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.HOST, conf.httpHeaders)
conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url))) conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url)))
if originalUrl != conf.url:
kb.originalUrls[conf.url] = originalUrl
def expandAsteriskForColumns(expression): def expandAsteriskForColumns(expression):
""" """
If the user provided an asterisk rather than the column(s) If the user provided an asterisk rather than the column(s)

View File

@ -1519,6 +1519,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.originalCode = None kb.originalCode = None
kb.originalPage = None kb.originalPage = None
kb.originalTimeDelay = None kb.originalTimeDelay = None
kb.originalUrls = dict()
# Back-end DBMS underlying operating system fingerprint via banner (-b) # Back-end DBMS underlying operating system fingerprint via banner (-b)
# parsing # parsing

View File

@ -398,6 +398,9 @@ def __createTargetDirs():
conf.outputPath = tempDir conf.outputPath = tempDir
with open(os.path.join(conf.outputPath, "target.txt"), "w+") as f:
f.write(kb.originalUrls.get(conf.url) or conf.url or conf.hostname)
__createDumpDir() __createDumpDir()
__createFilesDir() __createFilesDir()
__configureDumper() __configureDumper()