From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,840dabcd23740ed0 X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,840dabcd23740ed0 X-Google-Attributes: gidf678f,public From: lupu-sax@typhoon.harvard.edu (Adam S. Lupu-Sax) Subject: Re: Crack w/ C2 Security Enabled? Date: 1997/10/01 Message-ID: #1/1 X-Deja-AN: 277051823 Sender: lupu-sax@typhoon.harvard.edu References: <60e38r$q7c@nntp.dist.maricopa.edu> Organization: Harvard University Physics Newsgroups: comp.unix.osf.misc,comp.unix.osf.osf1 >>>>> "Thomas" == Thomas Bates 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 #include #include #include 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 http://monsoon.harvard.edu/~lupu-sax PGP public key: http://monsoon.harvard.edu/~lupu-sax/key.asc