File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ # Script Name	: password_cracker.py 
2+ # Author		: Craig Richards 
3+ # Created		: 20 May 2013 
4+ # Last Modified	: 
5+ # Version		: 1.0 
6+ 
7+ # Modifications	: 
8+ 
9+ # Description	: Old school password cracker using python 
10+ 
11+ import  crypt 	# Import the module 
12+ 
13+ def  testPass (cryptPass ):	# Start the function 
14+   salt  =  cryptPass [0 :2 ]
15+   dictFile = open ('dictionary.txt' ,'r' )	# Open the dictionary file 
16+   for  word  in  dictFile .readlines ():	# Scan through the file 
17+     word = word .strip ('\n ' )
18+     cryptWord = crypt .crypt (word ,salt )	# Check for password in the file 
19+     if  (cryptWord  ==  cryptPass ):
20+       print  "[+] Found Password: " + word + "\n " 
21+       return 
22+   print  "[-] Password Not Found.\n " 
23+   return 
24+ 
25+ def  main ():
26+   passFile  =  open ('passwords.txt' )		# Open the password file 
27+   for  line  in  passFile .readlines ():	# Read through the file 
28+     if  ":"  in  line :
29+       user = line .split (':' )[0 ]
30+       cryptPass  =  line .split (':' )[1 ].strip (' ' ) # Prepare the user name etc 
31+       print  "[*] Cracking Password For: " + user  
32+       testPass (cryptPass )				# Call it to crack the users password 
33+ 
34+ if  __name__  ==  "__main__" :
35+   main ()
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments