深 圳 东 莞 香 港 北 京 上 海 成 都
重 庆 南 京 西 安 广 元 柳 州 南 宁
繁體 ENGLISH
联系我们
众成深圳 0755-83013835
众成香港 0852-92522538
马来西亚 +60333246385
众成上海 13162531849
众成成都 028-85241794
众成重庆 13996297205
众成西安 15829886958
众成广元 0839-8808158
众成柳州 0772-7377391
众成温州 0577-68697650
您所在的位置是:首页 》信息中心 》 黑客防线

cisco password7方式密码破解

cisco password7方式的密码破解程序
/*
* * descambles cisco IOS type-7 passwords
* * found somewhere on the internet, slightly modified, anonymous@segfault.net
* *
* * gcc -Wall -o ciscocrack ciscocrack.c
* * ./ciscocrack 01178E05590909022A
* *
* */

#include <stdio.h>
#include <ctype.h>

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


int
cdecrypt(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);
}

void
usage()
{
        fprintf(stdout, "Usage: ciscocrack <encrypted password>\n");
}

int
main(int argc, char *argv[])
{
    char passwd[65];

    memset(passwd, 0, sizeof(passwd));

    if(argc != 2)
    {
          usage();
          exit(1);
    }

    if(cdecrypt(argv[1], passwd)) {
          fprintf(stderr, "Error\n");
          exit(1);
    }
    printf("Passwd: %s\n", passwd);

    return 0;

 
 

地址:深圳市福田区华强北新亚洲电子商城二期国利大厦6楼635室         邮编:518031
电话:0755-25083835    83013835    82543635    13713907515    13164784245    QQ:906831882
传真:0755-82543635            联系人:王先生            邮箱:wxj810@126.com   粤icp备09013775号