import subprocess def start(password_file, dictionary_file): try: command=['hashcat','-m','1400','-a','0',password_file,dictionary_file] result=subprocess.run(command,capture_output=True, text=True) decrypted_password = result.stdout.strip().split(":")[1] return decrypted_password except Exception as e: print(f"解密过程中发生错误:{e}") return None为什么不运行
时间: 2024-04-15 12:27:57 浏览: 131
Kaggle比赛系列:(6)Sklearn应用:data-science-london-scikit-learn
抱歉,我在之前的回答中不小心将代码作为注释处理了。这是我重新格式化后的代码,你可以尝试运行它:
```python
import subprocess
def start(password_file, dictionary_file):
try:
command = ['hashcat', '-m', '1400', '-a', '0', password_file, dictionary_file]
result = subprocess.run(command, capture_output=True, text=True)
decrypted_password = result.stdout.strip().split(":")[1]
return decrypted_password
except Exception as e:
print(f"解密过程中发生错误:{e}")
return None
```
请确保你已经正确安装了hashcat,并将正确的密码文件和字典文件路径传递给`start()`函数。如果你仍然遇到问题,请提供更多的错误信息,我将尽力帮助你解决。
阅读全文