#!/bin/sh #Demo 1 slide 3 #Adds user with name Brandon Aperocho useradd user01 passwd user01 password #Adds user with name Arjun Sharma useradd user02 passwd user02 123456 unshadow /etc/passwd /etc/shadow > passfile john passfile john -show passfile #Note that this usage of john start off by using a single then wordlist then incremental userdel user01 userdel user02 #============================================== #Demo 2 -single demo single ruleset starts at around line 420 #Adds user with name Brandon Aperocho useradd -c "Brandon Aperocho" user01 passwd user01 abrandon09090 # Add login info #chfn user01 #[enter] #Room number: 09090 #Work number: 3211234231 #Home number: 5677655678 #Other: nicetry #Adds user with name Arjun Sharma useradd -c "Arjun Sharma" user02 #chfn user02 #[enter] #Room number: 123 #Work number: 3211234231 #Home number: 5677655678 #Other: pass passwd user02 user02sharma123 unshadow /etc/passwd /etc/shadow > passfile john -single passfile john -show passfile userdel user01 userdel user02 #============================================== #Demo 3 -wordlist demo #add users unshadow /etc/passwd /etc/shadow > passfile john -wordlist=/usr/share/john/password.lst passfile #add users # Create wordlist with passwords, 1 password per line john -wordlist=./mywordlist.txt passfile #Change a password by capitalizing first letter and adding 1 #Change a password that contains "i" or "I" replace with 1 #Then show ruleset #vi customrules #[List.Rules:Easy] #cAz"[0-9]" #/i si1 #/I sI1 #l r #palindrome user password Password1 #cat customrules >> /etc/john/john.conf john -wordlist=./mywordlist.txt rules=Easy passfile john -show passfile #============================================== #Demo 4 -incremental demo; brute force using some of the modes #These passwords are set just so it does not take that much time to crack since it is brute forcing the passwords. #Observe progress by pressing any button other than 'q' or 'CRTL-C' useradd user11 passwd user11 mayli useradd user22 passwd user22 comely unshadow /etc/passwd /etc/shadow > passfile john -incremental=lower passfile john -show passfile userdel user11 userdel user12 #Suppose we have some passwords files already that have been cracked by john #We can create our own custom ruleset for the incremental mode to follow #This is useful for cracking passwords with similar password restrictions #E.g when users are restricted in password length and types of characters they can use john -make-charset=custom.chr passfile vi customrules.txt [Incremental:Easy] File=custom.chr MinLen=6 MaxLen=10 #CharCount=95 #CharCount makes John prioritize long simple passwords over short complicated one; typically want to use all characters available #Extra=!@#$ #Adds extra characters to check with cat customrules.txt >> /etc/john/john.conf john -incremental=Easy passfile1 #============================================== # With the existing wordlist and ruleset made, we can create a password dump of all passords from wordlist.txt with the ruleset. john -wordlist=./mywordlist.txt -rules=Wordlist -stdout > passfile1