Skip to content

Commit 8ca4cff

Browse files
committed
Minor refactoring
1 parent b08e4ae commit 8ca4cff

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

lib/controller/checks.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,6 @@ def checkWaf():
13791379
pushValue(kb.resendPostOnRedirect)
13801380
pushValue(conf.timeout)
13811381

1382-
kb.identYwaf = True
13831382
kb.redirectChoice = REDIRECTION.YES
13841383
kb.resendPostOnRedirect = False
13851384
conf.timeout = IDS_WAF_CHECK_TIMEOUT
@@ -1389,7 +1388,6 @@ def checkWaf():
13891388
except SqlmapConnectionException:
13901389
retVal = True
13911390
finally:
1392-
kb.identYwaf = False
13931391
kb.matchRatio = None
13941392

13951393
conf.timeout = popValue()

lib/core/option.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,7 +1886,6 @@ def _setKnowledgeBaseAttributes(flushAll=True):
18861886
kb.hintValue = None
18871887
kb.htmlFp = []
18881888
kb.httpErrorCodes = {}
1889-
kb.identYwaf = False
18901889
kb.inferenceMode = False
18911890
kb.ignoreCasted = None
18921891
kb.ignoreNotFound = False

lib/core/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.149"
21+
VERSION = "1.3.5.150"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
@@ -102,6 +102,9 @@
102102
# Servers known to cause issue with pre-connection mechanism (because of lack of multi-threaded support)
103103
PRECONNECT_INCOMPATIBLE_SERVERS = ("SimpleHTTP", "BaseHTTP")
104104

105+
# Identify WAF/IPS inside limited number of responses (Note: for optimization purposes)
106+
IDENTYWAF_PARSE_LIMIT = 10
107+
105108
# Maximum sleep time in "Murphy" (testing) mode
106109
MAX_MURPHY_SLEEP_TIME = 3
107110

lib/request/basic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from lib.core.settings import BLOCKED_IP_REGEX
4242
from lib.core.settings import DEFAULT_COOKIE_DELIMITER
4343
from lib.core.settings import EVENTVALIDATION_REGEX
44+
from lib.core.settings import IDENTYWAF_PARSE_LIMIT
4445
from lib.core.settings import MAX_CONNECTION_TOTAL_SIZE
4546
from lib.core.settings import META_CHARSET_REGEX
4647
from lib.core.settings import PARSE_HEADERS_LIMIT
@@ -385,7 +386,7 @@ def processResponse(page, responseHeaders, code=None, status=None):
385386
if msg:
386387
logger.warning("parsed DBMS error message: '%s'" % msg.rstrip('.'))
387388

388-
if kb.identYwaf:
389+
if kb.processResponseCounter < IDENTYWAF_PARSE_LIMIT:
389390
rawResponse = "%s %s %s\n%s\n%s" % (_http_client.HTTPConnection._http_vsn_str, code or "", status or "", getUnicode("".join(responseHeaders.headers if responseHeaders else [])), page)
390391

391392
identYwaf.non_blind.clear()

0 commit comments

Comments
 (0)