使用john破解系统密码(windows和linux)

     分类: 网络安全,转载文章 发布时间: 2018-09-19 12:33 1,784人浏览

使用john、和samdump2破解window密码

Linux:

提取shadow文件,文件位于/etc/shadow,可以直接使用cat打开。

Windows:

使用管理员权限运行cmd,执行命令获取密码文件

reg save hklm\sam sam.hive
reg save hklm\system system.hive
reg save hklm\security security.hive


因samdump2已经集成bkhive,故可直接使用命令生成hash文件

samdump2 system.hive sam.hive > hashes

之后的使用方法就和linux提取出的shadow文件一样,直接使用john破解即可。


提取到密码文件之后,就可以使用john命令破解

Windows:

john –-format=NT hashes

Linux:

john --format=sha512crypt shadow

这两个口令本质上都是一样的,只是通过--format参数指定了破解参数而已。


john破解后的密码保存在john.pot中,下次破解需要先清除该文件的内容。

john的其他参数:
1. --wordlist使用密码字典文件
2. --fork指定使用的线程数量


个人使用的利用john的python自动破解脚本:

# -*- coding: utf-8 -*-
#在unix-in文件夹放入待破解文件,结果输出至unix-out文件夹中
import os,re,sys
a = os.listdir('./unix-in')
for i in a:
    b = 'john --fork=40 --wordlist=pass-new-20180914.txt ./unix-in/'+ i
    print b
    try:
        os.popen('rm -f /root/.john/john.pot')
    except:
        pass
    result = os.popen(b).read()
    print result
    file = './unix-out/'+i
    f = open(file,'w')
    f.write(result)
    f.close()

参考链接:
john破解系统密码(windows和kali)
抓取管理员hash值(哈希)的另类方法


上一篇文章:

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注