好记性不如铅笔头

安全, 操作系统

使用ophcrack破解win7用户密码

!!!笔记仅供学习交流使用,请勿进行其他用途!!! 

首先从目标win7上获取两个文件【 SYSTEM 】和【 SAM 】,均在【 /windows/system32/config 】目录下。

CONTENTS

windows平台下:

首先下载一个工具【 ophcrack 】,这个工具是跨平台的,而且有LiveCD版本。

然后下载彩虹表,由于测试密码很简单,因此这里就下载Free版本的彩虹表。

彩虹表有两个版本,由于这里测试的是win7的密码而且是简单密码,下载vista版本的【 vista_proba_free 】。

下载后解压缩,然后将彩虹表导入到ophcrack中。



这里可以关注下ophcrack的help文件,里面对于线程的设置有介绍。这里就贴一段关于线程数量的:

Number of threads: It allows you to set the number of threads the program will use and to enable or disable the brute force cracking. The number of threads should be set to the number of cores of the computer running ophcrack plus one. For example, for an old processor set the number of threads to 2, for a Core 2 Duo to 3 and for a Core 2 Quad to 5. If you change this value, you have to exit ophcrack and to restart it in order to save the change. If you don't exit and restart, the new number of threads will not be taken into account by the program. 

作者已经将SAM文件和SYSTEM文件提取出来了,这里就直接载入即可,然后可以选中不想破解的用户,按【 Delete 】删除,这样可以加速破解。

这里作者一共提取了3中状态下的文件,分别测试下结果:

没有使用syskey加密的,很快就搞定了:

使用syskey自动加密的,对比下hash,发现和没有加密的一样,说明ophcrack已经解析成功了syskey,也很快就搞定了。

使用syskey手动加密的,hash和上面两个不同,用了好长时间也没有搞定。这里作者估计是因为ophcrack没有成功的破解掉二次加密。那么我们可以使用kali下的工具再次进行尝试。

kali下:

kali下也有【 ophcrack 】,可以和上面的步骤相同。

kali下还有两个工具,【 bkhive 】和【 samdump2 】,如下,可以生成hash密码文件,用来破解:

root@kali:~/key# bkhive
bkhive 1.1.1 by Objectif Securite
http://www.objectif-securite.ch
original author: ncuomo@studenti.unina.it

Usage:
bkhive systemhive keyfile
root@kali:~/key# samdump2
samdump2 1.1.1 by Objectif Securite
http://www.objectif-securite.ch
original author: ncuomo@studenti.unina.it

Usage:
samdump2 samhive keyfile

这里作者使用这两个文件尝试破解手动加密的,但是仍然无法搞定。这里笔记下使用命令:

root@kali:~/key# ls
SAM  SYSTEM
root@kali:~/key# bkhive SYSTEM keyfile.txt
bkhive 1.1.1 by Objectif Securite
http://www.objectif-securite.ch
original author: ncuomo@studenti.unina.it

Root Key : CMI-CreateHive{F10156BE-0E87-4EFB-969E-5DA29D131144}
Default ControlSet: 001
Bootkey: c5ec04b8904f927b112e539b0304e685
root@kali:~/key# samdump2 SAM keyfile.txt > hash.txt
samdump2 1.1.1 by Objectif Securite
http://www.objectif-securite.ch
original author: ncuomo@studenti.unina.it

Root Key : CMI-CreateHive{899121E8-11D8-44B6-ACEB-301713D5ED8C}
root@kali:~/key# ls
hash.txt  keyfile.txt  SAM  SYSTEM
root@kali:~/key# 
root@kali:~/key# cat hash.txt 
Administrator:500:aad3b435b51404eeaad3b435b51404ee:4cca54157a00b329906ad9e2dcb26653:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
win7:1001:aad3b435b51404eeaad3b435b51404ee:922e8c6ec2567d8028c024cd8d8c4701:::
HomeGroupUser$:1002:aad3b435b51404eeaad3b435b51404ee:2eddfa763ecaa8d6a52faa98e571366b:::
admin2:1003:aad3b435b51404eeaad3b435b51404ee:92019bdc99ae42584b2a0f2f084cc174:::
user1:1004:aad3b435b51404eeaad3b435b51404ee:55e94012a85be07e91189f1f3f80a7ad:::

然后作者尝试解密hash.txt,也没有搞定。就先放这边吧。hash.txt文件已经cat出来了。

也可以参考:

http://xiao106347.blog.163.com/blog/static/2159920782012899400943/ 】,作者没有尝试,仅作参考。

还是用到winPE或者linuxliveCD。所以首先制作winPE或linuxliveCD的启动光盘,启动u盘更方便.
重启,启动PE或livdeCD后,进入C:\windows\system32目录下.
然后找到syskey.exe,在PE下直接打开运行,选择更新密码即可重置密码。

也可以在C:\windows\system32目录下找到ctfmon.exe,重命名为ctfmon1.exe。
然后找到syskey.exe,并把它重命名为ctfmon.exe。
ctfmon.exe→ctfmon1.exe
syskey.exe→ctfmon.exe
重启即可.

发表评论

8 − 3 =

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据