fix ms17010 legacy packet decoding (#574)

This commit is contained in:
ZacharyZcR
2026-05-09 14:00:06 +08:00
parent a6db455b7b
commit f0db5d48ad
2 changed files with 30 additions and 4 deletions
+1 -4
View File
@@ -184,10 +184,7 @@ func aesDecrypt(crypted string, key string) (string, error) {
return "", fmt.Errorf("密文长度过短")
}
iv := cryptedBytes[:aes.BlockSize]
cryptedBytes = cryptedBytes[aes.BlockSize:]
mode := cipher.NewCBCDecrypter(block, iv)
mode := cipher.NewCBCDecrypter(block, keyBytes[:aes.BlockSize])
mode.CryptBlocks(cryptedBytes, cryptedBytes)
// 移除PKCS7填充