From c10b2825d7c75f49fbc3214112b33fe864c82537 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 15 Jul 2016 11:56:51 +0200 Subject: [PATCH] Patch for --os-shell against Windows/MySQL where resulting \r caused trouble --- lib/core/dump.py | 8 +++++++- lib/core/settings.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/core/dump.py b/lib/core/dump.py index 354f1e4c4..49f5f4a9c 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -119,9 +119,15 @@ class Dump(object): elif data is not None: _ = getUnicode(data) - if _ and _[-1] == '\n': + if _.endswith("\r\n"): + _ = _[:-2] + + elif _.endswith("\n"): _ = _[:-1] + if _.strip(' '): + _ = _.strip(' ') + if "\n" in _: self._write("%s:\n---\n%s\n---" % (header, _)) else: diff --git a/lib/core/settings.py b/lib/core/settings.py index c58747f55..c4c4f6898 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.7.24" +VERSION = "1.0.7.25" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")