Jump to content
Nytro

"Cracking" Hashes with recon-ng and bozocrack

Recommended Posts

[h=3]"Cracking" Hashes with recon-ng and bozocrack[/h]The other day I came across a database dump that had user login names and hashed passwords. I had over 1,000 of them and they were SHA256 hashes. I remembered that there was some tool that could perform Google look-ups for hashes and asked the Twitter-verse for help. Wouldn't you know that the first person to reply was Tim Tomes who said that the bozocrack module inside recon-ng could do exactly what I wanted. Excellent!

This blog post is a walk-through of that process.

[h=3]Pulling our Hashes from a File[/h] First thing we need to do is get the hashes. Let's say I have all my hashes in a files called, oh I don't know "hashes" and I'll put them on the Desktop of my Kali linux system. So the file will be located at /root/Desktop/hashes.

Launch recon-ng and create a workspace named "hashes" (or whatever you want) for this work. Workspaces allow us to logically partition our work so that if we have several projects or customers that we are doing work for simultaneously, their data doesn't get co -mingled.

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]recon-ng_start.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]recon-ng launched from inside a terminal[/TD]

[/TR]

[/TABLE]

Now let's tell recon-ng to load the bozocrack module. Since it is the only module with "bozo" in it, we can use a shortcut and just type load bozo as shown below. I also used the show info command to get information about the module I just loaded.

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]bozo_info.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]Loading the bozocrack module and showing the info[/TD]

[/TR]

[/TABLE]

The important part of this step is to see all of the options that you can configure. In this case the SOURCE variable is the only option to modify. By default, the module pulls information from the credentials table inside the recon-ng database. But we can tell it to use a different location as the source of our hashes. Let's do that first.

We know from above that our file with the hashes is at /root/Desktop/hashes. We change where the module looks for the source using the set command: set SOURCE /root/Desktop/hashes (as shown below).

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]start.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]All set to run the bozocrack module using the hashes file[/TD]

[/TR]

[/TABLE]

At this point, we just type run and grab a $cold_beverage. The module will make Google queries for each hash in the file you specified and it'll display the results on the screen. Below is what mine looked like once it finished.

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]done_soucefile.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]bozocrack module output[/TD]

[/TR]

[/TABLE]

You can see that the hashes it found a match for start with a green "splat"/asterix

[*]. Also note that there were three types of hashes in my file: MD5, SHA1, and SHA256. Pretty cool that the module just took them all and didn't make me separate them into separate files. +1 for recon-ng

So that is the easy way for doing the lookups. You can easily scrape the terminal window screen and copy all the found hashes into a text editor for post-processing. That works....but I'm a lazy guy. I like to have my tools do the work. So, let's do it another way too.

[h=3]Using the Internal DB[/h] As I mentioned above, recon-ng maintains a database for its findings. To see all the tables and such, type show schema and they will appear.

We are going to be storing our password hashes in the hash column of the credentials table. First thing I do is to import all my hashes into the DB using the import/csv_file module. Just type use import/csv and hit enter (since the csv_file is the only file with CSV in it inside the import path, you don't have to complete the whole name. Like I said, I'm lazy!). Again I like doing a show info to see what options there are.

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]csv_import_start.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]Import/csv_file module[/TD]

[/TR]

[/TABLE]

OK, so we need to set the FILENAME option (set FILENAME /root/Desktop/hashes) and also the TABLE (set TABLE credentials). Now that we have those fields entered, if we do another show info we can see that there is now another option to change. See the "CSV_####..." column in the picture below? recon-ng is telling us it found content and wants to know where to put it. So we type set CSV_[ENTERTHENUMBER] hash as shown below.

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]csv_import_info.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]Import/csv_file module with column recognized[/TD]

[/TR]

[/TABLE]

Now we have to go back to the bozocrack module (load bozocrack). Since we ran the module already using the SOURCE of a file, we'll need to switch from the file for the SOURCE to the default (set SOURCE default) as the default uses the contents of the DB. Oh, want to check if your hashes loaded OK? Type show credentials and you'll see the hashes in their proper column (below).

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]show_cred_before.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]Credentials table before bozocrack[/TD]

[/TR]

[/TABLE]

OK, let's kick this off using the run command and let 'er rip. We will see the same output from when we ran the bozocrack module above but this time the bozocrack module will store the results in the DB. To show this, just type show credentials again and you should see more of the columns filled out (like the pic below).

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]show_cred_after.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]Credentials table after bozocrack[/TD]

[/TR]

[/TABLE]

Yay! We got them in the DB but how to we get them out? Of course there is a module for that. Type load reporting/csv to load that module. show info will tell you what options there are. We see (below) that we need to alter the FILENAME (set FILENAME /root/Desktop/recon-ng_hashes_out) and TABLE (set TABLE credentials) and then type run. Magic!

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]output1.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]Using the reporting/csv output module[/TD]

[/TR]

[/TABLE]

On your desktop should be a CSV file with your hashes, what type of hashes they are, and the cleartext passwords in it (like the one below).

[TABLE=class: tr-caption-container, align: center]

[TR]

[TD=align: center]hashes_cracked.png[/TD]

[/TR]

[TR]

[TD=class: tr-caption, align: center]Exported CSV report from recon-ng[/TD]

[/TR]

[/TABLE]

Hope this was helpful!

Sursa: Hacking and Hiking: "Cracking" Hashes with recon-ng and bozocrack

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...