O'Reilly logo

Penetration Testing with Perl by Swizec Teller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cracking SHA1 and MD5

In the next few subsections, we will look at how we can use Perl to crack the commonly used SHA1 and less likely used MD5 password hashes. This is a simple task in Perl but, as previously mentioned, requires a lot of CPU power to accomplish and is very slow. We will simply perform the hashing process on each line from a password list file and compare its output to the compromised password hash value.

SHA1 cracking with Perl

In this section, we will use the SHA1 Perl module, Digest::SHA, to create the password hashes for comparison. We will also try to crack the SHA1 hashes that we obtained in Chapter 7, SQL Injection with Perl. If we recall those hashes and usernames, we have the following commands:

Table: users has record ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required