Skip to content

Instantly share code, notes, and snippets.

@tarnacious
Last active June 9, 2021 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarnacious/4335782106e6c9c4b905bc609016aa98 to your computer and use it in GitHub Desktop.
Save tarnacious/4335782106e6c9c4b905bc609016aa98 to your computer and use it in GitHub Desktop.
Check for a desturbance in the CORS
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")
requests==2.25.1
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