Skip to content

Instantly share code, notes, and snippets.

@iam-py-test
Last active November 19, 2022 22:08
Show Gist options
  • Save iam-py-test/8b5442bfd91e1d82fcfcb14509d35ef0 to your computer and use it in GitHub Desktop.
Save iam-py-test/8b5442bfd91e1d82fcfcb14509d35ef0 to your computer and use it in GitHub Desktop.
Check for redirects with different referers
import os,sys
import requests
import hashlib
url = input("URL: ")
refs = open("refs.txt",encoding="UTF-8").read().split("\n") # safe to refs.txt
for ref in refs:
try:
r = requests.get(url,headers={"Referer":ref})
print("Referer {}: {} --> {} ({})".format(ref,url,r.url,hashlib.md5(r.content).hexdigest()))
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment