Skip to content

Instantly share code, notes, and snippets.

@DmytroSokhach
Created July 13, 2018 19:55
Show Gist options
  • Save DmytroSokhach/b059d547feeb62dbb40f2317d76d0bcb to your computer and use it in GitHub Desktop.
Save DmytroSokhach/b059d547feeb62dbb40f2317d76d0bcb to your computer and use it in GitHub Desktop.
Looks like account.arena.net 4 digit code possible combinations are numbers from 1023 up to 9876 which do not have reapeating characters
import http.client
import json
import datetime
from multiprocessing.dummy import Pool as ThreadPool
def performGetRequest(path):
connection = http.client.HTTPSConnection("account.arena.net")
headers = {
'Cache-Control': 'no-cache',
'Referer': 'https://account.arena.net/register',
'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
}
connection.request('GET', path, None, headers)
response = connection.getresponse()
r = response.read().decode('utf8', errors='ignore')
return r
emailPrefix = 'sokhach'
emailSuffix = '%40gmail.com'
name = 'sokhach'
pool = ThreadPool(100)
indexes = range(10000, 30100)
found = False
count = 0
def process(index):
global found
global count
#if found: return
count += 1
jsDate = int((datetime.datetime.utcnow() - datetime.datetime(1970,1,1,0,0,0)).total_seconds()*1000)
response = performGetRequest("/ws/username?_t=%d&email=%s%s%s&displayname=%s" % (jsDate, emailPrefix, index, emailSuffix, name))
parsed = json.loads(response)
code = parsed['suffix']
#print("%s - %s (%s)\n" % (code, index, count))
#print("%s\n" % (code))
# if code == "7777":
# found = True
return code
def f2(seq):
# order preserving
checked = []
for e in seq:
if e not in checked:
checked.append(e)
return checked
fullRes = pool.map(process, indexes)
distinctRes = f2(fullRes)
distinctRes.sort()
print(distinctRes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment