mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Add random X-Forwarded-For to bypass IP Ban.
This commit is contained in:
parent
69701ba08c
commit
d34a57041e
40
tamper/randomfakeproxy.py
Normal file
40
tamper/randomfakeproxy.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.enums import PRIORITY
|
||||
from random import randrange
|
||||
__priority__ = PRIORITY.NORMAL
|
||||
|
||||
def dependencies():
|
||||
pass
|
||||
|
||||
def generateIP():
|
||||
blockOne = randrange(0, 255, 1)
|
||||
blockTwo = randrange(0, 255, 1)
|
||||
blockThree = randrange(0, 255, 1)
|
||||
blockFour = randrange(0, 255, 1)
|
||||
if blockOne == 10:
|
||||
return generateIP()
|
||||
elif blockOne == 172:
|
||||
return generateIP()
|
||||
elif blockOne == 192:
|
||||
return generateIP()
|
||||
else:
|
||||
return str(blockOne) + '.' + str(blockTwo) + '.' + str(blockThree) + '.' + str(blockFour)
|
||||
|
||||
def tamper(payload, **kwargs):
|
||||
"""
|
||||
Append a HTTP Request Parameter to bypass
|
||||
WAF (usually application based ) Ban
|
||||
protection bypass.
|
||||
|
||||
Mehmet INCE
|
||||
"""
|
||||
|
||||
headers = kwargs.get("headers", {})
|
||||
headers["X-Forwarded-For"] = generateIP()
|
||||
return payload
|
Loading…
Reference in New Issue
Block a user