Word lists ,Crunch, John and Hash Cat - All Kali Word List Tools Explained.
Tags: linux, security, password, webdev
Published: 2024-01-25 22:30:00

##🔐 Overview Of Wordlists ,Crunch, John and Hash Cat - All Kali Word List Tools Explained.🔐

### Common Password Formats

Understanding password security is crucial, considering different encryption methods for a password like "R@nT4g*Ne!":

- **SHA-1:**
  - Output: 12bf203295c014c580302f4fae101817ec085949
  - Characteristics: 40 characters, no clear decryption method.

- **SHA-1 with Salt:**
  - Output: bc6b79c7716722cb383321e40f31734bce0c3598
  - Characteristics: 40 characters, with the addition of the word "Free."

- **MD5:**
  - Output: 4e84f7e8ce5ba8cdfe99d4ff41dc2d41
  - Characteristics: Encoded into a 128-bit string.

- **AES (Advanced Encryption Standard):**
  - Characteristics: Utilizes a symmetric encryption algorithm with a variable bit length.


-- Encryption Algorithms

- SHA-1-512 (-1-512) Stands for the buffer size when that increases the level of encryption is higher.

-- One Way Hash - Designed for cryptography

- MD5 and MD4 example (Not Recommended to be Used Vulnerable).

Lets Checkout some commands basics.

### Commands Basics
This command is used to generate an actual 
```bash
echo -n "adminpassword" | sha1sum
``` 
Result : ```bash efacc4001e857f7eba4ae781c2932dedf843865e ```

- HashID is used to determine the type of hash 

- Create a new file called new.hash 

```bash
touch new.hash
```
- Use the nano text editor the copy the result above or create your own. 

```bash
nano new.hash
```
- Note : Inside nano to save the file press CTRL + X and then Y then ENTER To save the file .

- Now use hashid to determine what hash type this file is using 

```bash
hashid -m new.hash
```

0. Crunch
The Command Used here Creates lists with every possible combination of number, you can also use crunch with uppercase and lowercase letters , special characters.

```sh
Syntax
Usage: crunch <min> <max> [options]

┌──(root㉿kali)-[~]
└─# crunch 1 3 0123456789 -O /home/kali/Desktop/phonepassword.txt 

```


- Optional Commands for testing 
- Its Optional (Requires alot of PC Resources).

```sh
┌──(root㉿kali)-[~]
└─# crunch 3 10 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 
```
- Optional - Add generated list to already existing file like rockyou.txt 
```
┌──(root㉿kali)-[~]
└─# crunch 1 3 0123456789 >> /usr/share/wordlists/rockyou.txt

```



#### 1. Wordlists

Simply used to generate rockyou.txt and show Word List Files on Kali.

```bash
┌──(root㉿kali)-[~]
└─# wordlists 

```
Result 

```
/usr/share/wordlists
├── amass - /usr/share/amass/wordlists
├── dirb - /usr/share/dirb/wordlists
├── dirbuster - /usr/share/dirbuster/wordlists
├── fasttrack.txt - /usr/share/set/src/fasttrack/wordlist.txt
├── fern-wifi - /usr/share/fern-wifi-cracker/extras/wordlists
├── john.lst - /usr/share/john/password.lst
├── legion - /usr/share/legion/wordlists
├── metasploit - /usr/share/metasploit-framework/data/wordlists
├── nmap.lst - /usr/share/nmap/nselib/data/passwords.lst
├── rockyou.txt
├── rockyou.txt.gz
├── sqlmap.txt - /usr/share/sqlmap/data/txt/wordlist.txt
├── wfuzz - /usr/share/wfuzz/wordlist
└── wifite.txt - /usr/share/dict/wordlist-probable.txt

```



```
┌──(root㉿kali)-[~]
└─# cd /usr/share/wordlists // cd into wordlists directory 
┌──(root㉿kali)-[~]
└─# ls -la // list all directory items
┌──(root㉿kali)-[~]
└─# gunzip /usr/share/wordlists/rockyou.txt.gz //extracts rockyou.txt if not extracted already
```

#### 2. John The Ripper

Always check the -h or --help option for any tool used on kali to check the syntax and options.

- Review Options </>

```bash
┌──(root㉿kali)-[~]
└─#john --help
```

- Check File Formats John Can Crack. </>
```
┌──(root㉿kali)-[~]
└─# john --list=formats // formats and protocols that can be used with john
```
    
```bash
┌──(root㉿kali)-[~]
└─#john --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-SHA1 --fork2 SHA1.txt
```
```bash
┌──(root㉿kali)-[~]
└─#john --show --format=Raw-SHA1 SHA1.txt
```

The Same commands apply for SHA224, SHA256, MD5, MD4 for example and the check the formats that john support with the command provided in the above. 

#### 3. HashCat - Advanced Password Cracker 
- Utilizes markov statistical theory A russian scientist - with AI.🤖
- Check PassGAN 

🔑 Core Attack Modes 🔑

- Dictionary Attack - Tries all words in a list, also known as "straight" mode. (Attack mode 0, -a 0)
- Combinator Attack - Concatenates words from multiple wordlists. (-a 1)
- Brute-force Attack and Mask Attack - Tries all characters from given charsets, per position. (-a 3)
- Hybrid Attack - Combines wordlists with masks (-a 6) and masks with wordlists (-a 7); can also be done with rules.
- Association Attack - Uses additional information like a username, filename, or hint to attack a specific hash. (-a 9)

Read more about Markov Chains.

```bash
hashcat --help
hashcat -m 100 new.hash rockyou.txt
```


#### 4. MSF/WordLists

Check MetaSploit WordLists

```bash
ls -lh /usr/share/metasploit-framework/data/wordlists/

```
Common Password Formats

Understanding password security is very important, with various tools transforming passwords in distinct ways. Let's consider the password "R@nT4g*Ne!" (Rent Forgone, in common terms) and observe its transformation through different encryption methods:

SHA-1:

Output: 12bf203295c014c580302f4fae101817ec085949
Characteristics: 40 characters, no clear decryption method.
SHA-1 with Salt:

Output: bc6b79c7716722cb383321e40f31734bce0c3598
Characteristics: Still 40 characters, with the addition of the word "Free."
MD5:

Output: 4e84f7e8ce5ba8cdfe99d4ff41dc2d41
Characteristics: Encoded into a 128-bit string.
AES (Advanced Encryption Standard):

Characteristics: Utilizes a symmetric encryption algorithm with variable bit length.
Note: The outcome of AES encryption is highly variable, depending on factors like bit length, making it nearly impossible to predict the final password representation.
In summary, these encryption methods offer different levels of security and characteristics, with varying degrees of complexity and resistance to decryption.


##### References     


🔗[Kali Linux Wordlist: What you need to know](https://www.fosslinux.com/48115/kali-linux-wordlist-what-you-need-to-know.htm)
🔗[crunch](https://www.kali.org/tools/crunch/)
🔗[WordLists - Kali-Tools]( https://www.kali.org/tools/wordlists/)
🔗[WordLists - GitLab - repository](https://gitlab.com/kalilinux/packages/wordlists)
🔗[John - Kali-Tools .](https://www.kali.org/tools/john/)
🔗[Openwall -github repository -John](https://github.com/openwall/john)
🔗[John-The-Ripper-Tutorial - Techy Rick ](https://techyrick.com/john-the-ripper-tutorial/)
🔗[Openwall -John - Offical  Website .](https://www.openwall.com/john/)
🔗[Hash Cat - Wiki](https://hashcat.net/wiki/)
🔗[Cap 2 Hashcat]( https://hashcat.net/cap2hashcat/)
🔗[Markov - Chain]( https://en.wikipedia.org/wiki/Markov_chain)
🔗[Hash Cat - Forums]( https://hashcat.net/forum/thread-6245.html)
🔗[Security Stack Exchange - Question 260773](https://security.stackexchange.com/questions/260773/hashcat-brute-force-markov-chains)
🔗[StationX - How to use Hashcat](https://www.stationx.net/how-to-use-hashcat/  )
🔗[MSF/Wordlists - charlesreid](https://charlesreid1.com/wiki/MSF/Wordlists)
🔗[MSFConsole](https://docs.metasploit.com/)
🔗[How to use hashcat](https://www.stationx.net/how-to-use-hashcat/)
🔗[MSF/Wordlists - charlesreid1](https://charlesreid1.com/wiki/MSF/Wordlists)
🔗[Where do the words in /usr/share/dict/words come from?](https://unix.stackexchange.com/questions/213628/where-do-the-words-in-usr-share-dict-words-come-from
)
🔗[SCOWL (Spell Checker Oriented Word Lists)](http://wordlist.aspell.net/
)
🔗[The spell utility -spell - find spelling errors (LEGACY) - UNIX](https://pubs.opengroup.org/onlinepubs/007908799/xcu/spell.html)
[What are Different Types of Cryptography?](https://www.shiksha.com/online-courses/articles/types-of-cryptography/)
[sha1-vs-sha2-the-technical-difference-explained-by-ssl-experts/](https://cheapsslsecurity.com/p/sha1-vs-sha2-the-technical-difference-explained-by-ssl-experts/)
🔗[password-encryption](https://www.okta.com/identity-101/password-encryption/)
🔗[Secure-Programs](https://tldp.org/HOWTO/Secure-Programs-HOWTO/crypto.html)
[SHA-1](https://en.wikipedia.org/wiki/SHA-1
)
🔗[What-are-computer-algorithms](https://www.howtogeek.com/44052/htg-explains-what-are-computer-algorithms-and-how-do-they-work/)
🔗[What Are MD5, SHA-1, and SHA-256 Hashes, and How Do I Check Them? - howtogeek.com](ttps://www.howtogeek.com/67241/htg-explains-what-are-md5-sha-1-hashes-and-how-do-i-check-them/
)
🔗[kali-linux-wordlist-what-you-need-to-know](https://www.fosslinux.com/48115/kali-linux-wordlist-what-you-need-to-know.htm
)

[Johnny](https://www.kali.org/tools/johnny/)
[Openwall -info wiki -Johnny](https://openwall.info/wiki/john/johnny)
[Openwall -github repository -Johnny](https://github.com/openwall/johnny)