aix2passwd converts the AIX shadow passwd (located in /etc/security/passwd) into a regular crackable passwd file, which can be cracked with any password auditing tool.
9d80b662e5db3010c29386a3f63cdb0de68f428134449a4a02ba2dac7bd9407d
/* :: aix2passwd ::
*
* converts the AIX shadow passwd (located in /etc/security/passwd)
* into a regular crackable passwd file.
*
* Compile: cc -o aix2passwd aix2passwd.c
*
* Usage: ./aix2passwd aix-passwd > newfile
*
* Manor G. (manor@enforcers.net) * 28.10.00 *
*
*/
#include <stdio.h>
#include <stdlib.h>
FILE *fp;
char line[80],line2[80];
char *password;
int i;
int main(int argc, char *argv[])
{
if (argc!=2) /* checks arguments */
{
printf("[::] Usage: ./aix2pass <aix-passwd>\n");
exit(1);
}
if ((fp = fopen(argv[1], "r")) == NULL) /* opens file for read */
{
printf("[::] Error Opening File!");
exit(1);
}
while (!feof(fp))
{
fgets(line, 80, fp);
if (strchr(line, ':'))
{
fgets(line2, 80, fp);
password = strstr(line2, "= ");
for (i=0; i<(strlen(line)-1); i++) printf("%c", line[i]);
for (i=2; i<(strlen(password)-1); i++) printf("%c", password[i]);
printf("\n");
}
}
return 0;
fclose(fp);
}
/* eof :) */