Skip to content

Glossary

Mask attack

A mask attack brute-forces candidates that match a known shape — charset per position — instead of testing every possible string, keeping the keyspace small enough to finish.

A mask attack is a brute-force search constrained to a known password shape rather than every possible string. Each position in the mask is a placeholder for a charset — ?l for lowercase, ?u for uppercase, ?d for digits, ?s for symbols, ?a for all of them — so a mask like ?u?l?l?l?l?d?d only generates candidates that start with one capital letter, continue with four lowercase letters, and end in two digits.

Hashcat runs this as attack mode -a 3. The payoff is in the keyspace: a tight mask that matches a known complexity policy or a predictable format (a PIN, a phone number, Word plus a year) covers that exact shape in a tiny fraction of the time a full-length brute force would take, because it never wastes guesses on structures that cannot occur.

Masks also combine with wordlists as a hybrid attack. See mask attacks and keyspace for the charset table, the keyspace math, and when a mask beats a dictionary outright.