diff --git a/lib/core/convert.py b/lib/core/convert.py index 1ac4172bb..0989431f0 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -95,9 +95,9 @@ def urlencode(string, safe=":/?%&=", convall=False): return result if convall: - result = urllib.quote(string) + result = urllib.quote(string.encode("utf-8")) #Reference: http://old.nabble.com/Re:-Problem:-neither-urllib2.quote-nor-urllib.quote-encode-the--unicode-strings-arguments-p19823144.html else: - result = urllib.quote(string, safe) + result = urllib.quote(string.encode("utf-8"), safe) return result diff --git a/lib/parse/configfile.py b/lib/parse/configfile.py index f20fc0ef8..3d07d5543 100644 --- a/lib/parse/configfile.py +++ b/lib/parse/configfile.py @@ -21,12 +21,12 @@ You should have received a copy of the GNU General Public License along with sqlmap; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ +import codecs from ConfigParser import NoSectionError from ConfigParser import RawConfigParser from lib.core.common import checkFile -from lib.core.convert import utf8decode from lib.core.data import conf from lib.core.data import logger from lib.core.exception import sqlmapMissingMandatoryOptionException @@ -53,8 +53,6 @@ def configFileProxy(section, option, boolean=False, integer=False): value = False elif value in ("true", "True"): value = True - else: - value = utf8decode(value) if value: conf[option] = value @@ -79,7 +77,7 @@ def configFileParser(configFile): checkFile(configFile) config = RawConfigParser() - config.read(configFile) + config.readfp(codecs.open(configFile, "r", "UTF8")) if not config.has_section("Target"): raise NoSectionError, "Target in the configuration file is mandatory" diff --git a/sqlmap.conf b/sqlmap.conf index 8c2ccd57f..249266ba2 100644 --- a/sqlmap.conf +++ b/sqlmap.conf @@ -340,7 +340,7 @@ lastChar = 0 # SQL statement to be executed. # Example: SELECT 'foo', 'bar' -query = +query = INSERT INTO users VALUES (9, 'café', 'test') # Prompt for an interactive SQL shell. # Valid: True or False