📄 make_hash.c
字号:
/* This file is part of Ophcrack (Time-Memory-Trade-Off-crack). Ophcrack is a Lanmanager/NTLM hash cracker based on the faster time-memory trade-off using rainbow tables. Created with the help of: Maxime Mueller, Luca Wullschleger, Claude Hochreutiner and Andreas Huber. Copyright 2004 Philippe Oechslin Ophcrack is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Ophcrack is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Ophcrack; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/#include "make_hash.h"#include <string.h>#include <netinet/in.h>/* LanManager hash functions (libdes version and Jack the ripper MMX version) */static char rcsid[] = "$Id: make_hash.c,v 1.0 2004/07/09 12:54:15 oechslin Exp $";/* * $Log: make_hash.c,v $ * Revision 1.0 2004/07/09 12:54:15 oechslin * Initial revision * */unsigned char magic[] = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 };void make_hash(unsigned char *str, unsigned char *out) { static unsigned char key[8]; des_key_schedule ks; key[0]=str[0]; key[1]= (str[0] << 7) | (str[1] >> 1); key[2] = (str[1] << 6) | (str[2] >> 2); key[3] = (str[2] << 5) | (str[3] >> 3); key[4] = (str[3] << 4) | (str[4] >> 4); key[5] = (str[4] << 3) | (str[5] >> 5); key[6] = (str[5] << 2) | (str[6] >> 6); key[7] = (str[6] << 1) ; des_set_odd_parity(&key); des_set_key(&key, ks); des_ecb_encrypt((des_cblock *)magic, (des_cblock *)out, ks, DES_ENCRYPT);}void make_nthash(char *pw, char *out) { size_t unipwlen; unsigned short int unipw[128]; unsigned char *s; MD4_CTX ctx; /* convert to unicode */ for (unipwlen = 0, s = pw; unipwlen < strlen(pw); s++) { unipw[unipwlen++] = htons(*s << 8); } /* Compute MD4 of Unicode password */ MD4_Init(&ctx); MD4_Update(&ctx, (unsigned char *) unipw, unipwlen * sizeof(*unipw)); MD4_Final(out, &ctx);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -