From 366a3f9336b2a39af405270699f0afa616ce1b98 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 30 Aug 2018 15:21:46 +0200 Subject: [PATCH] Detect redirect from stdout --- extra/wafdetectify/wafdetectify.py | 4 +++- lib/core/settings.py | 2 +- txt/checksum.md5 | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extra/wafdetectify/wafdetectify.py b/extra/wafdetectify/wafdetectify.py index f0ebd8c60..e92775613 100644 --- a/extra/wafdetectify/wafdetectify.py +++ b/extra/wafdetectify/wafdetectify.py @@ -54,7 +54,7 @@ def get_page(get=None, url=None, host=None, data=None): return result def colorize(message): - if not subprocess.mswindows: + if not subprocess.mswindows and sys.stdout.isatty(): message = re.sub(r"\[(.)\]", lambda match: "[%s%s\033[00;49m]" % (LEVEL_COLORS[match.group(1)], match.group(1)), message) message = message.replace("@sqlmap", "\033[00;96m@sqlmap\033[00;49m") message = message.replace(NAME, "\033[00;93m%s\033[00;49m" % NAME) @@ -114,5 +114,7 @@ def main(): if not found: print colorize("[o] nothing found") + print + if __name__ == "__main__": main() diff --git a/lib/core/settings.py b/lib/core/settings.py index a016a8a57..54e7c282f 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.2.8.25" +VERSION = "1.2.8.26" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/txt/checksum.md5 b/txt/checksum.md5 index 8f078653c..9e42d80e7 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -22,7 +22,7 @@ e4805169a081b834ca51a60a150c7247 extra/shutils/newlines.py 1e5532ede194ac9c083891c2f02bca93 extra/sqlharvest/__init__.py b3e60ea4e18a65c48515d04aab28ff68 extra/sqlharvest/sqlharvest.py 1e5532ede194ac9c083891c2f02bca93 extra/wafdetectify/__init__.py -85ca5478dc2bd9db40772e52dad2f84a extra/wafdetectify/wafdetectify.py +5a5d4305e9dd22c3ba06b8587dad9db7 extra/wafdetectify/wafdetectify.py 3459c562a6abb9b4bdcc36925f751f3e lib/controller/action.py 7493c782345a60f6c00c9281d51a494e lib/controller/checks.py c414cecdb0472c92cf50ed5b01e4438c lib/controller/controller.py @@ -50,7 +50,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py 0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py a7db43859b61569b601b97f187dd31c5 lib/core/revision.py fcb74fcc9577523524659ec49e2e964b lib/core/session.py -13758369fddb4d7e791e989966908ee6 lib/core/settings.py +d30a78044622a9f97a2b62eec4c62e95 lib/core/settings.py dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py 815d1cf27f0f8738d81531e73149867d lib/core/target.py