diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 33cd6a179..a07b3d0ba 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -221,7 +221,7 @@ def start(): if not test or test[0] in ("y", "Y"): if conf.method == HTTPMETHOD.POST: - message = "Edit POST data [default: %s]%s: " % (urlencode(conf.data) if conf.data else "", " (Warning: blank fields detected)" if conf.data and extractRegexResult(EMPTY_FORM_FIELDS_REGEX, conf.data) else "") + message = "Edit POST data [default: %s]%s: " % (urlencode(conf.data) if conf.data else "None", " (Warning: blank fields detected)" if conf.data and extractRegexResult(EMPTY_FORM_FIELDS_REGEX, conf.data) else "") conf.data = readInput(message, default=conf.data) if extractRegexResult(EMPTY_FORM_FIELDS_REGEX, conf.data): message = "do you want to fill blank fields with random values? [Y/n] " diff --git a/lib/core/option.py b/lib/core/option.py index 30aaaec2a..f0153899e 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -464,6 +464,10 @@ def __findPageForms(): url = urldecode(request.get_full_url(), kb.pageEncoding) method = request.get_method() data = urldecode(request.get_data(), kb.pageEncoding) if request.has_data() else None + if not data and method and method.upper() == HTTPMETHOD.POST: + debugMsg = "invalid POST form with blank data detected" + logger.debug(debugMsg) + continue target = (url, method, data, conf.cookie) kb.targetUrls.add(target) kb.formNames.append(target)