How to View and Customize the Leet Mode Character Mapping in CUPP
CUPP's leet mode transforms password candidates by substituting characters with numeric equivalents defined in the cupp.cfg configuration file, which you can customize by editing the [leet] section without modifying any Python source code.
The Common User Passwords Profiler (CUPP) is a popular open-source tool for generating targeted wordlists. Understanding the leet mode character mapping is essential when you want to control how CUPP transforms plain text into "1337 speak" variants during password generation.
What Is the Leet Mode Character Mapping?
CUPP's leet mode replaces specific alphabetic characters with their leet speak equivalents to create variations like p455w0rd instead of password. According to the Mebus/cupp source code, this mapping is stored as a dictionary in the global CONFIG["LEET"] variable.
The default leet mode character mapping in CUPP follows these substitutions:
- a →
4 - i →
1 - e →
3 - t →
7 - o →
0 - s →
5 - g →
9 - z →
2
Where CUPP Stores and Loads the Mapping
The Configuration File (cupp.cfg)
The mapping lives in the cupp.cfg file at the repository root, specifically within the [leet] section (lines 19–26). Each line follows the format char=replacement:
[leet]
a=4
i=1
e=3
t=7
o=0
s=5
g=9
z=2
The Configuration Parser (read_config())
The read_config() function in cupp.py (lines 76–84) reads this section automatically and populates the CONFIG["LEET"] dictionary. You can verify the loaded mapping at runtime:
from cupp import read_config, CONFIG
read_config("cupp.cfg")
print(CONFIG["LEET"])
# Output: {'a': '4', 'i': '1', 'e': '3', 't': '7', 'o': '0', 's': '5', 'g': '9', 'z': '2'}
How to Customize the Leet Mode Character Mapping
You can modify the leet mode character mapping by editing cupp.cfg—no source code changes required. The read_config() function dynamically reads every entry under [leet], allowing you to add, remove, or modify substitutions.
To customize the mapping:
- Open
cupp.cfgin your text editor. - Locate the
[leet]section. - Modify existing entries or add new ones using the format
char=replacement. - Save the file and rerun CUPP.
For example, to change a to @ and add b to 8 substitution:
[leet]
a=@
i=1
e=3
t=7
o=0
s=5
g=9
z=2
b=8
Applying the Leet Mode Transformation
When enabled via the interactive prompt (answer Y to "Leet mode? (i.e. leet = 1337) Y/[N]"), CUPP passes each word through the make_leet() function (lines 95–99 in cupp.py). This function iterates over CONFIG["LEET"] and replaces every occurrence of each key with its value.
You can also use this function directly in your own scripts:
from cupp import read_config, make_leet, CONFIG
# Load configuration
read_config("cupp.cfg")
# Transform a word
word = "password"
leet_word = make_leet(word)
print(leet_word) # Returns: p455w0rd
# After adding b=8 to cupp.cfg, reload:
read_config("cupp.cfg")
print(make_leet("bob")) # Returns: 808
Summary
- Default mapping: CUPP substitutes a→4, i→1, e→3, t→7, o→0, s→5, g→9, and z→2 when leet mode is enabled.
- Storage location: The leet mode character mapping is defined in
cupp.cfgunder the[leet]section and loaded intoCONFIG["LEET"]by theread_config()function. - Customization: Edit
cupp.cfgto modify existing mappings or add new character substitutions without changing source code. - Implementation: The
make_leet()function incupp.pyapplies these transformations during password generation.
Frequently Asked Questions
What characters does CUPP replace by default in leet mode?
By default, CUPP replaces eight characters: a becomes 4, i becomes 1, e becomes 3, t becomes 7, o becomes 0, s becomes 5, g becomes 9, and z becomes 2. These mappings are stored in the [leet] section of cupp.cfg.
Do I need to modify the Python source code to change the leet substitutions?
No. You only need to edit the cupp.cfg configuration file. The read_config() function in cupp.py automatically reads every entry in the [leet] section, so additions or modifications take effect immediately when you rerun CUPP.
How does CUPP apply the leet mode character mapping during wordlist generation?
When you enable leet mode by answering "Y" to the interactive prompt, CUPP calls the make_leet() function (lines 95–99 in cupp.py). This function iterates over the CONFIG["LEET"] dictionary and substitutes every occurrence of each key character with its corresponding value in the generated password candidates.
Can I add new characters to the leet mode mapping that aren't in the default set?
Yes. Simply add new lines to the [leet] section in cupp.cfg using the format char=replacement. For example, adding b=8 will cause CUPP to replace all instances of "b" with "8" in leet mode, provided you reload the configuration.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →