Last active
June 9, 2021 07:58
-
-
Save tarnacious/4335782106e6c9c4b905bc609016aa98 to your computer and use it in GitHub Desktop.
Check for a desturbance in the CORS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from datetime import datetime | |
def check(domain, referer): | |
url = 'https://' + domain + '/mesh/v1/category?location=com' | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0', | |
'Accept': '*/*', | |
'Accept-Language': 'en-US,en;q=0.5', | |
'Access-Control-Request-Method': 'GET', | |
'Access-Control-Request-Headers': 'content-type,for-domain', | |
'Referer': 'https://' + referer + '/shop', | |
'Origin': 'http://' + referer, | |
'Connection': 'keep-alive', | |
'Pragma': 'no-cache', | |
'Cache-Control': 'no-cache' | |
} | |
r = requests.options(url, headers=headers) | |
headers = r.headers['Access-Control-Allow-Headers'] | |
time = datetime.now() | |
print(domain + " " + str(time) + " " + headers) | |
check("apicdn.dev.mojoreads.com", "dev.mojoreads.de") | |
check("apicdn.staging.mojoreads.com", "staging.mojoreads.de") | |
check("apicdn.mojoreads.com", "mojoreads.de") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requests==2.25.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do | |
python check.py >> results 2>&1 | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment