Fix --forms with --second-url to choose correct page

This commit is contained in:
Mariusz Skoneczko 2019-10-08 15:30:45 +11:00
parent aed137ad80
commit 0766f15ab3

View File

@ -462,12 +462,16 @@ def _findPageForms():
if conf.url and not checkConnection():
return
# workaround for second url to get the injection page rather than result page
secondUrl = conf.secondUrl
conf.secondUrl = None
found = False
infoMsg = "searching for forms"
logger.info(infoMsg)
if not any((conf.bulkFile, conf.googleDork, conf.sitemapUrl)):
page, _, _ = Request.queryPage(content=True)
page, _, _ = Request.getPage()
if findPageForms(page, conf.url, True, True):
found = True
else:
@ -497,6 +501,9 @@ def _findPageForms():
errMsg = "problem occurred while searching for forms at '%s' ('%s')" % (target, getSafeExString(ex))
logger.error(errMsg)
# restore workaround
conf.secondUrl = secondUrl
if not found:
warnMsg = "no forms found"
logger.warn(warnMsg)