From 02d66db7e00134f31ddc285f239fb691a1b1babc Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 11 Jan 2019 23:00:28 +0100 Subject: [PATCH] New WAF script (SiteGuard) --- lib/core/settings.py | 2 +- txt/checksum.md5 | 7 ++++--- waf/anquanbao.py | 2 -- waf/siteguard.py | 21 +++++++++++++++++++++ waf/sitelock.py | 2 +- 5 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 waf/siteguard.py diff --git a/lib/core/settings.py b/lib/core/settings.py index 8872e8374..2703a06aa 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.3.1.42" +VERSION = "1.3.1.43" 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 b774dc306..9b4c2dfd3 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -49,7 +49,7 @@ fe370021c6bc99daf44b2bfc0d1effb3 lib/core/patch.py 9a7d68d5fa01561500423791f15cc676 lib/core/replication.py 3179d34f371e0295dd4604568fb30bcd lib/core/revision.py d6269c55789f78cf707e09a0f5b45443 lib/core/session.py -da97136510824fdec55455dde8c674c3 lib/core/settings.py +c6bb49602e081b6ad551053145b95f52 lib/core/settings.py a8a7501d1e6b21669b858a62e921d191 lib/core/shell.py 5dc606fdf0afefd4b305169c21ab2612 lib/core/subprocessng.py eec3080ba5baca44c6de4595f1c92a0d lib/core/target.py @@ -399,7 +399,7 @@ ca3ab78d6ed53b7f2c07ed2530d47efd udf/postgresql/windows/32/8.4/lib_postgresqlud d6f06b1463501392e7e578d511ffb4d8 waf/360.py 2d63c46bed78aec2966a363d5db800fd waf/aesecure.py b6bc83ae9ea69cf96e9389bde8250c7c waf/airlock.py -8dcba3e7509e87e7829f445299bd2d3b waf/anquanbao.py +34b8ec9f438d7daa56aa016e6c09fadb waf/anquanbao.py 7ab1a7cd51a02899592f4f755d36a02e waf/approach.py 425f2599f57ab81b4fff67e6b442cccc waf/armor.py 33b6e6793ed3add457d7c909ec599ad3 waf/asm.py @@ -451,7 +451,8 @@ d2d9718de217dd07d9e66b2e6ad61380 waf/safe3.py ac0728ddb7a15b46b0eabd78cd661f8c waf/secureiis.py ba37e1c37fa0e3688873f74183a9cb9c waf/senginx.py 2602a8baed4da643e606a379e4dc75db waf/shieldsecurity.py -24f1cc66625e58e4c91c0cb4364a2202 waf/sitelock.py +332f27cfa02abca513719851850c782e waf/siteguard.py +c842d298e61a87b32668c8402a0d87b5 waf/sitelock.py a840fcd2bb042694f9aab2859e7c9b30 waf/sonicwall.py 45683bfe7a428f47745416c727a789bd waf/sophos.py 4a11ba8e5f3995b35f5fc189b8c2692e waf/stackpath.py diff --git a/waf/anquanbao.py b/waf/anquanbao.py index c20934de7..51a1eb193 100644 --- a/waf/anquanbao.py +++ b/waf/anquanbao.py @@ -5,8 +5,6 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ -import re - from lib.core.settings import WAF_ATTACK_VECTORS __product__ = "Anquanbao Web Application Firewall (Anquanbao)" diff --git a/waf/siteguard.py b/waf/siteguard.py new file mode 100644 index 000000000..9a0498fa5 --- /dev/null +++ b/waf/siteguard.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +""" +Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/) +See the file 'LICENSE' for copying permission +""" + +from lib.core.settings import WAF_ATTACK_VECTORS + +__product__ = "SiteGuard (JP-Secure)" + +def detect(get_page): + retval = False + + for vector in WAF_ATTACK_VECTORS: + page, _, _ = get_page(get=vector) + retval = any(_ in (page or "") for _ in ("Powered by SiteGuard", "The server refuse to browse the page")) + if retval: + break + + return retval diff --git a/waf/sitelock.py b/waf/sitelock.py index 42cb0e768..09d611f15 100644 --- a/waf/sitelock.py +++ b/waf/sitelock.py @@ -15,7 +15,7 @@ def detect(get_page): for vector in WAF_ATTACK_VECTORS: page, _, _ = get_page(get=vector) - retval |= any(_ in (page or "") for _ in ("SiteLock Incident ID", '')) + retval = any(_ in (page or "") for _ in ("SiteLock Incident ID", '')) if retval: break