diff --git a/lib/core/target.py b/lib/core/target.py index c43666545..f3de02425 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -133,24 +133,28 @@ def findPageForms(): count = 1 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 - message = "(#%d) Do you want to test form '%s' (%s, %s%s) [Y/n] " % (count, form.name, method, url, ", %s" % repr(data) if data else "") + if form.name is None: + name = "" + else: + name = " '%s'" % form.name + + message = "[#%d] Do you want to test form%s (%s, %s%s) [Y/n] " % (count, name, method, url, ", %s" % repr(data) if data else "") test = readInput(message, default="Y") if not test or test[0] in ("y", "Y"): if method == HTTPMETHOD.POST: - message = " Edit POST data [default: %s]: " % (data if data else "") + message = "Edit POST data [default: %s]: " % (data if data else "") test = readInput(message, default=data) elif method == HTTPMETHOD.GET: if url.find("?") > -1: firstPart = url[:url.find("?")] secondPart = url[url.find("?")+1:] - message = " Edit GET data [default: %s]: " % secondPart + message = "Edit GET data [default: %s]: " % secondPart test = readInput(message, default=secondPart) url = "%s?%s" % (firstPart, test)