Cisco Password 7方式的密码破解程序

2008-12-29 电脑网络 1364 阅读 0 评论

密码以 cisco 为例!

首先在特权模式下 sh run 查看加密后的密码:

line vty 0 4
password 7 0822455D0A16
login

然后在cmd命令提示符中,输入:

cp7 0822455D0A16

就能显示出明文密码。
下载地址:Cisco_Password_7.rar

程序源码如下:

/*
* * 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 
#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, 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 = 'A' && enc_pw[i] \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;
} 

本文链接:https://blog.clang.cn/513.html

版权声明:转载请注明出处。

评论 (0)

评论已关闭