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

Skip to content

Commit 7143e61

Browse files
committed
Minor update
1 parent 32bcca0 commit 7143e61

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/core/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@
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")
608+
606609
# Prefixes used in brute force search for web server document root
607610
BRUTE_DOC_ROOT_PREFIXES = {
608611
OS.LINUX: ("/var/www", "/usr/local/apache", "/usr/local/apache2", "/usr/local/www/apache22", "/usr/local/www/apache24", "/usr/local/httpd", "/var/www/nginx-default", "/srv/www", "/var/www/%TARGET%", "/var/www/vhosts/%TARGET%", "/var/www/virtual/%TARGET%", "/var/www/clients/vhosts/%TARGET%", "/var/www/clients/virtual/%TARGET%"),

lib/core/target.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +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
4647
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
4748
from lib.core.settings import DEFAULT_GET_POST_DELIMITER
4849
from lib.core.settings import HOST_ALIASES
@@ -352,7 +353,7 @@ def process(match, repl):
352353
else:
353354
for place in (PLACE.GET, PLACE.POST):
354355
for parameter in conf.paramDict.get(place, {}):
355-
if parameter.lower().startswith("csrf"):
356+
if any(parameter.lower().startswith(_) for _ in CSRF_TOKEN_PARAMETER_PREFIXES):
356357
message = "%s parameter '%s' appears to hold CSRF protection token. " % (place, parameter)
357358
message += "Do you want sqlmap to automatically update it in further requests? [y/N] "
358359
test = readInput(message, default="N")

0 commit comments

Comments
 (0)