Last active
October 8, 2018 09:58
-
-
Save Ge0rg3/a966b1d67ec0e75ddf9a2b26dd8047f7 to your computer and use it in GitHub Desktop.
Written for my CSAW Red 2018 Clicker Write-up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests as rq | |
url = "http://web.chal.csaw.io:10106/" | |
def register(userpass): | |
if len(userpass) < 8: | |
return "Please enter at least 8 characters." | |
details = { | |
"username":userpass, | |
"password":userpass, | |
} | |
req = rq.post(url+"/user/register", json=details) | |
if req.json()['status'] == "error": | |
return "Username already taken." | |
authorization = req.json()['Authorization'] | |
uuid = req.json()['uuid'] | |
return "Logged in as "+userpass+"." | |
def login(userpass): | |
details = { | |
"username":userpass, | |
"password":userpass | |
} | |
req = rq.post(url+"/user/login", json=details) | |
if req.json()['status'] == "error": | |
return "Account does not exist/Password invalid." | |
authorization = {'Authorization':req.json()['Authorization']} | |
return "Logged in as "+userpass+"." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment