> For the complete documentation index, see [llms.txt](https://sarpers-organization.gitbook.io/ctftricks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sarpers-organization.gitbook.io/ctftricks/_chapter-intro-11/offline-cracking/archive/trick-0609.md).

# Offline Password Cracking (Password-Protected Archive)

***

To crack a password-protected zip archive, first extract the crackable hash from the archive using `zip2john`. This utility extracts password hashes from PKZIP archives, preparing them for cracking tools like John the Ripper.

```bash
zip2john <file.zip> > hash.txt
```

The command `zip2john [zipfile] > [hashfile]` saves the extracted hash to a specified output file, such as `hash.txt`.

Then, use John the Ripper to crack the extracted hash. The next step is to use John the Ripper to crack the extracted hash using a suitable wordlist. John supports many cracking modes, and the most common one is the wordlist mode.

```bash
john <hash.txt> --wordlist=<wordlist_path>
```

This mode uses a wordlist file specified by the user via the `--wordlist=FILE` option.
