From: lupu-sax@typhoon.harvard.edu (Adam S. Lupu-Sax)
Subject: Re: Crack w/ C2 Security Enabled?
Date: 1997/10/01 [thread overview]
Message-ID: <xol90wdk03a.fsf@typhoon.harvard.edu> (raw)
In-Reply-To: 60e38r$q7c@nntp.dist.maricopa.edu
>>>>> "Thomas" == Thomas Bates <bates@atlantis.its.dist.maricopa.edu> writes:
Thomas> We're currently running C2 on most of our machines,
Thomas> with a few running 'standard' Digital UNIX.
Thomas> We'd like the ability of running crack 5 on our C2
Thomas> machines, just to doublecheck that the passwords, even
Thomas> though they passed the enhanced security check, are
Thomas> secure.
Thomas> Does anyone have any information on how to get the
Thomas> [hash in the same routine?] passwords out of the C2
Thomas> database?
The code below works on my system (DEC/OSF v 2.0). You run it
(as root) and it outputs a file called "translate.out" on which you can
run Crack5. Basically, it reads the protected password database and
creates a normal /etc/passwd style file.
It still isn't quite right. Not being a professional, I
didn't have time to figure out the details of the protected password
database. It works most of the time and once in a while it crashes
(without doing any damage, it just doesn't work). I guess I'm saying
"use at your own risk"
Good Luck.
-Adam
------------------------------------------------------------------------
/*
code for generating an ordinary /etc/passwd file from the
C2 one
*/
#include <pwd.h>
#include <sys/types.h>
#include <sys/security.h>
#include <prot.h>
int main(int argc, char *argv[])
{
char *filename="translate.out";
FILE *pwfile;
struct passwd *next_passwd;
struct pr_passwd *prot_passwd;
int good=1;
if (!(pwfile=fopen(filename,"w")))
{
printf("Error opening output file. Exiting.\n");
exit(1);
}
set_auth_parameters(); /* initialize database interface */
setpwent(); /* initialize ordinary database */
while (good)
{
next_passwd = getpwent(); /* get an entry from /etc/passwd */
if (next_passwd==NULL) good=0;
else
{
/* now get the protected entry for the same UID */
prot_passwd=getprpwuid(next_passwd->pw_uid);
/* put the crypted password field into the /etc/passwd style */
next_passwd->pw_passwd=prot_passwd->ufld.fd_encrypt;
/* write that entry to the output file */
putpwent(next_passwd, pwfile);
}
fflush(pwfile);
}
endprpwent(); /* close protected database */
endpwent(); /* close ordinary database */
}
--
____________________________________________________________
Adam Lupu-Sax <lupu-sax@typhoon.harvard.edu>
http://monsoon.harvard.edu/~lupu-sax
PGP public key: http://monsoon.harvard.edu/~lupu-sax/key.asc
prev parent reply other threads:[~1997-10-01 4:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-09-25 4:00 Crack w/ C2 Security Enabled? Thomas Bates
1997-09-25 4:00 ` changing "datasize" in DU 4.0 Dara Ghahremani
1997-09-26 4:00 ` Emmanuel Choquet
1997-09-29 4:00 ` Paul Hays
1997-10-01 4:00 ` Adam S. Lupu-Sax [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox