(fwd) cisco password encryption (type 7)

Andrey Gerzhov (kittle@freeland.alex-ua.com)
Tue, 9 Dec 1997 03:40:50 +0200 (EET)

-- forwarded message --
Path: freeland.alex-ua.com!barmaglot.alex-ua.com!f188.n463.z2!f116.n463.z2!f58.n463!f238.n5020!f64.n5049!f12.n5049!f49.n5049!not-for-mail
Newsgroups: fido.ru.nethack
Distribution: fido
X-Comment-To: All
From: Timur Hi-Rullin <Timur.Hi-Rullin@f49.n5049.z2.fidonet.org>
Date: Mon, 01 Dec 97 14:30:10 +0200
Subject: cisco password encryption (type 7)
Message-ID: <880986619@f49.n5049.z2>
Organization: hMMM... wHERE iS mY cAPSlOCK?... %-O
X-FTN-FLAGS: PVT
X-FTN-AREA: RU.NETHACK
X-FTN-FWDFROM: Alexey Pilieff
X-FTN-FWDTO: Tatiana Gudkova
X-FTN-FWDSUBJ: cisco password encryption (type 7)
X-FTN-FWDMSGID: 2:5100/50 347edb71
X-FTN-FWDORIG: 2:5100/50
X-FTN-FWDAREA: RU.CISCO
X-FTN-MSGID: 2:5049/49 3482c9fb
X-FTN-PID: FleetStreet 1.18+
X-FTN-RealName: ôÉÍÕÒ èÁÊÒÕÌÌÉÎ
X-FTN-Tearline: tim@zarech.tatincom.ru
X-FTN-Origin: hMMM... wHERE iS mY cAPSlOCK?... %-O (2:5049/49)
X-FTN-SEEN-BY: 463/58 72 116 159 188 690 691 6666 4614/1 6 4615/21 4631/13 5000/7
X-FTN-SEEN-BY: 5020/204 238 443 927 5023/11 5027/16 5032/6 5040/6 47 5049/5 9 12
X-FTN-SEEN-BY: 5049/17 19 30 35 36 49 64 66 96 256 5054/9 5065/10 5075/10 5077/3
X-FTN-SEEN-BY: 5077/38 5084/10
X-FTN-PATH: 5049/49 12 64 5020/238 463/58 116
X-FTN-PATH: 463/188
Lines: 192
Xref: freeland.alex-ua.com fido.ru.nethack:571

Hi

:)

¥
ƒ *Forwarded by* Timur Hi-Rullin (2:5049/49)
ƒ *Area* : RU.CISCO (Auto-created by fastecho area...)
ƒ *From* : Alexey Pilieff , 2:5100/50 (28/11/97 14:27:26)
ƒ *To* : Tatiana Gudkova ()
ƒ *Subj* : cisco password encryption (type 7)
 

Hello Tatiana!


þÅÔ×ÅÒÇ  ÏÑÂÒØ 27 1997 17:58, Tatiana Gudkova wrote to Dmitry Valdov:

 DV>> ëÓÔÁÔÉ, ÎÁpÏÄ × ËÕpÓÅ, ÞÔÏ
 DV>> password 7 XXXXXX pÁÓÛÉÆpÏ×Ù×ÁÅÔÓÑ ÂÅÚ ÐpÏÂÌÅÍ?
 TG> á ËÁË, ËÓÔÁÔÉ? ðÏ ËÁËÏÍy ÁÌÇÏpÉÔÍy ÈÜÛÉpyÅÔÓÑ? íÏÖÅÔ ÐpÏÇÁ ËÁËÁÑ ÅÓÔØ?

íÏÖÅÔ É ÅÓÔØ

=== Cut ===
/*
 * Cisco password decrypter V2.0
 *  (c) 1995 by SPHiXe
 *
 * DISCLAIMER: The author of this program takes no responsibility for
 *             neither direct nor indirect damages caused by this program.
 *             Misuse of this program may lead to serious problems with
 *             your local authorities...
 *             You should know what you're doing.
 */


#include 
#include 

char xlat[] = {
 0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f,
 0x41, 0x2c, 0x2e, 0x69, 0x79, 0x65, 0x77, 0x72,
 0x6b, 0x6c, 0x64, 0x4a, 0x4b, 0x44
};

char pw_str1[] = "password 7 ";
char pw_str2[] = "enable-password 7 ";

char *pname;

cdecrypt(enc_pw, dec_pw)
char *enc_pw;
char *dec_pw;
{
 unsigned int seed, i, val = 0;

 if(strlen(enc_pw) & 1)
  return(-1);

 seed = (enc_pw[0] - '0') * 10 + enc_pw[1] - '0';

 if (seed > 15 || !isdigit(enc_pw[0]) || !isdigit(enc_pw[1]))
  return(-1);

 for (i = 2 ; i <= strlen(enc_pw); i++) {
  if(i !=2 && !(i & 1)) {
   dec_pw[i / 2 - 2] = val ^ xlat[seed++];
   val = 0;
  }

  val *= 16;

  if(isdigit(enc_pw[i] = toupper(enc_pw[i]))) {
   val += enc_pw[i] - '0';
   continue;
  }

  if(enc_pw[i] >= 'A' && enc_pw[i] <= 'F') {
   val += enc_pw[i] - 'A' + 10;
   continue;
  }

  if(strlen(enc_pw) != i)
   return(-1);
 }

 dec_pw[++i / 2] = 0;

 return(0);
}

main(argc,argv)
int argc;
char **argv;

{
 FILE *in = stdin, *out = stdout;
 char line[257];
 char passwd[65];
 unsigned int i, pw_pos;

 pname = argv[0];

 if(argc > 1)
 {
  if(argv[1][0] == '-')
  {
   switch(argv[1][1]) {
    case 'p':
    if(cdecrypt(argv[2], passwd)) {
     fprintf(stderr, "Error.\n");
     exit(1);
    }
    fprintf(stdout, "password: %s\n", passwd);
    break;

    default:
    fprintf(stderr, "%s: unknow option.", pname);
   }

   return(0);
  }

  if((in = fopen(argv[1], "rt")) == NULL)
   exit(1);
  if(argc > 2)
   if((out = fopen(argv[2], "wt")) == NULL)
    exit(1);
 }

 while(1) {
  for(i = 0; i < 256; i++) {
   if((line[i] = fgetc(in)) == EOF) {
    if(i)
     break;

    fclose(in);
    fclose(out);
    return(0);
   }
   if(line[i] == '\r')
    i--;

   if(line[i] == '\n')
    break;
  }
  pw_pos = 0;
  line[i] = 0;

  if(!strncmp(line, pw_str1, strlen(pw_str1)))
   pw_pos = strlen(pw_str1);

  if(!strncmp(line, pw_str2, strlen(pw_str2)))
   pw_pos = strlen(pw_str2);

  if(!pw_pos) {
   fprintf(stdout, "%s\n", line);
   continue;
  }

  if(cdecrypt(&line[pw_pos], passwd)) {
   fprintf(stderr, "Error.\n");
   exit(1);
  }
  else {
   if(pw_pos == strlen(pw_str1))
    fprintf(out, "%s", pw_str1);
   else
    fprintf(out, "%s", pw_str2);

   fprintf(out, "%s\n", passwd);
  }
 }
}
=== Cut ===



 TG> Tanya.


For short messages (7bit only)


-!- /usr/local/sbin/vi
 ! Origin:  (2:5100/50)



            .
          /t[mson          [Team pÁÎÏ ×ÓÔÁ×ÁÔØ suxx]
                           [Team ÐÏ×pÅÍÅÎËÁ mustdie]

-- end of forwarded message --

-- 




                                                      Kittle