Password Cracking
hash-identifier
- Any hash with
32
characters isMD5
hash online websites
findmyhash
Specifying the hash algorithm MD5
, attempt to crack the given hash -h 098f6bcd4621d373cade4e832627b4f6
:
Hashcat
example hashes
show delete found password
To show an existing cracked password use --show
flag in the end like
You can disable potfile support completely by using --potfile-disable
Mask Based Attack
Setup Mask
Refs
- https://hashcat.net/wiki/doku.php?id=mask_attack
- https://www.4armed.com/blog/perform-mask-attack-hashcat/
Increment Mode
In order to limit the increment within a specified range use --increment-min
and increment-max
options
Hashcat Mask Files
Let us consider the following scenario for creating a password masking attack:
- Length between five and eight characters
- Always starts with a capital letter
- Always ends with a number
- The characters in the middle are either lower or upper case
For a single entry in a mask file, the following structure is used:
It's important to highlight that the charset parameters are optional. So it's possible to create entries in the following format:
To meet the previous scenario, we can create a mask file containing the following:
Mask files have the file extension of .hcmask
and can be used from the command line like below:
Dictionary Attack
Refs:
- https://null-byte.wonderhowto.com/how-to/hack-like-pro-crack-passwords-part-3-using-hashcat-0156543/
-m
1800 designates the type of hash we are cracking (SHA-512)
-a 0
designates a dictionary attack
hash.lst
is our input file of hashes
wordlist.txt
is the absolute path to our wordlist for this dictionary attack
MD5
- Any hash with
32
characters isMD5
HMAC
HMAC is a keyed hash (authenticated hash) scheme which ensures that a specific hash value can only be generated if the entity possess a secret key. This scheme can be used to turn any existing hash function into an authenticated hash function which can be then used to check the authenticity of the message in addition to its integrity. HMAC-SHA1 was widely used in online banking security, HTTPS, VPN connections in addition to verify the integrity of the files/binaries. In essence, it is mostly used to protect the data in transit over insecure mediums.
A plain-text string and corresponding HMAC-SHA1 digest is provided in digest.txt file. The key used to generate the HMAC-SHA1 is either taken from a key dictionary or by using the key policy. The digest.txt
file and the dictionary file password-seclists.txt
is present in the user's home directory.
Objective: Recover the secret key.
150 HMAC-SHA1 (key = $pass) c898896f3f70f61bc3fb19bef222aa860e5ea717:1234
from example hashes
CRC32
11500 CRC32 5 c762de4a:00000000
from example hashes
SHA1
NTLM
MD5Crypt
Bcrypt
Bcrypt
is a popular 184-bit password hashing function designed by Niels Provos and David Mazières in 1999. It is based on blowfish
cipher. It is default password hashing algorithm for OpenBSD and other OSes like SUSE Linux.
This input format is not compatible to Hashcat. So, modify it
Wordlists
Generate a custom wordlist
CeWL
is a ruby app which spiders a given url to a specified depth, optionally following external links, and returns a list of words which can then be used for password crackers such as John the Ripper.
Refer : https://tools.kali.org/password-attacks/cewl
Scan to a depth of 2 -d 2
and use a minimum word length of 5 -m 5
, save the words to a file -w docswords.txt
, targeting the given URL (https://example.com):
john the ripper
John HASH cracking using dictionary
Other hash formats supported by John the Ripper: http://pentestmonkey.net/cheat-sheet/john-the-ripper-hash-formats
john pot file
How to clear crakced hash from database
As you can see in the docs http://www.openwall.com/john/doc/, John (and almost any good hash cracker) will store the
cracked hashes in some sort of file/db.
This is for performance, this programs will check for already cracked hashes preventing them to spend cpu/gpu time.
In the case of John, is located at: $JOHN/john.pot
($JOHN
path depends on the install). You can view the previously
cracked hashes in the terminal with the command: john --show passwd
Protected Files
RAR
PKZIP
We have to use JTR because at the time of writing this document, PKZIP is not supported by hashcat
MS word .docx
MS Office 2013
Using Hashcat
MS word .doc
MS Office 1997-2003
Using Hashcat