LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-07-2009, 04:49 PM   #1
crypthelp
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
Need help duplicating password


Hello,

I am currently working on a project and have hit a brick wall.

I will try to keep this short... basically we have Coldfusion app that will be query'ing our LDAP server for a login page authentication. Since we can't decrypt the passwords stored we are going to encrypt the user-provided password and match the encrypted form to validate.

However, I can't seem to figure out how the system is encrypting things.

I found on an OpenLDAP mailing list that OpenLDAP just uses the system encryption.

The system is CentOS 4.7.

This is the output of /etc/sysconfig/authconfig:

USEMD5=yes
USECRACKLIB=yes
USEDB=no
USEHESIOD=no
USELDAP=yes
USENIS=no
USEPASSWDQC=no
USEWINBIND=no
USEKERBEROS=no
USELDAPAUTH=yes
USESHADOW=yes
USESMBAUTH=no
USEWINBINDAUTH=no
USELOCAUTHORIZE=yes
USEPAMACCESS=no
PASSWDALGORITHM=md5

While it says MD5, from what I can see it isn't just a normal md5 string (maybe has a salt added to it? If so, how do you get the salt?)

Maybe I'm completely on the wrong track, can anyone help?

The strings all start with "$1$" if that helps any.

Thank you so much!
 
Old 10-07-2009, 06:39 PM   #2
nomb
Member
 
Registered: Jan 2006
Distribution: Debian Testing
Posts: 675

Rep: Reputation: 58
Quote:
Originally Posted by crypthelp View Post
Hello,

I am currently working on a project and have hit a brick wall.

I will try to keep this short... basically we have Coldfusion app that will be query'ing our LDAP server for a login page authentication. Since we can't decrypt the passwords stored we are going to encrypt the user-provided password and match the encrypted form to validate.

However, I can't seem to figure out how the system is encrypting things.

I found on an OpenLDAP mailing list that OpenLDAP just uses the system encryption.

The system is CentOS 4.7.

This is the output of /etc/sysconfig/authconfig:

USEMD5=yes
USECRACKLIB=yes
USEDB=no
USEHESIOD=no
USELDAP=yes
USENIS=no
USEPASSWDQC=no
USEWINBIND=no
USEKERBEROS=no
USELDAPAUTH=yes
USESHADOW=yes
USESMBAUTH=no
USEWINBINDAUTH=no
USELOCAUTHORIZE=yes
USEPAMACCESS=no
PASSWDALGORITHM=md5

While it says MD5, from what I can see it isn't just a normal md5 string (maybe has a salt added to it? If so, how do you get the salt?)

Maybe I'm completely on the wrong track, can anyone help?

The strings all start with "$1$" if that helps any.

Thank you so much!
$1$ - magic
3fQZxCjC$ - salt
NyvYFE2.n4/h1mrXDTxqA0 - Hash

Python Example:

/etc/shadow
nomb:$1$3fQZxCjC$NyvYFE2.n4/h1mrXDTxqA0:14524:0:99999:7:::

>>> import crypt
>>> print crypt.crypt("password", "$1$3fQZxCjC$")
$1$3fQZxCjC$NyvYFE2.n4/h1mrXDTxqA0

You can either check the source for crypt to see how the crypt function works, or you can look here which is another function that does the same thing:

md5crypt

Last edited by nomb; 10-07-2009 at 06:40 PM.
 
Old 10-07-2009, 06:52 PM   #3
crypthelp
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nomb View Post
$1$ - magic
3fQZxCjC$ - salt
NyvYFE2.n4/h1mrXDTxqA0 - Hash

Python Example:

/etc/shadow
nomb:$1$3fQZxCjC$NyvYFE2.n4/h1mrXDTxqA0:14524:0:99999:7:::

>>> import crypt
>>> print crypt.crypt("password", "$1$3fQZxCjC$")
$1$3fQZxCjC$NyvYFE2.n4/h1mrXDTxqA0

You can either check the source for crypt to see how the crypt function works, or you can look here which is another function that does the same thing:

md5crypt
Thanks so much, I will give this a try tomorrow. I actually tried a variant of what you said but I believe I missed one part (ugh).

Not a cryptography person in the least.

Thanks again, much appreciated.
 
Old 10-07-2009, 07:11 PM   #4
nomb
Member
 
Registered: Jan 2006
Distribution: Debian Testing
Posts: 675

Rep: Reputation: 58
Quote:
Originally Posted by crypthelp View Post
Thanks so much, I will give this a try tomorrow. I actually tried a variant of what you said but I believe I missed one part (ugh).

Not a cryptography person in the least.

Thanks again, much appreciated.
Not a problem, enjoy.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
duplicating and backing up a server rblampain Linux - Server 4 09-30-2007 12:43 AM
Duplicating a Login Screen darknessvb Linux - Newbie 2 10-24-2004 01:52 AM
Duplicating Copyrighted CD's? The_Nerd Linux - Software 5 04-29-2004 03:02 PM
duplicating contents of a HD peterhf Linux - Hardware 9 08-12-2003 04:30 PM
duplicating a webserver jasoncngo Linux - Software 6 04-07-2003 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration