Hash Type Definition: Hashid and Hand Analysis
Before you start hacking the hashes of John the Ripper and Hashcat, you need to determine the algorithm exactly. The wrong format is not just time spent. Hashcat silently scrolls through the entire dictionary, finds no matches and takes out "Exhausted". And you won't even realize that the mistake was at the start. I know by myself. Read more in our guide to creating ctf tasks.
Automatic tools: hashid and hash-identifier
hashid – the main tool for determining the type of hash in CTF-inventory. Installation: pip3 install hashid. Launch: hashid '<хеш>'. At the output - a list of probable formats indicating the hashcat mode (-m) and the format John (--format).
hash-identifier (in fresh Kali may be absent, placed through apt install hash-identifier) does the same, but without reference to specific flags. There's more name-that-hash – a fresher alternative. For CTF I choose hashid: it saves the step of finding the right -m.
Typical output hashid for string 5f4dcc3b5aa765d61d8327deb882cf99:
Analyzing '5f4dcc3b5aa765d61d8327deb882cf99'
[+] MD2 [Hashcat Mode: N/A]
[+] MD5 [Hashcat Mode: 0][JtR Format: raw-md5]
[+] MD4 [Hashcat Mode: 900][JtR Format: raw-md4]
[+] NTLM [Hashcat Mode: 1000][JtR Format: nt]
See the problem? MD5 and NTLM – both 32 hex symbols. hashid cannot distinguish them unambiguously, it offers options. The context of the task works.
Manual analysis by length and prefix
What to check for manual definition of the type of hash:
Sign Algorithm Hashcat -m JtR --format
32 hex, without strapping MD5 or NTLM 0 / 1000 raw-md5 / nt
40 hex SHA-1 100 raw-sha1
64 hex SHA-256 1400 raw-sha256
128 hex SHA-512 1700 raw-sha512
$1$salt$hash md5crypt 500 md5crypt
$5$salt$hash Sha256crypt 7400 Sha256crypt
$6$salt$hash Sha512crypt 1800 Sha512crypt
$2a$ or $2b$ bcrypt 3200 bcrypt
The context decides. Hash from /etc/shadow on Linux (T1003.008 — /etc/passwd and /etc/shadow, sab-technics T1003 OS Credential Dumping by MITRE ATT&CK) – almost always sha512crypt with prefix $6$. The HSAM database of Windows (T1003.002) is NTLM. The ticket Kerberoasting (T1558.003) — Kerberos 5 etype 23, hashcat -m 13100.
Frequent CTF trap – confuse raw-MD5 (-m 0, billions of hashes/sec on GPU) with md5crypt (-m 500, hundreds of thousands of hashes/sec). The difference in speed is four orders of magnitude. On one scourge it cost me half an hour.
John the Ripper can detect the format automatically: run john hashes.txt without --format, and he'll try to pick up the type himself. For standard unix hashes ($6$, $2b$) works unmistakably. For raw hashes without strapping - lottery.
John the Ripper for Beginners: Modes and Examples of Teams
John the Ripper (JtR) was created by Solar Designer from the Openwall project. The Jumbo version supports over 400 heche formats. Check availability and version: john --version. In Kali and Parrot it is pre-installed, but to access all formats it is worth to collect jumbo from the sources: git clone https://github.com/openwall/john -b bleeding-jumbo john-jumbo, then cd john-jumbo/src && ./configure && make -sj4.
Single Crack Mode
The regime --single uses the username and metadata from the hash file to generate password candidates. If the task is given hash in the format admin:$6$salt$hash, John will take "admin" and drive through the rules of mangling - add numbers, deploy the register, substitute typical suffixes (admin1, Admin123, nimda).
The nuance on which beginners stumble: for the work of Single Crack Mode file should be in the format username:hash. Without a username, the mode will not generate candidates – and will be stupidly useless.
Launch: john --single --format=sha512crypt hashes.txt. This is the fastest mode. On the CTF it is worth starting with it.
Vocabulary attack and wordlist for password hacking
Classic password selection on the hash. Rockyou wordlist – 14+ million real passwords from the 2009 RockYou leak. In Kali file lies in /usr/share/wordlists/rockyou.txt.gz. Before first use, unpack: gunzip /usr/share/wordlists/rockyou.txt.gz. Launch of the vocabulary attack: john --wordlist=/usr/share/wordlists/rockyou.txt --format=raw-md5 hashes.txt.
In practice, a vocabulary attack on a SHA-512 hash with a password from a rockyou takes a fraction of a second – it’s essentially a lookup, not a too much. If the password is in the dictionary, it will be found instantly.
The result is looked through john --show hashes.txt. John keeps the found passwords in ~/.john/john.pot – when you re-run on the same hash, he will say “No password hashes to crack”. Cleaning: rm ~/.john/john.pot.
Incremental Mode – Brutforce Password
Total overkill: john --incremental hashes.txt. Limiting the character set: --incremental=Digits (Only numbers are great for PIN codes) --incremental=Alpha (Letters), --incremental=Alnum (Letters + numbers). For CTFs, it works on passwords up to 6-7 characters. On something longer without a GPU, switch to Hashcat - John in CPU mode is inferior to it with a long overkill.
Hashcat examples of commands: from vocabulary to GPU-brutfors
Hashcat is a beast with native GPU performance and support for 450+ algorithms. To work with NVIDIA, the GPU needs a CUDA Toolkit, for AMD – ROCM (Linux) or AMD HIP SDK (Windows). On CPU hashcat also works through OpenCL-rantime from Intel (apt install intel-opencl-icd) or PoCL.
GPU-brutforce hashes and customization
Basic dictionary attack on MD5: hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/rockyou.txt. Flag selection: -m 0 – hash type (0 = raw-MD5, 1000 = NTLM, 1400 = raw = raw-SHA256, 1700 = raw-SHA512, 3200 = bcrypt), -a 0 – attack mode (straight/dictionary).
The main advantage of hashcat is the automatic distribution of tasks between several GPUs. John the Ripper also supports GPUs through OpenCL, but only for a limited subset of formats (OpenCL variants like raw-sha256-opencl) and requires a manual configuration. Hashcat is easier: connect the second card - it will catch it.
If the GPU is not (a typical situation on the CTF with the virtual), the hashcat can issue an error. Flag --force make it work on the CPU, but it’s a crutch—it’s more correct to put an OpenCL runtime for the processor.
Vocabulary and-based rule attack hashcat
Hashcat supports six attack modes through the flag -a:
The regime Flag Description Application in CTF
Straight (Dictionary) -a 0 Dictionary attack The first step on any dug
Combination -a 1 Combination of two dictionaries Two-word passwords
Brute Force/Mask -a 3 Overtaking the mask Short passwords, known structure
Hybrid wordlist+mask -a 6 Dictionary + mask on the right Password123 passwords
Hybrid mask+wordlist -a 7 Mask + dictionary on the left 2024admin type passwords
Rule-based attack — modification of vocabulary words on the fly. Hashcat comes with ready-made rules sets in the directory rules/: best64.rule (64 most effective – start with it) rockyou-30000.rule (rules from patterns of real leaks), d3ad0ne.rule (Aggressive set). Launch: hashcat -m 0 -a 0 hash.txt rockyou.txt -r rules/best64.rule. The rules transform “password” into “Password,” “PASSWORD,” “p@ssword,” “password1,” and dozens of other variations — without bloating the dictionary.
Hashcat handles in-kernel rules: GPU calculates mutations inside the kernel without transferring data to CPUs. This gives a noticeable increase in speed compared to JtR, where the engine runs differently.
Hashcat mask attacks and hybrid modes
A mask is a template that describes the structure of a password. Instead of overkilling all possible symbols, indicate that at each position: letter, number or special symbol.
Mask symbols in hashcat: ?l – lowercase (a-z), ?u – uppercase (A-Z), ?d – number (0-9), ?s – special symbol, ?a Any printed symbol. Password of 4 digits (PIN): hashcat -m 0 -a 3 hash.txt ?d?d?d?d. The ‘title + 4 lowercase + 2 digits’ password: hashcat -m 0 -a 3 hash.txt ?u?l?l?l?l?d?d.
In practice the mask ?u?a?a?a?a instead of a complete overkill ?a?a?a?a?a can reduce the selection time of a 5-character SHA-256 password several times - simply by reducing space. If at least part of the structure is visible from the task condition, the mask critically saves time.
Hybrid attacks combine a dictionary and a mask. The regime -a 6 (dictionary + mask on the right): hashcat -m 1700 -a 6 hash.txt rockyou.txt ?d?d?d – check each word from rockyou with the addition of a three-digit number. The regime -a 7 (mask on the left): hashcat -m 1700 -a 7 hash.txt ?d?d?d rockyou.txt. Covers typical patterns of real passwords: people take a vocabulary word and sculpt numbers or a year towards it.
John the Ripper also supports masks through --mask=?u?l?l?l?l?d?d, but without GPU-acceleration the crowd is less.
Wordlist for password hacking and rule-based strategy
Vocabulary attack on a password is the most effective method on CTF. The quality of the dictionary determines the result.
Rockyou and Alternatives
Rockyou wordlist is not needed if you work in Kali - it is already in the system. This is the first thing you try on any CTF-tasque. In the vast majority of entry-level and mid-level competitions, the password will be found here. According to IBM X-Force 2025, there are more than 6,000 fresh accounts in the dark web every day — dictionaries are constantly growing.
If rockyou did not help: SecLists (github.com/danielmiessler/SecLists) is the largest collection of dictionaries by category (passwords, usernames, fuzzing). CeWL is a generator of target dictionaries from websites: if there is a URL in the task, it is worth a try cewl <url> -w custom_wordlist.txt. Crackstation is a 1.5 billion entry dictionary for serious tasks outside of a typical CTF.
Rules for JtR: syntax john.conf
John the Ripper keeps the rules in the configuration file john.conf. Ready-made sets are called through --rules=Jumbo or --rules=Single. But the real power of JtR is in custom rules. Here is an example that adds typical suffixes to every word:
[List.Rules:CTFAppend]
Az"[0-9]"
Az"[0-9][0-9]"
Az"!"
Az"123"
Az"2024"
cAz"1"
Here A – append, z by the end of the word, c capitalize first letter. Add this block to john.conf and cause: john --wordlist=rockyou.txt --rules=CTFAppend --format=raw-md5 hashes.txt.
The developers of JtR have repeatedly emphasized: the optimization of the rules and the elimination of duplicate candidates is a key factor in effective selection. Generating millions of takes is useless: each hash is a GPU cycle wasted.
Hashcat vs John the Ripper: comparison for crypto CTF task
Both tools solve the problem of Password Cracking (T1110.002, Credential Access by MITRE ATT&CK), but their strengths are different. On GPU, the hashcat pulls more, on the CPU the difference is minimal - JtR in places even faster.
Criterion John the Ripper (jumbo) Hashcat
GPU acceleration Through OpenCL, only for part of the formats Native, for most modes, auto-distribution between GPUs
Autodetermination of the hash Yeah, built-in No, it demands a clear -m
Number of formats 400+ 450+
the Rule Engine External (john.conf) In-kernel, faster on GPU
Extracting hashes from files Yes (*2john utilities) No
Multi-GPU Manual configuration Automatic task separation
Installation Assembly from source (recommended) Ready-made binary
Sessions and recovery Yeah Yes, with more flexible management
Practical conclusion: start with John (auto-definition format, fast single crack, utilities *2john), switch to Hashcat if there is a GPU or the need for complex masks. Many CTF players keep both – JtR for a quick first pass, Hashcat for heavy artillery.
Crypto CTFs: *2john utilities and non-standard formats
CTFs often come across not bare hashes, but secure files — encrypted ZIP archives, PDF with password, SSH keys with passphrase, KeePass database. And here John the Ripper is indispensable.
Set of utilities *2john extracts from pseudoheshi files - the data needed to check password candidates. Standard workflow for ZIP archive on CTF:
zip2john protected.zip > zip_hash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt zip_hash.txt
john --show zip_hash.txt
Similar to other formats: pdf2john protected.pdf > pdf_hash.txt for PDF with password, ssh2john id_rsa > ssh_hash.txt for private SSH key with passphrase, keepass2john database.kdbx > keepass_hash.txt for KeePass. Full Zoo Utility in Kali: ls /usr/share/john/*.py - there are dozens of scripts, from bitcoin2john to telegram2john.
After extracting pseudohash, you can select a password through hashcat, but you need to know the right one -m. For ZIP it -m 13600 (WinZip), -m 17200/-m 17210 (PKZIP). For the SSH key – -m 22921 (RSA/DSA). The extraction of the hash still goes through *2john - hashcat has no own utilities for this.
On the CTF of the middle level, a ligament is often found: dump /etc/shadow (sha512crypt) or encrypted archive + prompt in the task hinting at the password structure. Define the type, try rockyou, did not help - you use a mask on the hint. This algorithm closes most of the tucks.
Typical errors in the broth of the password and checklist
Over the years of CTF practice, I have collected a list of rakes that every second beginner comes to. Some of them are my own.
Incorrect hash regime. Launching hashcat -m 0 (MD5) on the hash sha256crypt ($5$...) – hashcat will issue “Token length exception” or mill the dictionary in vain. Always check the type through hashid before launch. Error number one.
Rockyou.txt is not unpacked. Kali comes with rockyou.txt.gz. Forgotten gunzip – hashcat will try to process the compressed file and find nothing. There will be no mistake – just zero result. Silently. Without explanation.
Re-start without cleaning the pot file. John keeps results in ~/.john/john.pot, Hashcat — in ~/.local/share/hashcat/hashcat.potfile. If the hash has already been hacked earlier, the re-run will show "All hashes found in potfile" or "No password hashes left to crack." For a new CTF-Tack with matching hash, use --potfile-disable (hashcat) or delete the potential file.
It's too wide a mask. ?a?a?a?a?a?a?a?a – is 95^8 = 6.6 quadrillion combinations. Even on the top GPU it will take days. If you know something from the context of the task about the structure of the password, narrow the mask.
Passing the rules when the vocabulary attack fails. If rockyou.txt didn't help, many immediately jump to the brute force. Stop. Between these stages try a rule-based attack: hashcat -m 0 -a 0 hash.txt rockyou.txt -r rules/best64.rule. The rules cover dictionary word modifications (P@ssword, Password1, password!) — and often faster than complete overkill.
Before you start hacking the hashes of John the Ripper and Hashcat, you need to determine the algorithm exactly. The wrong format is not just time spent. Hashcat silently scrolls through the entire dictionary, finds no matches and takes out "Exhausted". And you won't even realize that the mistake was at the start. I know by myself. Read more in our guide to creating ctf tasks.
Automatic tools: hashid and hash-identifier
hashid – the main tool for determining the type of hash in CTF-inventory. Installation: pip3 install hashid. Launch: hashid '<хеш>'. At the output - a list of probable formats indicating the hashcat mode (-m) and the format John (--format).
hash-identifier (in fresh Kali may be absent, placed through apt install hash-identifier) does the same, but without reference to specific flags. There's more name-that-hash – a fresher alternative. For CTF I choose hashid: it saves the step of finding the right -m.
Typical output hashid for string 5f4dcc3b5aa765d61d8327deb882cf99:
Analyzing '5f4dcc3b5aa765d61d8327deb882cf99'
[+] MD2 [Hashcat Mode: N/A]
[+] MD5 [Hashcat Mode: 0][JtR Format: raw-md5]
[+] MD4 [Hashcat Mode: 900][JtR Format: raw-md4]
[+] NTLM [Hashcat Mode: 1000][JtR Format: nt]
See the problem? MD5 and NTLM – both 32 hex symbols. hashid cannot distinguish them unambiguously, it offers options. The context of the task works.
Manual analysis by length and prefix
What to check for manual definition of the type of hash:
Sign Algorithm Hashcat -m JtR --format
32 hex, without strapping MD5 or NTLM 0 / 1000 raw-md5 / nt
40 hex SHA-1 100 raw-sha1
64 hex SHA-256 1400 raw-sha256
128 hex SHA-512 1700 raw-sha512
$1$salt$hash md5crypt 500 md5crypt
$5$salt$hash Sha256crypt 7400 Sha256crypt
$6$salt$hash Sha512crypt 1800 Sha512crypt
$2a$ or $2b$ bcrypt 3200 bcrypt
The context decides. Hash from /etc/shadow on Linux (T1003.008 — /etc/passwd and /etc/shadow, sab-technics T1003 OS Credential Dumping by MITRE ATT&CK) – almost always sha512crypt with prefix $6$. The HSAM database of Windows (T1003.002) is NTLM. The ticket Kerberoasting (T1558.003) — Kerberos 5 etype 23, hashcat -m 13100.
Frequent CTF trap – confuse raw-MD5 (-m 0, billions of hashes/sec on GPU) with md5crypt (-m 500, hundreds of thousands of hashes/sec). The difference in speed is four orders of magnitude. On one scourge it cost me half an hour.
John the Ripper can detect the format automatically: run john hashes.txt without --format, and he'll try to pick up the type himself. For standard unix hashes ($6$, $2b$) works unmistakably. For raw hashes without strapping - lottery.
John the Ripper for Beginners: Modes and Examples of Teams
John the Ripper (JtR) was created by Solar Designer from the Openwall project. The Jumbo version supports over 400 heche formats. Check availability and version: john --version. In Kali and Parrot it is pre-installed, but to access all formats it is worth to collect jumbo from the sources: git clone https://github.com/openwall/john -b bleeding-jumbo john-jumbo, then cd john-jumbo/src && ./configure && make -sj4.
Single Crack Mode
The regime --single uses the username and metadata from the hash file to generate password candidates. If the task is given hash in the format admin:$6$salt$hash, John will take "admin" and drive through the rules of mangling - add numbers, deploy the register, substitute typical suffixes (admin1, Admin123, nimda).
The nuance on which beginners stumble: for the work of Single Crack Mode file should be in the format username:hash. Without a username, the mode will not generate candidates – and will be stupidly useless.
Launch: john --single --format=sha512crypt hashes.txt. This is the fastest mode. On the CTF it is worth starting with it.
Vocabulary attack and wordlist for password hacking
Classic password selection on the hash. Rockyou wordlist – 14+ million real passwords from the 2009 RockYou leak. In Kali file lies in /usr/share/wordlists/rockyou.txt.gz. Before first use, unpack: gunzip /usr/share/wordlists/rockyou.txt.gz. Launch of the vocabulary attack: john --wordlist=/usr/share/wordlists/rockyou.txt --format=raw-md5 hashes.txt.
In practice, a vocabulary attack on a SHA-512 hash with a password from a rockyou takes a fraction of a second – it’s essentially a lookup, not a too much. If the password is in the dictionary, it will be found instantly.
The result is looked through john --show hashes.txt. John keeps the found passwords in ~/.john/john.pot – when you re-run on the same hash, he will say “No password hashes to crack”. Cleaning: rm ~/.john/john.pot.
Incremental Mode – Brutforce Password
Total overkill: john --incremental hashes.txt. Limiting the character set: --incremental=Digits (Only numbers are great for PIN codes) --incremental=Alpha (Letters), --incremental=Alnum (Letters + numbers). For CTFs, it works on passwords up to 6-7 characters. On something longer without a GPU, switch to Hashcat - John in CPU mode is inferior to it with a long overkill.
Hashcat examples of commands: from vocabulary to GPU-brutfors
Hashcat is a beast with native GPU performance and support for 450+ algorithms. To work with NVIDIA, the GPU needs a CUDA Toolkit, for AMD – ROCM (Linux) or AMD HIP SDK (Windows). On CPU hashcat also works through OpenCL-rantime from Intel (apt install intel-opencl-icd) or PoCL.
GPU-brutforce hashes and customization
Basic dictionary attack on MD5: hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/rockyou.txt. Flag selection: -m 0 – hash type (0 = raw-MD5, 1000 = NTLM, 1400 = raw = raw-SHA256, 1700 = raw-SHA512, 3200 = bcrypt), -a 0 – attack mode (straight/dictionary).
The main advantage of hashcat is the automatic distribution of tasks between several GPUs. John the Ripper also supports GPUs through OpenCL, but only for a limited subset of formats (OpenCL variants like raw-sha256-opencl) and requires a manual configuration. Hashcat is easier: connect the second card - it will catch it.
If the GPU is not (a typical situation on the CTF with the virtual), the hashcat can issue an error. Flag --force make it work on the CPU, but it’s a crutch—it’s more correct to put an OpenCL runtime for the processor.
Vocabulary and-based rule attack hashcat
Hashcat supports six attack modes through the flag -a:
The regime Flag Description Application in CTF
Straight (Dictionary) -a 0 Dictionary attack The first step on any dug
Combination -a 1 Combination of two dictionaries Two-word passwords
Brute Force/Mask -a 3 Overtaking the mask Short passwords, known structure
Hybrid wordlist+mask -a 6 Dictionary + mask on the right Password123 passwords
Hybrid mask+wordlist -a 7 Mask + dictionary on the left 2024admin type passwords
Rule-based attack — modification of vocabulary words on the fly. Hashcat comes with ready-made rules sets in the directory rules/: best64.rule (64 most effective – start with it) rockyou-30000.rule (rules from patterns of real leaks), d3ad0ne.rule (Aggressive set). Launch: hashcat -m 0 -a 0 hash.txt rockyou.txt -r rules/best64.rule. The rules transform “password” into “Password,” “PASSWORD,” “p@ssword,” “password1,” and dozens of other variations — without bloating the dictionary.
Hashcat handles in-kernel rules: GPU calculates mutations inside the kernel without transferring data to CPUs. This gives a noticeable increase in speed compared to JtR, where the engine runs differently.
Hashcat mask attacks and hybrid modes
A mask is a template that describes the structure of a password. Instead of overkilling all possible symbols, indicate that at each position: letter, number or special symbol.
Mask symbols in hashcat: ?l – lowercase (a-z), ?u – uppercase (A-Z), ?d – number (0-9), ?s – special symbol, ?a Any printed symbol. Password of 4 digits (PIN): hashcat -m 0 -a 3 hash.txt ?d?d?d?d. The ‘title + 4 lowercase + 2 digits’ password: hashcat -m 0 -a 3 hash.txt ?u?l?l?l?l?d?d.
In practice the mask ?u?a?a?a?a instead of a complete overkill ?a?a?a?a?a can reduce the selection time of a 5-character SHA-256 password several times - simply by reducing space. If at least part of the structure is visible from the task condition, the mask critically saves time.
Hybrid attacks combine a dictionary and a mask. The regime -a 6 (dictionary + mask on the right): hashcat -m 1700 -a 6 hash.txt rockyou.txt ?d?d?d – check each word from rockyou with the addition of a three-digit number. The regime -a 7 (mask on the left): hashcat -m 1700 -a 7 hash.txt ?d?d?d rockyou.txt. Covers typical patterns of real passwords: people take a vocabulary word and sculpt numbers or a year towards it.
John the Ripper also supports masks through --mask=?u?l?l?l?l?d?d, but without GPU-acceleration the crowd is less.
Wordlist for password hacking and rule-based strategy
Vocabulary attack on a password is the most effective method on CTF. The quality of the dictionary determines the result.
Rockyou and Alternatives
Rockyou wordlist is not needed if you work in Kali - it is already in the system. This is the first thing you try on any CTF-tasque. In the vast majority of entry-level and mid-level competitions, the password will be found here. According to IBM X-Force 2025, there are more than 6,000 fresh accounts in the dark web every day — dictionaries are constantly growing.
If rockyou did not help: SecLists (github.com/danielmiessler/SecLists) is the largest collection of dictionaries by category (passwords, usernames, fuzzing). CeWL is a generator of target dictionaries from websites: if there is a URL in the task, it is worth a try cewl <url> -w custom_wordlist.txt. Crackstation is a 1.5 billion entry dictionary for serious tasks outside of a typical CTF.
Rules for JtR: syntax john.conf
John the Ripper keeps the rules in the configuration file john.conf. Ready-made sets are called through --rules=Jumbo or --rules=Single. But the real power of JtR is in custom rules. Here is an example that adds typical suffixes to every word:
[List.Rules:CTFAppend]
Az"[0-9]"
Az"[0-9][0-9]"
Az"!"
Az"123"
Az"2024"
cAz"1"
Here A – append, z by the end of the word, c capitalize first letter. Add this block to john.conf and cause: john --wordlist=rockyou.txt --rules=CTFAppend --format=raw-md5 hashes.txt.
The developers of JtR have repeatedly emphasized: the optimization of the rules and the elimination of duplicate candidates is a key factor in effective selection. Generating millions of takes is useless: each hash is a GPU cycle wasted.
Hashcat vs John the Ripper: comparison for crypto CTF task
Both tools solve the problem of Password Cracking (T1110.002, Credential Access by MITRE ATT&CK), but their strengths are different. On GPU, the hashcat pulls more, on the CPU the difference is minimal - JtR in places even faster.
Criterion John the Ripper (jumbo) Hashcat
GPU acceleration Through OpenCL, only for part of the formats Native, for most modes, auto-distribution between GPUs
Autodetermination of the hash Yeah, built-in No, it demands a clear -m
Number of formats 400+ 450+
the Rule Engine External (john.conf) In-kernel, faster on GPU
Extracting hashes from files Yes (*2john utilities) No
Multi-GPU Manual configuration Automatic task separation
Installation Assembly from source (recommended) Ready-made binary
Sessions and recovery Yeah Yes, with more flexible management
Practical conclusion: start with John (auto-definition format, fast single crack, utilities *2john), switch to Hashcat if there is a GPU or the need for complex masks. Many CTF players keep both – JtR for a quick first pass, Hashcat for heavy artillery.
Crypto CTFs: *2john utilities and non-standard formats
CTFs often come across not bare hashes, but secure files — encrypted ZIP archives, PDF with password, SSH keys with passphrase, KeePass database. And here John the Ripper is indispensable.
Set of utilities *2john extracts from pseudoheshi files - the data needed to check password candidates. Standard workflow for ZIP archive on CTF:
zip2john protected.zip > zip_hash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt zip_hash.txt
john --show zip_hash.txt
Similar to other formats: pdf2john protected.pdf > pdf_hash.txt for PDF with password, ssh2john id_rsa > ssh_hash.txt for private SSH key with passphrase, keepass2john database.kdbx > keepass_hash.txt for KeePass. Full Zoo Utility in Kali: ls /usr/share/john/*.py - there are dozens of scripts, from bitcoin2john to telegram2john.
After extracting pseudohash, you can select a password through hashcat, but you need to know the right one -m. For ZIP it -m 13600 (WinZip), -m 17200/-m 17210 (PKZIP). For the SSH key – -m 22921 (RSA/DSA). The extraction of the hash still goes through *2john - hashcat has no own utilities for this.
On the CTF of the middle level, a ligament is often found: dump /etc/shadow (sha512crypt) or encrypted archive + prompt in the task hinting at the password structure. Define the type, try rockyou, did not help - you use a mask on the hint. This algorithm closes most of the tucks.
Typical errors in the broth of the password and checklist
Over the years of CTF practice, I have collected a list of rakes that every second beginner comes to. Some of them are my own.
Incorrect hash regime. Launching hashcat -m 0 (MD5) on the hash sha256crypt ($5$...) – hashcat will issue “Token length exception” or mill the dictionary in vain. Always check the type through hashid before launch. Error number one.
Rockyou.txt is not unpacked. Kali comes with rockyou.txt.gz. Forgotten gunzip – hashcat will try to process the compressed file and find nothing. There will be no mistake – just zero result. Silently. Without explanation.
Re-start without cleaning the pot file. John keeps results in ~/.john/john.pot, Hashcat — in ~/.local/share/hashcat/hashcat.potfile. If the hash has already been hacked earlier, the re-run will show "All hashes found in potfile" or "No password hashes left to crack." For a new CTF-Tack with matching hash, use --potfile-disable (hashcat) or delete the potential file.
It's too wide a mask. ?a?a?a?a?a?a?a?a – is 95^8 = 6.6 quadrillion combinations. Even on the top GPU it will take days. If you know something from the context of the task about the structure of the password, narrow the mask.
Passing the rules when the vocabulary attack fails. If rockyou.txt didn't help, many immediately jump to the brute force. Stop. Between these stages try a rule-based attack: hashcat -m 0 -a 0 hash.txt rockyou.txt -r rules/best64.rule. The rules cover dictionary word modifications (P@ssword, Password1, password!) — and often faster than complete overkill.