From ff310475c88926210382e8cd00ef963d7556b31e Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 15 Nov 2010 14:17:51 +0000 Subject: [PATCH] some reporting update for --forms --- lib/core/option.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 2346c5760..0fe951c91 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -362,15 +362,19 @@ def __findPageForms(): response, _ = Request.queryPage(response=True) forms = ParseResponse(response, backwards_compat=False) - for form in forms: - request = form.click() - url = request.get_full_url() - method = request.get_method() - data = request.get_data() if request.has_data() else None + if forms: + for form in forms: + request = form.click() + url = request.get_full_url() + method = request.get_method() + data = request.get_data() if request.has_data() else None - target = (url, method, data, conf.cookie) - kb.targetUrls.add(target) - kb.formNames[target] = form.name + target = (url, method, data, conf.cookie) + kb.targetUrls.add(target) + kb.formNames[target] = form.name + else: + errMsg = "there were no forms found at a given target url" + raise sqlmapGenericException, errMsg def __setMetasploit(): if not conf.osPwn and not conf.osSmb and not conf.osBof: