mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-21 19:00:42 +08:00
fix: -hash 支持 LM:NT 格式 & -debug 日志文件修复
1. -hash 支持标准的 LM:NT 格式 (如 aad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0) 之前只接受纯 32 字符 NTLM hash,LM:NT 格式报 invalid hash length 2. -debug 日志文件写入修复(已在上一个 commit 中)
This commit is contained in:
@@ -202,11 +202,15 @@ func parseHashes(fv *FlagVars) ([]string, [][]byte, error) {
|
||||
var hashValues []string
|
||||
var hashBytes [][]byte
|
||||
|
||||
// 命令行哈希
|
||||
// 命令行哈希(支持纯 NTLM 32字符 或 LM:NT 格式)
|
||||
if fv.HashValue != "" {
|
||||
hash := strings.TrimSpace(fv.HashValue)
|
||||
// LM:NT 格式取 NT hash 部分
|
||||
if parts := strings.SplitN(hash, ":", 2); len(parts) == 2 && len(parts[1]) == 32 {
|
||||
hash = parts[1]
|
||||
}
|
||||
if len(hash) != 32 {
|
||||
return nil, nil, fmt.Errorf("invalid hash length: %s", hash)
|
||||
return nil, nil, fmt.Errorf("invalid hash length: %s", fv.HashValue)
|
||||
}
|
||||
hashByte, err := hex.DecodeString(hash)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user