Skip to content

Instantly share code, notes, and snippets.

@amalmurali47
Created April 26, 2020 11:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalmurali47/9d1fd86e8a6187b9ed6ac3a4e2b47295 to your computer and use it in GitHub Desktop.
Save amalmurali47/9d1fd86e8a6187b9ed6ac3a4e2b47295 to your computer and use it in GitHub Desktop.
Check which characters are converted by the web server
import re
import string
import requests
def check(c):
t = requests.get(f'https://challenge.intigriti.io/{c}').text
return re.match(r'404 - \'File "(.*?)" was.*\'', t).group(1)
chars = string.punctuation + string.ascii_letters
chars = re.sub(r'[#/%]', '', chars)
result = dict(zip(chars, re.findall(r'_..|.', check(chars))))
stripped = [c for c, m in result.items() if c != m]
print(stripped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment