mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 02:53:46 +03:00
33 lines
723 B
Python
33 lines
723 B
Python
#!/usr/bin/env python2
|
|
|
|
"""
|
|
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
|
See the file 'LICENSE' for copying permission
|
|
"""
|
|
|
|
from lib.core.enums import PRIORITY
|
|
from random import sample
|
|
__priority__ = PRIORITY.NORMAL
|
|
|
|
def dependencies():
|
|
pass
|
|
|
|
def randomIP():
|
|
numbers = []
|
|
|
|
while not numbers or numbers[0] in (10, 172, 192):
|
|
numbers = sample(xrange(1, 255), 4)
|
|
|
|
return '.'.join(str(_) for _ in numbers)
|
|
|
|
def tamper(payload, **kwargs):
|
|
"""
|
|
Append a fake HTTP header 'X-Forwarded-For'
|
|
"""
|
|
|
|
headers = kwargs.get("headers", {})
|
|
headers["X-Forwarded-For"] = randomIP()
|
|
headers["X-Client-Ip"] = randomIP()
|
|
headers["X-Real-Ip"] = randomIP()
|
|
return payload
|