External Mode
External mode allows you to plug in custom password generation code written in a C-like scripting language. It is for advanced users who need algorithms beyond John's built-in modes — for example, generating passwords from specific patterns, implementing custom hash append/prepend logic, or deriving candidates from contextual information like a target's pet names or employee lists.
External modules are shared C code compiled into John or loaded at runtime. The Jumbo distribution ships with many pre-built external modes for common scenario variations.
When to Use External Mode
Custom Pattern Cracking
You know the password pattern (e.g., "CompanyName" + 2-4 digits + special char) and need to generate only that structure.
Hybrid Dictionary+Transform
Combine two wordlists (first name + last name) or apply transforms based on external data sources.
Context-Aware Generation
Passwords derived from specific domain knowledge: product codes, internal jargon, employee IDs.
Algorithmic Bruteforce
Generate passwords according to a mathematical sequence or encoding that rules cannot achieve.
Usage
Use a built-in external mode
1john --external=Alnum4 hashes.txt
Alnum4 generates all 4-character alphanumeric combinations; useful for short PINs.
List available external mode formats
1john --list=external
Combine with wordlist
1john --wordlist=names.txt --external=MyMutator hashes.txt
Common Built-in External Modes
AlnumN
N-character alphanumeric brute force.
LowerN
N-character lowercase brute force.
Mask
Pattern-based with placeholders (e.g., ?y?y?d?d?d).
Kstats
Keyboard patterns for keywalk attacks.
DigitsN
N-digit PIN brute force.
dMOF
Custom format output for certain hash modules.
Regex
Generate candidates matching a regular expression.
Python
Embedded Python scripting (if built with Python support).
Creating Custom External Modes
External modes are C functions compiled into a shared library (.so) that John loads. This is an advanced topic requiring C knowledge and John source familiarity.
#include "external.h"
#include "memory.h"
extern char *password;
extern int eaindex, eacount;
void init() {
// Initialize your generator state
}
void generate() {
// Set 'password' to the next candidate
// Use get_next_*() functions from external.h
}
void restrict() {
// Optional: implement charset restrictions
}Warning
--rules and --incremental.