DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Trending

  • Setting Up Data Pipelines With Snowflake Dynamic Tables
  • Scaling in Practice: Caching and Rate-Limiting With Redis and Next.js
  • Start Coding With Google Cloud Workstations
  • Chaos Engineering for Microservices

Learn How To Crack Passwords With Hashcat

This tutorial will guide you how to install Hashcat and also crack any password hashed in MD5, MD4, SHA1, SHA3 and other hash functioning techniques with examples and practice questions.

By 
NAMAN AGGARWAL user avatar
NAMAN AGGARWAL
·
Updated Sep. 08, 20 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
31.1K Views

Join the DZone community and get the full member experience.

Join For Free

Hashcat claims to be the world’s fastest CPU and GPU password “recovery” tool. It is cross-platform, and available on Windows, macOS and Linux.

It supports a large variety of hashing algorithms, including LM Hash, NT hash, MD4, MD5, SHA-1, and 2 and many, many more. (Currently, it supports 237 different hash types)

The Basics

There are 4 arguments in the command used to crack the password. Below is the breakdown of the command.

Shell
 




x


 
1
.\hashcat -m 0 -a 0 .\crackme.txt .\rockyou.txt


-m(or --hash-type)

  1. For example, MD5, SHA1, etc.
  2. In the example, we will use “-m 0” which is for MD5.


  • -a(or –attack-mode)
    1. Tells hash cat how to crack passwords.
    2. For example, using a dictionary of words, or brute-force, or the famous combination attack.
    3. In the example, we will use “-a 0” to use a dictionary attack.
  • [filename]
    1. Specifies the location of the file containing the hash(es) you intend to crack
    2. In the example I have used “.\crackme.txt.
  • [dictionary | mask | directory]
    1. Specifies the dictionary(wordlist), mask, or directory to be used.
    2. In the example, we will use “.\rockyou.txt”

Installation and Setup

Visit the website- https://hashcat.net/hashcat/ 

Download the binary version of the two given zip files and extract them.

Run cmd and cd to the directory where the hashcat is extracted. To copy the path just refer to the pic below.


Path

When you are in the correct directory type the command to execute the hashcat.exe file. You will see the boilerplate of the command which is used as mentioned below.

Command boilerpate


Create a new text document inside the hashcat folder where your hashed passwords will be stored in my case its .\crackme.txt. Below is the list of test hashes that you can copy.

6c569aabbf7775ef8fc570e228c16b98

e10adc3949ba59abbe56e057f20f883e

25f9e794323b453885f5181f1b624d0

5f4dcc3b5aa765d61d8327deb882cf9

d8578edf8458ce06fbc5bb76a58c5ca4

fcea920f7412b5da7be0cf42b8c93759

96e79218965eb72c92a549dd5a330112

25d55ad283aa400af464c76d713c07ad

e99a18c428cb38d5f260853678922e03

7c6a180b36896a0a8c02787eeafb0e4c

3f230640b78d7e71ac5514e57935eb69

f6a0cb102c62879d397b12b62c092c06


NOTE: Add at least 5 hashes to test with at a time. If not done, Hashcat ignores them and gives you a message that it is exhausted.

You can also generate your own hashes here: https://passwordsgenerator.net/md5-hash-generator/

Now a create a dictionary file. Hashcat gives a pre-made dictionary called example(DICT file) either use that or create your own dictionary files.

You can find one here: https://www.scrapmaker.com/data/wordlists/dictionaries/rockyou.txt

The Final Command

Open cmd and make sure you are in the correct directory.

For different attack modes and hashing algorithms supported by Hashcat, type the following command and it will give you list of information.

Information from hashcat --help


Wide Range of Hash Algorithms


Here we are using dictionary attack (-a 0) on MD5 hash(-m 0).

Snippet from windows cmd


Some of the cracked hashed passwords.


Now a brilliant in-built feature of Hashcat appends all the cracked passwords in a potfile which you can see in the directory.

Comment the actual passwords of the remaining used in the test example.

If you want more tutorials with combinator attacks and brute-force attacks let me know in the comments.

Crack (password software)

Opinions expressed by DZone contributors are their own.

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!