From c25c017c08af8765a4597413c8e3d148c6826214 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 15 Nov 2010 11:50:33 +0000 Subject: [PATCH] cosmetics regarding --forms --- lib/controller/controller.py | 6 +++++- lib/core/option.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 73a24ef67..aadd5fc9b 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -140,7 +140,11 @@ def start(): if conf.multipleTargets: hostCount += 1 - message = "%s %d:\n%s %s" % ("form" if conf.forms else "url", hostCount, conf.method or HTTPMETHOD.GET, targetUrl) + if conf.forms: + name = kb.formNames[(targetUrl, targetMethod, targetData, targetCookie)] + message = "[#%d] %s:\n%s %s" % (hostCount, "form%s" % (" '%s'" % name if name else ""), conf.method or HTTPMETHOD.GET, targetUrl) + else: + message = "%s %d:\n%s %s" % ("url", hostCount, conf.method or HTTPMETHOD.GET, targetUrl) if conf.cookie: message += "\nCookie: %s" % conf.cookie diff --git a/lib/core/option.py b/lib/core/option.py index 3afd6ac39..c81db8732 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -361,7 +361,9 @@ def __findPageForms(): method = request.get_method() data = request.get_data() if request.has_data() else None - kb.targetUrls.add((url, method, data, conf.cookie)) + target = (url, method, data, conf.cookie) + kb.targetUrls.add(target) + kb.formNames[target] = form.name def __setMetasploit(): if not conf.osPwn and not conf.osSmb and not conf.osBof: @@ -1093,6 +1095,7 @@ def __setKnowledgeBaseAttributes(): kb.docRoot = None kb.dynamicMarkings = [] kb.errorTest = None + kb.formNames = advancedDict() kb.headersCount = 0 kb.headersFp = {} kb.hintValue = None