mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
fix: Resolve decryption failures of password value in some browser (#452)
* fix: skip chromium-based browser 'def' dir * fix: fixed the issue that 360speed, QQ Browser and other Chinese browsers had errors in decrypting passwords and cookies * misc: modify some log level * fix: fix the wrong function --------- Co-authored-by: Aquilao <Aquilao@outlook>
This commit is contained in:
committed by
ᴍᴏᴏɴD4ʀᴋ
parent
0761fc39f2
commit
b66ca7b3d8
@@ -65,7 +65,7 @@ func (c *ChromiumCookie) Extract(masterKey []byte) error {
|
||||
value, encryptValue []byte
|
||||
)
|
||||
if err = rows.Scan(&key, &encryptValue, &host, &path, &createDate, &expireDate, &isSecure, &isHTTPOnly, &hasExpire, &isPersistent); err != nil {
|
||||
log.Errorf("scan chromium cookie error: %v", err)
|
||||
log.Debugf("scan chromium cookie error: %v", err)
|
||||
}
|
||||
|
||||
cookie := cookie{
|
||||
@@ -80,16 +80,17 @@ func (c *ChromiumCookie) Extract(masterKey []byte) error {
|
||||
CreateDate: typeutil.TimeEpoch(createDate),
|
||||
ExpireDate: typeutil.TimeEpoch(expireDate),
|
||||
}
|
||||
|
||||
if len(encryptValue) > 0 {
|
||||
if len(masterKey) == 0 {
|
||||
value, err = crypto.DecryptWithDPAPI(encryptValue)
|
||||
} else {
|
||||
value, err = crypto.DecryptWithChromium(masterKey, encryptValue)
|
||||
}
|
||||
value, err = crypto.DecryptWithDPAPI(encryptValue)
|
||||
if err != nil {
|
||||
log.Errorf("decrypt chromium cookie error: %v", err)
|
||||
value, err = crypto.DecryptWithChromium(masterKey, encryptValue)
|
||||
if err != nil {
|
||||
log.Debugf("decrypt chromium cookie error: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cookie.Value = string(value)
|
||||
*c = append(*c, cookie)
|
||||
}
|
||||
@@ -133,7 +134,7 @@ func (f *FirefoxCookie) Extract(_ []byte) error {
|
||||
creationTime, expiry int64
|
||||
)
|
||||
if err = rows.Scan(&name, &value, &host, &path, &creationTime, &expiry, &isSecure, &isHTTPOnly); err != nil {
|
||||
log.Errorf("scan firefox cookie error: %v", err)
|
||||
log.Debugf("scan firefox cookie error: %v", err)
|
||||
}
|
||||
*f = append(*f, cookie{
|
||||
KeyName: name,
|
||||
|
||||
Reference in New Issue
Block a user