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

Skip to content

Commit 01f4b76

Browse files
committed
Minor update for the Issue #2
1 parent 7143e61 commit 01f4b76

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/core/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,8 @@
603603
# Reference: http://www.cookiecentral.com/faq/#3.5
604604
NETSCAPE_FORMAT_HEADER_COOKIES = "# Netscape HTTP Cookie File."
605605

606-
# Prefixes used for automatic recognition of parameters carrying CSRF protection tokens
607-
CSRF_TOKEN_PARAMETER_PREFIXES = ("csrf", "xsrf")
606+
# Infixes used for automatic recognition of parameters carrying CSRF protection tokens
607+
CSRF_TOKEN_PARAMETER_INFIXES = ("csrf", "xsrf")
608608

609609
# Prefixes used in brute force search for web server document root
610610
BRUTE_DOC_ROOT_PREFIXES = {

lib/core/target.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from lib.core.option import _setKnowledgeBaseAttributes
4444
from lib.core.option import _setAuthCred
4545
from lib.core.settings import ASTERISK_MARKER
46-
from lib.core.settings import CSRF_TOKEN_PARAMETER_PREFIXES
46+
from lib.core.settings import CSRF_TOKEN_PARAMETER_INFIXES
4747
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
4848
from lib.core.settings import DEFAULT_GET_POST_DELIMITER
4949
from lib.core.settings import HOST_ALIASES
@@ -353,7 +353,7 @@ def process(match, repl):
353353
else:
354354
for place in (PLACE.GET, PLACE.POST):
355355
for parameter in conf.paramDict.get(place, {}):
356-
if any(parameter.lower().startswith(_) for _ in CSRF_TOKEN_PARAMETER_PREFIXES):
356+
if any(parameter.lower().count(_) for _ in CSRF_TOKEN_PARAMETER_INFIXES):
357357
message = "%s parameter '%s' appears to hold CSRF protection token. " % (place, parameter)
358358
message += "Do you want sqlmap to automatically update it in further requests? [y/N] "
359359
test = readInput(message, default="N")

0 commit comments

Comments
 (0)