update
This commit is contained in:
parent
320562fd7f
commit
d911779d65
38
rar_crack.py
Normal file
38
rar_crack.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import rarfile
|
||||||
|
import itertools
|
||||||
|
import string
|
||||||
|
|
||||||
|
# pip install rarfile
|
||||||
|
# 设置RAR文件的路径
|
||||||
|
rar_file_path = r'E:\Downloads\meituan.rar'
|
||||||
|
|
||||||
|
# 设置密码字符集和最大长度
|
||||||
|
charset = string.ascii_letters + string.digits # 字母和数字
|
||||||
|
max_length = 10 # 设置最大密码长度
|
||||||
|
|
||||||
|
def extract_rar(password):
|
||||||
|
try:
|
||||||
|
with rarfile.RarFile(rar_file_path) as rf:
|
||||||
|
rf.extractall(pwd=password)
|
||||||
|
print(f'密码正确:{password}')
|
||||||
|
return True
|
||||||
|
except rarfile.BadRarFile:
|
||||||
|
return False
|
||||||
|
except rarfile.RarWrongPassword:
|
||||||
|
return False
|
||||||
|
|
||||||
|
# 暴力破解
|
||||||
|
def brute_force():
|
||||||
|
for length in range(1, max_length + 1):
|
||||||
|
for password in itertools.product(charset, repeat=length):
|
||||||
|
password = ''.join(password)
|
||||||
|
print(f'尝试密码:{password}')
|
||||||
|
if extract_rar(password):
|
||||||
|
return password
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
found_password = brute_force()
|
||||||
|
if found_password:
|
||||||
|
print(f'找到密码:{found_password}')
|
||||||
|
else:
|
||||||
|
print('未能找到密码')
|
0
美团代付源码-支持多模板 全开源-多种支付通道/.env
Normal file
0
美团代付源码-支持多模板 全开源-多种支付通道/.env
Normal file
Loading…
Reference in New Issue
Block a user