From bc46e90d8966e8c4b9dfb8a22897c2b80bc90eff Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 14 Jun 2026 09:50:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20-hash=20=E6=94=AF=E6=8C=81=20LM:NT=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=20&=20-debug=20=E6=97=A5=E5=BF=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. -hash 支持标准的 LM:NT 格式 (如 aad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0) 之前只接受纯 32 字符 NTLM hash,LM:NT 格式报 invalid hash length 2. -debug 日志文件写入修复(已在上一个 commit 中) --- common/config_builder.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/config_builder.go b/common/config_builder.go index 97e6a94..14559c7 100644 --- a/common/config_builder.go +++ b/common/config_builder.go @@ -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 {