mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-28 09:00:08 +03:00
Merge b1cd265deb
into a8c0722631
This commit is contained in:
commit
e431415500
30
tamper/randomsession.py
Normal file
30
tamper/randomsession.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
author: 3H34N
|
||||
"""
|
||||
import string
|
||||
import random
|
||||
from lib.core.enums import PRIORITY
|
||||
__priority__ = PRIORITY.NORMAL
|
||||
|
||||
def dependencies():
|
||||
pass
|
||||
|
||||
def randomsession():
|
||||
length = 32
|
||||
chars = string.ascii_letters.lower() + string.digits
|
||||
password = ''.join(random.choice(chars) for i in range(length))
|
||||
return "PHPSESSID="+password
|
||||
|
||||
def tamper(payload, **kwargs):
|
||||
"""
|
||||
Append a random session HTTP header 'PHPSESSID' to bypass
|
||||
WAF (usually application based) protection
|
||||
"""
|
||||
|
||||
headers = kwargs.get("headers", {})
|
||||
headers["Cookie"] = randomsession()
|
||||
return payload
|
Loading…
Reference in New Issue
Block a user