Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48ac210

Browse files
committed
Using only once the dummy checkWaf payload
1 parent de06ae6 commit 48ac210

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

lib/controller/checks.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
from lib.core.common import getSafeExString
2626
from lib.core.common import getSortedInjectionTests
2727
from lib.core.common import getUnicode
28+
from lib.core.common import hashDBRetrieve
29+
from lib.core.common import hashDBWrite
2830
from lib.core.common import intersect
2931
from lib.core.common import listToStrValue
3032
from lib.core.common import parseFilePaths
@@ -48,6 +50,7 @@
4850
from lib.core.decorators import cachedmethod
4951
from lib.core.dicts import FROM_DUMMY_TABLE
5052
from lib.core.enums import DBMS
53+
from lib.core.enums import HASHDB_KEYS
5154
from lib.core.enums import HEURISTIC_TEST
5255
from lib.core.enums import HTTP_HEADER
5356
from lib.core.enums import HTTPMETHOD
@@ -1155,6 +1158,14 @@ def checkWaf():
11551158
if any((conf.string, conf.notString, conf.regexp, conf.dummy, conf.offline, conf.skipWaf)):
11561159
return None
11571160

1161+
_ = hashDBRetrieve(HASHDB_KEYS.CHECK_WAF_RESULT, True)
1162+
if _ is not None:
1163+
if _:
1164+
warnMsg = "previous heuristics detected that the target "
1165+
warnMsg += "is protected by some kind of WAF/IPS/IDS"
1166+
logger.critical(warnMsg)
1167+
return _
1168+
11581169
infoMsg = "checking if the target is protected by "
11591170
infoMsg += "some kind of WAF/IPS/IDS"
11601171
logger.info(infoMsg)
@@ -1193,6 +1204,8 @@ def checkWaf():
11931204
logger.warning("dropping timeout to %d seconds (i.e. '--timeout=%d')" % (IDS_WAF_CHECK_TIMEOUT, IDS_WAF_CHECK_TIMEOUT))
11941205
conf.timeout = IDS_WAF_CHECK_TIMEOUT
11951206

1207+
hashDBWrite(HASHDB_KEYS.CHECK_WAF_RESULT, retVal, True)
1208+
11961209
return retVal
11971210

11981211
def identifyWaf():

lib/core/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ class OPTION_TYPE:
194194

195195
class HASHDB_KEYS:
196196
DBMS = "DBMS"
197+
CHECK_WAF_RESULT = "CHECK_WAF_RESULT"
197198
CONF_TMP_PATH = "CONF_TMP_PATH"
198199
KB_ABS_FILE_PATHS = "KB_ABS_FILE_PATHS"
199200
KB_BRUTE_COLUMNS = "KB_BRUTE_COLUMNS"

0 commit comments

Comments
 (0)