global security disclosure

apoc-crack.c

apoc-crack.c
Posted Aug 17, 1999
Authored by Adam Rogoyski

Simple brute force unix password cracker on a single password which try's all combinations of every printable 7-bit ascii character. C code.

tags | cracker
systems | unix
MD5 | b1528f1bbe0fff13e645939ce96da60b

apoc-crack.c

Change Mirror Download
/* apoc-crack.c by Adam Rogoyski (apoc@laker.net) Temperanc on EFNet irc
* Copyright (C) 1997 Adam Rogoyski
* Simple Brute Force unix password cracker, tries every printable 7-bit
* ascii characters.
* warning: This program may take thousands of years to finish one run.
* usage: ./apoc-crack [file with encrypted password in it]
* compile: gcc -o apoc-crack apoc-crack.c
* --- GNU General Public License Disclamer ---
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

#include <crypt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

int
main (int argc, char **argv)
{
char salt[3];
char encrypted[14];
FILE *fp;
char *temp = malloc(14 * sizeof(char));
char temppw[9];
int flag = 0;
char i = 0; char j = 0; char k = 0; char l = 0;
char m = 0; char n = 0; char o = 0; char p = 0;
if (argc == 2)
{
if ((fp = fopen(argv[1], "r")) == NULL)
exit (EXIT_FAILURE);
else
{
fgets (encrypted, 14, fp);
salt[0] = encrypted[0];
salt[1] = encrypted[1];
salt[2] = '\0';
}
}
else
exit (EXIT_FAILURE);
temppw[1] = '\0';
for (i = 33; i < 126; i++)
{
temppw[0] = i;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
}
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password is at least 2 Characters Long\n"); }

temppw[2] = '\0';
for (i = 33; i < 126; i++) {
if (flag) { exit (EXIT_SUCCESS); }
for (j = 33; j < 126; j++)
{
temppw[0] = i; temppw[1] = j;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
} }
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password is at least 3 Characters Long\n"); }


temppw[3] = '\0';
for (i = 33; i < 126; i++) {
for (j = 33; j < 126; j++) {
if (flag) { exit (EXIT_SUCCESS); }
for (k = 33; k < 126; k++)
{
temppw[0] = i; temppw[1] = j; temppw[2] = k;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
} } }
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password is at least 4 Characters Long\n"); }


temppw[4] = '\0';
for (i = 33; i < 126; i++) {
for (j = 33; j < 126; j++) {
for (k = 33; k < 126; k++) {
if (flag) { exit (EXIT_SUCCESS); }
for (l = 33; l < 126; l++)
{
temppw[0] = i; temppw[1] = j; temppw[2] = k; temppw[3] = l;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
} } } }
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password is at least 5 Characters Long\n"); }


temppw[5] = '\0';
for (i = 33; i < 126; i++) {
for (j = 33; j < 126; j++) {
for (k = 33; k < 126; k++) {
for (l = 33; l < 126; l++) {
if (flag) { exit (EXIT_SUCCESS); }
for (m = 33; m < 126; m++)
{
temppw[0] = i; temppw[1] = j; temppw[2] = k; temppw[3] = l;
temppw[4] = m;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
} } } } }
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password is at least 6 Characters Long\n"); }


temppw[6] = '\0';
for (i = 33; i < 126; i++) {
for (j = 33; j < 126; j++) {
for (k = 33; k < 126; k++) {
for (l = 33; l < 126; l++) {
for (m = 33; m < 126; m++) {
if (flag) { exit (EXIT_SUCCESS); }
for (n = 33; n < 126; n++)
{
temppw[0] = i; temppw[1] = j; temppw[2] = k; temppw[3] = l;
temppw[4] = m; temppw[5] = n;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
} } } } } }
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password is at least 7 Characters Long\n"); }


temppw[7] = '\0';
for (i = 33; i < 126; i++) {
for (j = 33; j < 126; j++) {
for (k = 33; k < 126; k++) {
for (l = 33; l < 126; l++) {
for (m = 33; m < 126; m++) {
for (n = 33; n < 126; n++) {
if (flag) { exit (EXIT_SUCCESS); }
for (o = 33; o < 126; o++)
{
temppw[0] = i; temppw[1] = j; temppw[2] = k; temppw[3] = l;
temppw[4] = m; temppw[5] = n; temppw[6] = o;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
} } } } } } }
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password is at least 8 Characters Long\n"); }


temppw[8] = '\0';
for (i = 33; i < 126; i++) {
for (j = 33; j < 126; j++) {
for (k = 33; k < 126; k++) {
for (l = 33; l < 126; l++) {
for (m = 33; m < 126; m++) {
for (n = 33; n < 126; n++) {
for (o = 33; o < 126; o++) {
if (flag) { exit (EXIT_SUCCESS); }
for (p = 33; p < 126; p++)
{
temppw[0] = i; temppw[1] = j; temppw[2] = k; temppw[3] = l;
temppw[4] = m; temppw[5] = n; temppw[6] = o; temppw[7] = p;
temp = (char *) crypt(temppw, salt);
if (strcmp(encrypted, temp) == 0)
{
printf ("%s = %s \a\n", encrypted, temppw);
flag = 1;
break;
}
} } } } } } } }
if (flag) { exit (EXIT_SUCCESS); }
else { printf ("Password uses characters other than 7-bit Ascii\n"); }

return EXIT_SUCCESS;
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close