From 9ca7b3e20e2c1da22688e0822aa3363e13f4da11 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 25 Sep 2012 09:25:35 +0200 Subject: [PATCH] Implementation for an Issue #194 --- lib/controller/checks.py | 6 ++++++ lib/core/option.py | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index b5c9be321..0f0bec8f0 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -281,6 +281,12 @@ def checkSqlInjection(place, parameter, value): # Parse boundary's , and prefix = boundary.prefix if boundary.prefix else "" suffix = boundary.suffix if boundary.suffix else "" + + # Options --prefix/--suffix have a higher priority (if set by user) + prefix = conf.prefix if conf.prefix is not None else prefix + suffix = conf.suffix if conf.suffix is not None else suffix + comment = None if conf.suffix is not None else comment + ptype = boundary.ptype # If the previous injections succeeded, we know which prefix, diff --git a/lib/core/option.py b/lib/core/option.py index 87fbb9019..ffa99b2e4 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -958,15 +958,6 @@ def __setSafeUrl(): raise sqlmapSyntaxException, errMsg def __setPrefixSuffix(): - if conf.prefix is not None and conf.suffix is None: - errMsg = "you specified the payload prefix, but did not provide " - errMsg += "the payload suffix" - raise sqlmapSyntaxException, errMsg - elif conf.prefix is None and conf.suffix is not None: - errMsg = "you specified the payload suffix, but did not provide " - errMsg += "the payload prefix" - raise sqlmapSyntaxException, errMsg - if conf.prefix is not None and conf.suffix is not None: # Create a custom boundary object for user's supplied prefix # and suffix