一、问题描述

在工作中遇到一个问题:测试目标网站安全性,发现目标网站的验证码采取前端更新方式,可暴力破解。但是在提交的时候是经过sha256加密的,所以,如果需要爆破的话首先得把字典里的每一行用sha256加密。就有了这篇文章。

二、Python代码实现

import hashlib

dic = open("dict.txt")

for password in dic.readlines():
    password = password.strip('\n')
    crpt_pass = hashlib.sha256(password).hexdigest()
    crypt_dict = file("crypt.txt",'a+')
    crypt_dict.write(crpt_pass+'\n')
    crypt_dict.close()

dic.close()

首先读取明文字典文件,然后加密,最后写入一个新的txt文本中。

使用Burpsuite可以完成爆破。

三、闲言碎语

验证码用过一次即销毁,服务端要做好判断。

 

相关文章:

  • 2022-02-26
  • 2022-12-23
  • 2021-08-25
  • 2022-02-21
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-07-31
相关资源
相似解决方案