mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-21 19:06:47 +02:00
fix: firefox for windows decrypt failure
This commit is contained in:
+3
-5
@@ -17,9 +17,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
passwordIsEmpty = errors.New("decrypt fail, password is empty")
|
errPasswordIsEmpty = errors.New("decrypt failed, password is empty")
|
||||||
|
|
||||||
errBrowserNotSupported = errors.New("browser not supported")
|
errBrowserNotSupported = errors.New("browser not supported")
|
||||||
|
errKeyIsEmpty = errors.New("input [security find-generic-password -wa 'Chrome'] in terminal")
|
||||||
VersionUnder80 bool
|
VersionUnder80 bool
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -227,9 +227,7 @@ func DecodeLogin(decodeItem []byte) (pbe LoginPBE, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func aes128CBCDecrypt(key, iv, encryptPass []byte) ([]byte, error) {
|
func aes128CBCDecrypt(key, iv, encryptPass []byte) ([]byte, error) {
|
||||||
if len(chromeKey) == 0 {
|
|
||||||
return []byte{}, nil
|
|
||||||
}
|
|
||||||
block, err := aes.NewCipher(key)
|
block, err := aes.NewCipher(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []byte{}, err
|
return []byte{}, err
|
||||||
|
|||||||
@@ -88,11 +88,14 @@ func decryptChromeKey(chromePass []byte) {
|
|||||||
|
|
||||||
func DecryptChromePass(encryptPass []byte) (string, error) {
|
func DecryptChromePass(encryptPass []byte) (string, error) {
|
||||||
if len(encryptPass) > 3 {
|
if len(encryptPass) > 3 {
|
||||||
|
if len(chromeKey) == 0 {
|
||||||
|
return "", errKeyIsEmpty
|
||||||
|
}
|
||||||
m, err := aes128CBCDecrypt(chromeKey, iv, encryptPass[3:])
|
m, err := aes128CBCDecrypt(chromeKey, iv, encryptPass[3:])
|
||||||
return string(m), err
|
return string(m), err
|
||||||
} else {
|
} else {
|
||||||
return "", &DecryptError{
|
return "", &DecryptError{
|
||||||
err: passwordIsEmpty,
|
err: errPasswordIsEmpty,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ func DecryptChromePass(encryptPass []byte) (string, error) {
|
|||||||
// remove prefix 'v10'
|
// remove prefix 'v10'
|
||||||
return aesGCMDecrypt(encryptPass[15:], chromeKey, encryptPass[3:15])
|
return aesGCMDecrypt(encryptPass[15:], chromeKey, encryptPass[3:15])
|
||||||
} else {
|
} else {
|
||||||
return "", passwordIsEmpty
|
return "", errPasswordIsEmpty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user