有安全意识的人常常对一些文档进行加密,但是不幸的时经常忘记密码。。。。。。在这个moment,你可以使用RarCrack对rar,7z,zip文件进行破解,该软件开源免费,使用暴力破解,以GPL-2发布。
最新版为rarcrack-0.2
软件主页:/
作者提醒:Please don't use this program for any illegal things!
1.下载软件,解压:
tar xvfj rarcrack-0.2.tar.bz2
2.安装libxml2-dev包
sudo apt-get install libxml2-dev
3.编译并安装
make
sudo make install
4.测试
源程序里带的test.rar、test.zip、test.7z压缩包可供测试
rarcrack test.rar
大概几分钟后提示:GOOD: password cracked: '100'
不过我安装的时候报了一堆错,如下:
chao@chao:~/rarcrack-0.2$ make
gcc -pthread rarcrack.c `xml2-config --libs --cflags` -O2 -o rarcrack
/bin/sh: xml2-config:找不到命令
In file included from rarcrack.c:21:
rarcrack.h:25:48: error: libxml/xmlmemory.h: 没有该文件或目录
rarcrack.h:26:27: error: libxml/parser.h: 没有该文件或目录
rarcrack.h:27:36: error: libxml/parserInternals.h: 没有该文件或目录
rarcrack.h:28:25: error: libxml/tree.h: 没有该文件或目录
rarcrack.h:29:28: error: libxml/threads.h: 没有该文件或目录
rarcrack.c:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pwdMutex’
rarcrack.c:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘status’
rarcrack.c:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘finishedMutex’
rarcrack.c: In function ‘savestatus’:
rarcrack.c:46: error: ‘xmlNodePtr’ undeclared (first use in this function)
rarcrack.c:46: error: (Each undeclared identifier is reported only once
rarcrack.c:46: error: for each function it appears in.)
rarcrack.c:46: error: expected ‘;’ before ‘root’
rarcrack.c:47: error: expected ‘;’ before ‘node’
rarcrack.c:48: error: ‘xmlChar’ undeclared (first use in this function)
rarcrack.c:48: error: ‘tmp’ undeclared (first use in this function)
rarcrack.c:49: error: ‘status’ undeclared (first use in this function)
rarcrack.c:50: error: ‘root’ undeclared (first use in this function)
rarcrack.c:52: error: ‘finishedMutex’ undeclared (first use in this function)
rarcrack.c:53: error: ‘node’ undeclared (first use in this function)
rarcrack.c:55: error: ‘pwdMutex’ undeclared (first use in this function)
rarcrack.c:56: error: expected ‘)’ before ‘xmlChar’
rarcrack.c:66: error: expected ‘)’ before ‘xmlChar’
rarcrack.c: In function ‘loadstatus’:
rarcrack.c:87: error: ‘xmlNodePtr’ undeclared (first use in this function)
rarcrack.c:87: error: expected ‘;’ before ‘root’
rarcrack.c:88: error: expected ‘;’ before ‘node’
rarcrack.c:89: error: ‘xmlParserCtxtPtr’ undeclared (first use in this function)
rarcrack.c:89: error: expected ‘;’ before ‘parserctxt’
rarcrack.c:96: error: ‘status’ undeclared (first use in this function)
rarcrack.c:99: error: ‘root’ undeclared (first use in this function)
rarcrack.c:103: error: ‘parserctxt’ undeclared (first use in this function)
rarcrack.c:104: error: ‘node’ undeclared (first use in this function)
rarcrack.c:108: error: ‘XML_SUBSTITUTE_BOTH’ undeclared (first use in this function)
rarcrack.c:108: warning: assignment makes pointer from integer without a cast
rarcrack.c:114: warning: assignment makes pointer from integer without a cast
rarcrack.c:124: warning: assignment makes pointer from integer without a cast
rarcrack.c:127: error: ‘finishedMutex’ undeclared (first use in this function)
rarcrack.c: In function ‘nextpass’:
rarcrack.c:170: error: ‘pwdMutex’ undeclared (first use in this function)
rarcrack.c: In function ‘status_thread’:
rarcrack.c:182: error: ‘finishedMutex’ undeclared (first use in this function)
rarcrack.c:188: error: ‘pwdMutex’ undeclared (first use in this function)
rarcrack.c: In function ‘crack_thread’:
rarcrack.c:206: warning: comparison between pointer and integer
rarcrack.c:208: error: ‘finishedMutex’ undeclared (first use in this function)
rarcrack.c:205: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
rarcrack.c: In function ‘init’:
rarcrack.c:250: error: ‘pwdMutex’ undeclared (first use in this function)
rarcrack.c:251: error: ‘finishedMutex’ undeclared (first use in this function)
rarcrack.c:283: warning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘char (*)[300]’
rarcrack.c:317: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
rarcrack.c: In function ‘main’:
rarcrack.c:351: error: ‘status’ undeclared (first use in this function)
rarcrack.c:353: error: ‘pwdMutex’ undeclared (first use in this function)
rarcrack.c:354: error: ‘finishedMutex’ undeclared (first use in this function)
make: *** [all] 错误 1
解决:
到新立得软件管理器里安装libxml2-dev后就OK了,不过有几个warning:
chao@chao:~/rarcrack-0.2$ make
gcc -pthread rarcrack.c `xml2-config --libs --cflags` -O2 -o rarcrack
rarcrack.c: In function ‘crack_thread’:
rarcrack.c:206: warning: comparison between pointer and integer
rarcrack.c:205: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
rarcrack.c: In function ‘init’:
rarcrack.c:283: warning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘char (*)[300]’
rarcrack.c:317: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
warning嘛,就是小问题,继续make install
chao@chao:~/rarcrack-0.2$ sudo make install
install -s rarcrack /usr/bin
mkdir -p /usr/share/doc/rarcrack
chmod 755 /usr/share/doc/rarcrack
install -m 644 -t /usr/share/doc/rarcrack CHANGELOG LICENSE README README.html RELEASE_NOT
OK了,呵呵!安装完毕。我作了一个加密的rar文件,看看多长时间能破解成功吧!
对了 介绍下如何使用:
Using RarCrack:
---------------------------------------------------
rarcrack your_encrypted_archive.ext [--threads thread_num] [--type rar|zip|7z]
rarcrack 你要破解的加密文件所在的路径 --threads 破解线程数 --type 文件的格式rar|zip|7z
使用中有问题的可以给我留言,呵呵!
使用方法:
Using RarCrack:
如何使用rarcrack:
---------------------------------------------------
rarcrack your_encrypted_archive.ext [--threads thread_num] [--type rar|zip|7z]
rarcrack 你要破解的压缩文件 [--threads 破解线程数] [--type rar|zip|7z]
---------------------------------------------------
Everything in [] are optional, rarcrack default crack two threads and autodetect the archive type. If the detection wrong you can specify the correct file type with the type parameter. RarCrack currently crack maximum in 12 threads.
[]里面的都是可选项,rarcrack默认是两个线程,自动检测压缩文件类型。如果自动检测文件类型不正确,你可以通过--type加参数手动指定正确的类型。rarcrack目前最多支持12线程。
After the cracking started RarCrack will print the current status of cracking and save it's to a status file. If you want more specific password character set, you need to run RarCrack to create the XML status file (3 sec).
破解开始后rarcrack会显示当前状态,并且将其保存在一个状态文件中。如果你想指定更多的密码字符设置,你可以手动修改运行rarcrack后生成的xml文件(运行三秒后自动生成)。
---------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<rarcrack>
<abc>0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</abc>
<current>uU</current>
<good_password></good_password>
</rarcrack>
---------------------------------------------------
This is a sample XML file, and you see there is a character set. If you want, you can modify this file and when you start RarCrack again the program will be use new variables.
Warning: Take care when you changing this file, make sure the current password don't have characters outside the abc[character set]!
这是一个xml文件例子,你可以看到这里可以设置密码字符,如果你愿意,可以编辑此文件,再次运行rarcrack的时候修改生效。
警告:编辑此文件时务必小心,保证当前密码字符不会超出<abc>和</abc>之间的字符。
破解例子:
破解/tmp/目录下的test.rar文件的密码:
cd /tmp/
rarcrack test.rar --type rar --threads 12
RarCrack! 0.2 by David Zoltan Kedves (kedazo@)
INFO: the specified archive type: rar
INFO: cracking test.rar, status file: test.rar.xml
INFO: Resuming cracking from password: '0'
Probing: '028' [42 pwds/sec]
GOOD: password cracked: '100'
看这里,密码破解出来了,是100