Skip to content

Instantly share code, notes, and snippets.

@vesche
Created June 23, 2019 19:15
Show Gist options
  • Save vesche/6d473958496d46384269b6f23e561d5c to your computer and use it in GitHub Desktop.
Save vesche/6d473958496d46384269b6f23e561d5c to your computer and use it in GitHub Desktop.
gctf1.py
import requests
def get_new_message(message):
message = message.lower()
blindvalues = [
'10', '120', '140', '1450', '150', '1240', '12450',
'1250', '240', '2450', '130', '1230', '1340', '13450',
'1350', '12340', '123450', '12350', '2340', '23450', '1360',
'12360', '24560', '13460', '134560', '13560',
]
blindmap = {}
for i in range(len(blindvalues)):
blindmap[i + 97] = blindvalues[i]
new_message = ''
for i in message:
new_message += blindmap[ord(i)]
return new_message
def post_message(new_message):
url = 'https://bnv.web.ctfcompetition.com/api/search'
data = requests.post(url, json={'message':new_message})
# print(data.headers, data.status_code)
return data.json()
cities = ['Zurich', 'Bangalore', 'Paris']
for city in cities:
new_message = get_new_message(city)
result = post_message(new_message)
print(result)
#attempt = ["'", "%27", '"', '%22', '#', '%23', ';', '%3B', ')']
#for i in attempt:
# print('=====')
# print(i)
# print(post_message(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment