代码拉取完成,页面将自动刷新
from __future__ import print_function
from sys import platform as _platform
# Script Name : password_cracker.py
# Author : Craig Richards
# Created : 20 May 2013
# Last Modified :
# Version : 1.0
# Modifications :
# Description : Old school password cracker using python
# Check the current operating system to import the correct version of crypt
if _platform in ["linux", "linux2", "darwin"]: # darwin is _platform name for Mac OS X
import crypt # Import the module
elif _platform == "win32":
# Windows
try:
import fcrypt # Try importing the fcrypt module
except ImportError:
print('Please install fcrypt if you are on Windows')
def testPass(cryptPass): # Start the function
salt = cryptPass[0:2]
dictFile = open('dictionary.txt', 'r') # Open the dictionary file
for word in dictFile.readlines(): # Scan through the file
word = word.strip('\n')
cryptWord = crypt.crypt(word, salt) # Check for password in the file
if (cryptWord == cryptPass):
print("[+] Found Password: " + word + "\n")
return
print("[-] Password Not Found.\n")
return
def main():
passFile = open('passwords.txt') # Open the password file
for line in passFile.readlines(): # Read through the file
if ":" in line:
user = line.split(':')[0]
cryptPass = line.split(':')[1].strip(' ') # Prepare the user name etc
print("[*] Cracking Password For: " + user)
testPass(cryptPass) # Call it to crack the users password
if __name__ == "__main__":
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。