Solved

Name that hash

Posted on 2004-10-12
9
306 Views
Last Modified: 2010-04-11
I've got a hash here that is being generated by vpopmail, and I can't figure out what it is.. any ideas?

$1$E7Cjw3O9$U./qIyj3rWueCgTLGrx/3.
that is the hashed version of "password"

Once it's identified, I will use it to script password changes, so I also need to know of a unix/linux program that can be used to hash text like that.  A quick check says it's not MD5 or SHA-1..  
0
Comment
Question by:Chireru
  • 4
  • 3
  • 2
9 Comments
 
LVL 2

Expert Comment

by:ThePCNerd
ID: 12292703
No, that is neither MD5 nor SHA-1 of "password" it looks like a code obfuscator which means that is just replaced with random text.

And if that is obfuscated they are sending a message that they dont want people editing or using thier code.

Your best bet is printing the variable to see what's in it.
0
 
LVL 2

Expert Comment

by:ThePCNerd
ID: 12292711
I have seen that type of hash before, i forgot where I beleive it was a windows xp user password hash (actually encryption not hash cuz it can be reversed)
0
 
LVL 5

Author Comment

by:Chireru
ID: 12294468
It could be encryption...  it's vpopmail storing it.. as far as I know, that is only used by qmail upon smtp authentication.. all other pop/etc communications use a cleartext password..

It reminds me of the passwords cisco IOS uses when automatic password encryption (level 7) is on.
0
Register Today - IoT Current and Future Threats

Are you prepared to protect your organization from current and future IoT Threats?  Join our Wi-Fi expert in episode three of our webinar series for a look at the current state of Wi-Fi IoT and what may lie ahead. Register for our live webinar on April 20th at 9 am PDT!

 
LVL 3

Expert Comment

by:_anom_
ID: 12294622
It is definitely MD5, JTR confirms it
---JTR---
Loaded 1 password (FreeBSD MD5 [32/32])
password             (blah)
guesses:1   time: 0:00:00:00 100% (2)  c/s: 806  trying: password
---/JTR---

you can tell it's MD5 cuz it has the $1$ followed by an 8 char salt followed by the 22 char hash.

Cheers
0
 
LVL 5

Author Comment

by:Chireru
ID: 12294667
anom:  How would I go about creating that hash..  how would I go about taking "password" and converting it to that?
0
 
LVL 3

Accepted Solution

by:
_anom_ earned 250 total points
ID: 12294796
After a bit of looking, I found a some perl code that will work nicely.  Create a file that contains the following:
----Begin file----
#!/usr/bin/perl

use Crypt::PasswdMD5

chomp(my $password = <STDIN>);
chomp(my $salt = <STDIN>);

$crypted = unix_md5_crypt($password, $salt);

print "$crypted\n";
----End File----

that program will read in two lines from the keyboard -- the first of which is the password (in this case "password") and second
it will read in the salt (in this case "$1$E7Cjw3O9").  I don't know how you are applying this, so you may or may not wish to use the same salt every time.
Note, you will need the crypt-passwdmd5 module to make this work.
0
 
LVL 5

Author Comment

by:Chireru
ID: 12298462
That did it, thanks a lot :)
Your program is a little bit broken, but I got the idea, and a working version.

For changing the salt, it's just generating a random 8-byte string, right?
0
 
LVL 3

Expert Comment

by:_anom_
ID: 12298565
Yep, just make sure you still pass $1$ + the salt because I think the unix crypt function requires it.

Cheers
0
 
LVL 5

Author Comment

by:Chireru
ID: 12298777
Just tested it, it works without the $1$, at least on FreeBSD, but I'll put it in anyway.

Thanks again.
0

Featured Post

Watch Anatomy of a Wi-Fi Hack On-Demand

In less than a weekend, anyone with Internet access and some free time can become a Wi-Fi MitM to wreak havoc on your network. View our Wi-Fi Expert in an on-demand episode of our Secure Wi-Fi mini-series as he explores the motives, execution, and anatomy of a Wi-Fi hack.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question