sqlmap/tamper/varnish.py

34 lines
963 B
Python
Raw Permalink Normal View History

2019-05-08 13:47:52 +03:00
#!/usr/bin/env python
2014-07-10 10:49:20 +04:00
"""
2024-01-04 01:11:52 +03:00
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
2017-10-11 15:50:46 +03:00
See the file 'LICENSE' for copying permission
2014-07-10 10:49:20 +04:00
"""
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def dependencies():
pass
def tamper(payload, **kwargs):
"""
2018-07-31 03:18:33 +03:00
Appends a HTTP header 'X-originating-IP' to bypass Varnish Firewall
2014-07-10 10:52:32 +04:00
2018-07-31 03:18:33 +03:00
Reference:
2019-07-11 11:56:38 +03:00
* https://web.archive.org/web/20160815052159/http://community.hpe.com/t5/Protect-Your-Assets/Bypassing-web-application-firewalls-using-HTTP-headers/ba-p/6418366
2014-07-10 10:52:32 +04:00
2018-07-31 03:18:33 +03:00
Notes:
2014-07-10 10:52:32 +04:00
Examples:
>> X-forwarded-for: TARGET_CACHESERVER_IP (184.189.250.X)
>> X-remote-IP: TARGET_PROXY_IP (184.189.250.X)
>> X-originating-IP: TARGET_LOCAL_IP (127.0.0.1)
>> x-remote-addr: TARGET_INTERNALUSER_IP (192.168.1.X)
>> X-remote-IP: * or %00 or %0A
2014-07-10 10:49:20 +04:00
"""
headers = kwargs.get("headers", {})
headers["X-originating-IP"] = "127.0.0.1"
return payload