Unix Technical Forum

passwd file

This is a discussion on passwd file within the Linux Operating System forums, part of the Unix Operating Systems category; --> I have a password file that looks like so. matthew:38GB3fsjfwH7Y etc. Can anyone tell me how this hashed password ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 06:57 AM
Matt
 
Posts: n/a
Default passwd file

I have a password file that looks like so.

matthew:38GB3fsjfwH7Y
etc.

Can anyone tell me how this hashed password is generated? I know its a one
way hash and I cannot reverse it. I just want to know how the output was
created.

Basically I have nearly a thousand usernames and passwords to add to a email
server and I want to cheat and write a script to automate it and dump
directly into file rather then use web GUI.

Matt


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 06:57 AM
IANAL_VISTA
 
Posts: n/a
Default Re: passwd file

"Matt" <nospam_ng@fileholder.net> wrote in
news:10rpl6qeurcfv1c@corp.supernews.com:

> I have a password file that looks like so.
>
> matthew:38GB3fsjfwH7Y
> etc.
>
> Can anyone tell me how this hashed password is generated? I know its
> a one way hash and I cannot reverse it. I just want to know how the
> output was created.
>
> Basically I have nearly a thousand usernames and passwords to add to a
> email server and I want to cheat and write a script to automate it and
> dump directly into file rather then use web GUI.
>


What part of "one way hash" do you NOT understand?

Why do think you can "cheat"?

If you could "cheat", what does that say about the security of linux?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-18-2008, 06:57 AM
chabral
 
Posts: n/a
Default Re: passwd file

"Matt" <nospam_ng@fileholder.net> escribió en el mensaje
news:10rpl6qeurcfv1c@corp.supernews.com...
> I have a password file that looks like so.
>
> matthew:38GB3fsjfwH7Y
> etc.
>
> Can anyone tell me how this hashed password is generated? I know its a

one
> way hash and I cannot reverse it. I just want to know how the output was
> created.
>
> Basically I have nearly a thousand usernames and passwords to add to a

email
> server and I want to cheat and write a script to automate it and dump
> directly into file rather then use web GUI.
>
> Matt
>

I don't think you'll succeed with this plan... unless you find a way to make
your mail server use the system password database for authentication, or at
least use the same method.
One thing to keep in mind, is that mail passwords on many protocols are sent
unencrypted over the network, so anyone sniffing can see them, and If
they're the same passwords to access the system, the "bad guy" can not only
read users emails, but also access the system...
Good luck,

--
chabral


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-18-2008, 06:57 AM
Juha Laiho
 
Posts: n/a
Default Re: passwd file

"Matt" <nospam_ng@fileholder.net> said:
>I have a password file that looks like so.
>
>matthew:38GB3fsjfwH7Y
>etc.
>
>Can anyone tell me how this hashed password is generated? I know its a one
>way hash and I cannot reverse it. I just want to know how the output was
>created.


The two first characters are 'salt' used for the hashing, the rest is the
hash result of 'crypt()'.

An example to hash the word 'password' with salt 'xx' in perl:
perl -e 'print crypt("password","xx"),"\n";'

The salt used should be random (esp. DO NOT pick initial two characters of
the password), and should consist of two characters from set
'.', '/', 0..9, 'A'..'Z', 'a'..'z' .
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-18-2008, 06:58 AM
Moe Trin
 
Posts: n/a
Default Re: passwd file

In article <10rpl6qeurcfv1c@corp.supernews.com>, Matt wrote:

>I have a password file that looks like so.
>
>matthew:38GB3fsjfwH7Y
>etc.


Interesting - most distributions have moved to the shadow password mode.

>Can anyone tell me how this hashed password is generated?


Depends on your distribution - some use crypt(3) which is DES, some use
other algorithms. See that crypt man page for details.

>Basically I have nearly a thousand usernames and passwords to add to a email
>server and I want to cheat and write a script to automate it and dump
>directly into file rather then use web GUI.


Again - it depends on the distribution.

[compton ~]$ whatis chpasswd
chpasswd (8) - update password file in batch
[compton ~]$

You may want to have a look in 'alt.os.linux' - as there is a thread titled
'script for creating bulk users' that might help you.

Old guy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-18-2008, 06:58 AM
Matt
 
Posts: n/a
Default Re: passwd file

>>I have a password file that looks like so.
>>
>>matthew:38GB3fsjfwH7Y
>>etc.
>>
>>Can anyone tell me how this hashed password is generated? I know its a
>>one
>>way hash and I cannot reverse it. I just want to know how the output was
>>created.

>
> The two first characters are 'salt' used for the hashing, the rest is the
> hash result of 'crypt()'.
>
> An example to hash the word 'password' with salt 'xx' in perl:
> perl -e 'print crypt("password","xx"),"\n";'


This is exactly the info I needed. I was able to export my database to a
report then with a script parse it and create a passwd file. Saved me a lot
of typing.

Thanks.

Matthew


> The salt used should be random (esp. DO NOT pick initial two characters of
> the password), and should consist of two characters from set
> '.', '/', 0..9, 'A'..'Z', 'a'..'z' .
> --
> Wolf a.k.a. Juha Laiho Espoo, Finland
> (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
> PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
> "...cancel my subscription to the resurrection!" (Jim Morrison)



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:40 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com