/*
* This software was written by Jim Fougeron jfoug AT cox dot net
* in 2009. No copyright is claimed, and the software is hereby
* placed in the public domain. In case this attempt to disclaim
* copyright and place the software in the public domain is deemed
* null and void, then the software is Copyright � 2009 Jim Fougeron
* and it is hereby released to the general public under the following
* terms:
*
* This software may be modified, redistributed, and used for any
* purpose, in source and binary forms, with or without modification.
*
* Generic MD5 hashes cracker
*
* It uses the openSSL md5 for x86, and MMX/SSE2 md5 from md5-mmx.S
*
* TODO's
* All done (right now)!
*
* recently DONE's
* 1. in the MMX/SSE2 builds, ALSO make sure native x86 (using OpenSSL), is built.
* Then if the format is a NON-SSE safe format, link the functions to the non-x86 versions.
* In x86 mode, we DO NOT need to have the SSE2 code, since it is not valid to call anyway.
* 2. Add SSE Intrisic code. MD5_PARA (as built by simon), IS now working.
* 3. Start making 'thin' _fmt.c files for other 'formats'.
* Easy formats:
* DMD5 (Is a challenge/response, so may need to simply be 'redone'
* MD5_apache_fmt.c (DONE)
* md5_fmt.c (DONE)
* HDAA_fmt.c (DONE)
* pixMD5_fmt.c (DONE)
* raw_md5_fmt.c (DONE)
* PO_fmt.c (DONE)
* phpassMD5_fmt.c (DONE)
* PHPS_fmt.c (DONE)
* IPB2_fmt.c (DONE)
* 4. Made 10 primatives which allow us to switch back and forth from SSE (1 MD5 buffer), to X86, multiple buffers. Thus, we
* can write SSE formats, and when they overflow, switch to x86, perform the MD5, and switch back. A good example is type
* dynamic_13 md5(md5($p).md5($s)) Here, we preload $s, so it does not play a part in the runtime. However, the
* first md5($p) CAN be done in SSE mode. Then we switch to x86, and perform the MD5 of the 64 byte string. This increases
* throughput about 150%.
* 5. Found and fixed a bug in the MMX string concatentation code.
* 6. Generated a 'test-suite' format.
* 7. Add in 'real' utf8 to unicode conversion. Added MGF_UTF8, and set FMT_UTF8 and FMT_UNICODE into the format's structure
* if this flag (or the uncode switch function), is used.
* 8. Put some ability into the formats, so that test strings can be switched out in utf8 mode,
* and so that any 8859-1 which would 'fail' in utf8 mode could be switched out. In the preloads, U= and A= are used at the
* start of the cipher strings. In the john.conf, there are now Test= TestA= and TestU= for always use, using only if non-utf8
* and use ONLY if utf8. The TestA= and TestU= were documented. A= and U= in the preload.c file are internal, and need
* NO documentation to end users.
* 9. Added raw-md5-unicode.
* 10. max salt len not working (not a fixed size, just max len, i.e. saltlen = neg number).
* 11. upcase of user name (currently only up/lo case we do), is not handled with code found in unicode.c.
* 12. Allow upcasing and low casing of strings (like passwords). Do this using unicode
* upcasing from unicode.c
* 13. Fix x86-64 'broken' formats. Right now, they 'work' but only with SSE turned off.
* The broken formats are 12/13/21-26
*
* Only valid up to 54 bytes max string length (salts, rehashes,
* passwords, etc) if using SSE2. 96 byte keys (appended salts,
* keys, re-hashes, etc), if running under x86 mode. NOTE some
* hashes will NOT run properly under SSE2. A hash such as
* md5(md5($p).md5($s)) would fail under SSE2, since it always
* would need at least 64 bytes to complete but even md5($p) would
* fail in SSE2 if the password is over 54 bytes. NOTE no run-time
* checks are made so if you provide data too large, it will not find
* the hash, and will 'overwrite' some of the hashes being worked on,
* and cause them to have invalid results. This is a bug that 'might'
* be worked on, but I do not want do slow the cracking down performing
* checks.
*
* This code has gone through a few iterations, and now is quite a bit
* more mature. It has been designed with an array for keys (which
* is optionally used), a slot for the current salt, 2 arrays for
* input buffers (there is optional loading that loads keys directly
* into input buffer #1 as an optimization for certain formats), and
* a pair of arrays for crypt outputs. The 'first' output buffer array
* is used to return the final results. There is also 2 arrays of lengths
* of input buffers. There are then 'primative' functions. These can
* append keys, append salts, blank out keys, move from input 1 to input
* 2, crypt input 1 -> output 1, (or from 1->2 or 2->2 or 2->1, etc).
* There are functions that do base 16 conversions of the outputs back
* into inputs (O1->I1 in base 16, 1->2 2->2 2->1, etc). There are
* functions that over write the start of an input buffer from outputs
* without 'adjusting' the lengths. There are a few special functions
* to do phpass work.
*
* Then there are helper functions which allow another format to 'use'
* the generic MD5 code. So, we can make a VERY thin raw-md5 (or phpass
* md5), where it simply has a format structure (which does not need to be
* 'heavily' filled out, and that format only needs to implement a few
* functions on its own. It would need to implement init, valid, salt
* and binary. Then there needs to be a 'conversion' function that
* converts from the 'native' format, into the native GENERIC format.
* Then, within the init function, that format would hook into the
* generic md5, by calling the dynamic_RESET_LINK() function, passing
* in its Format structure to have functions pointed into the md5 generic
* stuff. The conversion function is likely very trivial. For phpass, we
* convert from
* $H$9aaaaaSXBjgypwqm.JsMssPLiS8YQ00
* to
* $dynamic_17$jgypwqm.JsMssPLiS8YQ00$9aaaaaSXB
*
* Here is that convert function:
* static char *Convert(char *Buf, char *ciphertext) {
* sprintf(Buf, "$dynamic_17$%s%10.10s", &ciphertext[3+8+1], &ciphertext[2]);
* return Buf;
* }
*
*
* Generic MD5 can now be user expanded. The first 1000 dynamic_# are
* reserved as 'built-in' functions for john. Above 1000 is free to use
* for anyone wanting to do so. NO programming changes are needed to
* add a format. All that is needed is modifcations to john.conf. There is
* FULL documentation about how to do this in doc/DYNAMIC. There is
* no parser 'generation' logic. A person would have to understand the
* primitive functions and how they work. But the format can be added
* without a rebuild of john. There are 7 (or 8) examples already done
* in john.conf at this time, which should make it pretty easy for someone
* wanting to do a new or obscure format.
*
* Recent additions / fixes
*
* SSE2 intrinsics
* Faster (double speed) for a couple formats
* Addition of PO format (Native and using constants)
* Addition of 8 'constant' fields'
* In MD5_COEF builds, the not-SSE-safe formats now work (using x86 code)
* MD5_go functions used (10% faster than OpenSSL).
*
* Renamed and changed from md5_gen* to dynamic*. We handle MD5 and SHA1
* at the present time. More crypt types 'may' be added later.
*
*/
#include <string.h>
#include <time.h>
#include "arch.h"
#include "misc.h"
#include "common.h"
#include "formats.h"
#include "md5.h"
#include "dynamic.h"
#include "options.h"
#include "config.h"
#include "sha.h"
#include "memory.h"
#include "unicode.h"
extern struct fmt_main fmt_MD5gen;
static struct fmt_main *pFmts;
static int nFmts;
static int force_md5_ctx;
/* these are 'low level' inner loop data maniplation functions. Some work */
/* faster on cer
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
john-1.7.8-jumbo-8 (320个子文件)
john.asm 2KB
dynamic_fmt.c 221KB
nonstd.c 100KB
pkzip_fmt_plug.c 55KB
sboxes-s.c 46KB
rules.c 46KB
unicode.c 43KB
mscash2_fmt_plug.c 42KB
dynamic_parser.c 31KB
compiler.c 30KB
DES_bs_b.c 29KB
dynamic_preloads.c 28KB
MD5_std.c 28KB
DES_std.c 27KB
BF_std.c 27KB
mscash1_fmt_plug.c 27KB
NT_fmt_plug.c 26KB
loader.c 26KB
sse-intrinsics.c 25KB
mscash2_fmt_plug.c 24KB
zip2john.c 19KB
NETNTLMv2_fmt_plug.c 19KB
wordlist.c 16KB
inc.c 16KB
john.c 15KB
options.c 15KB
phpassMD5_fmt_orig.c 15KB
status.c 14KB
rawMD5unicode_fmt_plug.c 14KB
NETLMv2_fmt_plug.c 14KB
MSCHAPv2_fmt_plug.c 14KB
c3_fmt.c 13KB
charset.c 13KB
NETNTLM_fmt_plug.c 12KB
DOMINOSEC_fmt_plug.c 12KB
unique.c 12KB
salted_sha1_fmt_plug.c 12KB
mssql05_fmt_plug.c 12KB
mskrb5_fmt_plug.c 12KB
pdfparser.c 12KB
bench.c 12KB
single.c 11KB
pdfcrack.c 11KB
DES_bs.c 11KB
pdfcrack_md5.c 11KB
NETLM_fmt_plug.c 11KB
md5_eq.c 11KB
mssql-old_fmt_plug.c 10KB
mysqlSHA1_fmt_plug.c 10KB
sapG_fmt_plug.c 10KB
sapB_fmt_plug.c 10KB
AFS_fmt.c 10KB
oracle_fmt_plug.c 10KB
rawSHA1_fmt_plug.c 9KB
mkv.c 9KB
KRB5_fmt_plug.c 9KB
rar_fmt.c 9KB
config.c 9KB
md5_go.c 8KB
ssh_fmt.c 8KB
NETSPLITLM_fmt_plug.c 8KB
HDAA_fmt_plug.c 8KB
md5.c 8KB
hmacMD5_fmt_plug.c 8KB
BSDI_fmt.c 8KB
MD5_fmt.c 8KB
KRB4_fmt_plug.c 8KB
NSLDAPS_fmt_plug.c 7KB
DMD5_fmt_plug.c 7KB
KRB5_std_plug.c 7KB
lotus5_fmt_plug.c 7KB
OPENLDAPS_fmt_plug.c 7KB
SybaseASE_fmt.c 7KB
cracker.c 7KB
genmkvpwd.c 7KB
recovery.c 7KB
rawMD4_fmt_plug.c 7KB
md4.c 7KB
MYSQL_fmt_plug.c 7KB
NS_fmt_plug.c 7KB
signals.c 7KB
DES_fmt.c 7KB
BF_fmt.c 6KB
pixMD5_fmt_plug.c 6KB
logger.c 6KB
XSHA512_fmt.c 6KB
tgtsnarf.c 6KB
IPB2_fmt_plug.c 6KB
hmailserver_fmt.c 6KB
rar2john.c 6KB
oracle11_fmt_plug.c 6KB
NSLDAP_fmt_plug.c 6KB
pdfcrack_rc4.c 6KB
SKEY_fmt.c 6KB
pdf_fmt.c 6KB
crc32_fmt_plug.c 6KB
trip_fmt_plug.c 6KB
PHPS_fmt_orig.c 5KB
phpassMD5_fmt_plug.c 5KB
rawmd5u_fmt_plug.c 5KB
共 320 条
- 1
- 2
- 3
- 4
资源评论
chenvsa
- 粉丝: 17
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功