> For the complete documentation index, see [llms.txt](https://hacktools.aprasanna.com.np/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacktools.aprasanna.com.np/john-the-ripper/john-the-ripper-intro.md).

# John the Ripper - Intro

<figure><img src="https://3076500874-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiz2l2usc8AWKK3DkTrmz%2Fuploads%2FMyIEibaSZ1RmPoKyC0zw%2Fimage.png?alt=media&amp;token=8e5f101a-a027-413b-9591-da46dbed7957" alt=""><figcaption><p>John the Ripper</p></figcaption></figure>

## Introduction

John the Ripper is a free and open-source password cracking tool which can crack passwords stored in various formats including hashes and encrypted private keys.

## Uses

* Password auditing (assessing strength of passwords used in organizations)
* Password recovery
* Penetration testing

## Hash Cracking Basics

### John Basic Syntax

`john [options] [path to file]`

* `john` : Invokes the John the Ripper program
* `[path to file]` : The file containing the hash you're trying to crack

### Automatic Cracking

Syntax:

`john --wordlist=[path to wordlist] [path to file]`<br>

* `--wordlist=` : Specifies using wordlist mode, reading from the file that you supply in the following path
* `[path to wordlist]` : The path to the wordlist you're using

Example Usage:

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hash_to_crack.txt
```

Here, the hash type is not specified, so the tool automatically tries to detect the hash and tries to crack it. This is a quick method, however can be unreliable sometimes.

### Identifying hashes

Hash type can be identified using an online hash identifier tool: <https://hashes.com/en/tools/hash_identifier> or by using a Python tool called [hash-identifier](https://gitlab.com/kalilinux/packages/hash-identifier/-/tree/kali/master).

### Format-specific Cracking

Syntax:

`john --format=[format] --wordlist=[path to wordlist] [path to file]`

* `--format=` : This is the flag to tell John that you're giving it a hash of a specific format
* `[format]` : The format that the hash is in<br>

Example Usage:

```bash
john --format=raw-md5 --wordlist=/usr/share/wordlists/rockyou.txt hash_to_crack.txt
```

### Listing JTR's Hash Formats

The john the ripper formats can be listed by adding using the command:

```bash
john --list=formats
```

You can manually check, or grep for your hash type using something like:

```bash
john --list=formats | grep -iF "md5"
```
