diff -up rcracki_mt_0.7.0_src/rcracki_mt/HashAlgorithm.cpp.openssl11 rcracki_mt_0.7.0_src/rcracki_mt/HashAlgorithm.cpp --- rcracki_mt_0.7.0_src/rcracki_mt/HashAlgorithm.cpp.openssl11 2012-10-28 22:40:58.000000000 +0100 +++ rcracki_mt_0.7.0_src/rcracki_mt/HashAlgorithm.cpp 2017-09-06 22:41:10.519418853 +0200 @@ -51,9 +51,9 @@ #endif #define MSCACHE_HASH_SIZE 16 -void setup_des_key(unsigned char key_56[], des_key_schedule &ks) +void setup_des_key(unsigned char key_56[], DES_key_schedule &ks) { - des_cblock key; + const_DES_cblock key; key[0] = key_56[0]; key[1] = (key_56[0] << 7) | (key_56[1] >> 1); @@ -65,7 +65,7 @@ void setup_des_key(unsigned char key_56[ key[7] = (key_56[6] << 1); //des_set_odd_parity(&key); - des_set_key(&key, ks); + DES_set_key(&key, &ks); } @@ -83,10 +83,10 @@ void HashLM(unsigned char* pPlain, int n pPlain[i] = 0; static unsigned char magic[] = {0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; - des_key_schedule ks; + DES_key_schedule ks; //setup_des_key(data, ks); setup_des_key(pPlain, ks); - des_ecb_encrypt((des_cblock*)magic, (des_cblock*)pHash, ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)magic, (const_DES_cblock*)pHash, &ks, DES_ENCRYPT); } void HashLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) @@ -95,7 +95,7 @@ void HashLMCHALL(unsigned char* pPlain, unsigned char pre_lmresp[21]; static unsigned char magic[] = {0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; static unsigned char spoofed_challange[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}; - des_key_schedule ks; + DES_key_schedule ks; memset (pass,0,sizeof(pass)); memset (pre_lmresp,0,sizeof(pre_lmresp)); @@ -103,19 +103,19 @@ void HashLMCHALL(unsigned char* pPlain, memcpy (pass,pPlain, nPlainLen); setup_des_key(pass, ks); - des_ecb_encrypt((des_cblock*)magic, (des_cblock*)pre_lmresp, ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)magic, (const_DES_cblock*)pre_lmresp, &ks, DES_ENCRYPT); setup_des_key(&pass[7], ks); - des_ecb_encrypt((des_cblock*)magic, (des_cblock*)&pre_lmresp[8], ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)magic, (const_DES_cblock*)&pre_lmresp[8], &ks, DES_ENCRYPT); setup_des_key(pre_lmresp, ks); - des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)pHash, ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)spoofed_challange, (const_DES_cblock*)pHash, &ks, DES_ENCRYPT); setup_des_key(&pre_lmresp[7], ks); - des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[8], ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)spoofed_challange, (const_DES_cblock*)&pHash[8], &ks, DES_ENCRYPT); setup_des_key(&pre_lmresp[14], ks); - des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[16], ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)spoofed_challange, (const_DES_cblock*)&pHash[16], &ks, DES_ENCRYPT); } @@ -125,14 +125,14 @@ void HashHALFLMCHALL(unsigned char* pPla static unsigned char magic[] = {0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; static unsigned char salt[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}; - des_key_schedule ks; + DES_key_schedule ks; unsigned char plain[8] = {0}; memcpy(plain, pPlain, nPlainLen); setup_des_key(plain, ks); - des_ecb_encrypt((des_cblock*)magic, (des_cblock*)pre_lmresp, ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)magic, (const_DES_cblock*)pre_lmresp, &ks, DES_ENCRYPT); setup_des_key(pre_lmresp, ks); - des_ecb_encrypt((des_cblock*)salt, (des_cblock*)pHash, ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)salt, (const_DES_cblock*)pHash, &ks, DES_ENCRYPT); } @@ -151,7 +151,7 @@ void HashNTLMCHALL(unsigned char* pPlain UnicodePlain[i * 2 + 1] = 0x00; } - des_key_schedule ks; + DES_key_schedule ks; unsigned char lm[21]; /*MD4_CTX ctx; @@ -164,13 +164,13 @@ void HashNTLMCHALL(unsigned char* pPlain lm[16] = lm[17] = lm[18] = lm[19] = lm[20] = 0; setup_des_key(lm, ks); - des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)pHash, ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)spoofed_challange, (const_DES_cblock*)pHash, &ks, DES_ENCRYPT); setup_des_key(&lm[7], ks); - des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[8], ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)spoofed_challange, (const_DES_cblock*)&pHash[8], &ks, DES_ENCRYPT); setup_des_key(&lm[14], ks); - des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[16], ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock*)spoofed_challange, (const_DES_cblock*)&pHash[16], &ks, DES_ENCRYPT); } /* @@ -276,68 +276,6 @@ void HashSHA1(unsigned char* pPlain, int void HashSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) { } #endif -/* -void HashRIPEMD160(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) -{ - RIPEMD160_CTX ctx; - RIPEMD160_Init(&ctx); - RIPEMD160_Update(&ctx, pPlain, nPlainLen); - RIPEMD160_Final(pHash, &ctx); - - //RIPEMD160(pPlain, nPlainLen, pHash); -} -*/ - -/* -void HashMSCACHE(unsigned char *pPlain, int nPlainLen, unsigned char* pHash) -{ - char unicode_pwd[256]; - char unicode_user[256]; - static unsigned char username[] = "administrator"; - static int userlen = 13; - unsigned char final1[MD4_DIGEST_LENGTH]; - MD4_CTX ctx; - int i; - -// strcpy (username, "administrator"); -// userlen = 13; - - for (i=0; i<nPlainLen; i++) - { - unicode_pwd[i*2] = pPlain[i]; - unicode_pwd[i*2+1] = 0x00; - } - - for (i=0; i<userlen; i++) - { - unicode_user[i*2] = username[i]; - unicode_user[i*2+1] = 0x00; - } - - MD4_NEW( (unsigned char*)unicode_pwd, nPlainLen*2, final1 ); - - MD4_Init(&ctx); - MD4_Update(&ctx,final1,MD4_DIGEST_LENGTH); - MD4_Update(&ctx,(unsigned char*) unicode_user,userlen*2); - MD4_Final(pHash,&ctx); - - /* - unsigned char unicode_pwd[256]; - for (int i=0; i<nPlainLen; i++) - { - unicode_pwd[i*2] = pPlain[i]; - unicode_pwd[i*2+1] = 0x00; - }*/ - /* - unsigned char *buf = (unsigned char*)calloc(MSCACHE_HASH_SIZE + nSaltLength, sizeof(unsigned char)); - HashNTLM(pPlain, nPlainLen, buf, NULL); - //MD4(unicode_pwd, nPlainLen*2, buf); - memcpy(buf + MSCACHE_HASH_SIZE, pSalt, nSaltLength); - MD4(buf, MSCACHE_HASH_SIZE + nSaltLength, pHash); - free(buf); - */ -//} - //********************************************************************************* // Code for MySQL password hashing //*********************************************************************************