feat: support export session storage for chromium

pull/224/head
Mingxing Liu 2 years ago committed by moonD4rk
parent 01bf9806e0
commit 115e1d29c6
  1. 3
      browingdata/browsingdata.go
  2. 4
      browser/chromium/chromium.go
  3. 3
      item/filename.go
  4. 11
      item/item.go

@ -11,6 +11,7 @@ import (
"github.com/moond4rk/HackBrowserData/browingdata/history" "github.com/moond4rk/HackBrowserData/browingdata/history"
"github.com/moond4rk/HackBrowserData/browingdata/localstorage" "github.com/moond4rk/HackBrowserData/browingdata/localstorage"
"github.com/moond4rk/HackBrowserData/browingdata/password" "github.com/moond4rk/HackBrowserData/browingdata/password"
"github.com/moond4rk/HackBrowserData/browingdata/sessionstorage"
"github.com/moond4rk/HackBrowserData/item" "github.com/moond4rk/HackBrowserData/item"
"github.com/moond4rk/HackBrowserData/log" "github.com/moond4rk/HackBrowserData/log"
"github.com/moond4rk/HackBrowserData/utils/fileutil" "github.com/moond4rk/HackBrowserData/utils/fileutil"
@ -89,6 +90,8 @@ func (d *Data) addSources(items []item.Item) {
d.sources[source] = &creditcard.ChromiumCreditCard{} d.sources[source] = &creditcard.ChromiumCreditCard{}
case item.ChromiumLocalStorage: case item.ChromiumLocalStorage:
d.sources[source] = &localstorage.ChromiumLocalStorage{} d.sources[source] = &localstorage.ChromiumLocalStorage{}
case item.ChromiumSessionStorage:
d.sources[source] = &sessionstorage.ChromiumSessionStorage{}
case item.ChromiumExtension: case item.ChromiumExtension:
d.sources[source] = &extension.ChromiumExtension{} d.sources[source] = &extension.ChromiumExtension{}
case item.YandexPassword: case item.YandexPassword:

@ -69,6 +69,7 @@ func (c *Chromium) BrowsingData(isFullExport bool) (*browingdata.Data, error) {
if err := data.Recovery(c.masterKey); err != nil { if err := data.Recovery(c.masterKey); err != nil {
return nil, err return nil, err
} }
return data, nil return data, nil
} }
@ -81,6 +82,9 @@ func (c *Chromium) copyItemToLocal() error {
if i == item.ChromiumLocalStorage { if i == item.ChromiumLocalStorage {
err = fileutil.CopyDir(path, filename, "lock") err = fileutil.CopyDir(path, filename, "lock")
} }
if i == item.ChromiumSessionStorage {
err = fileutil.CopyDir(path, filename, "lock")
}
if i == item.ChromiumExtension { if i == item.ChromiumExtension {
err = fileutil.CopyDirHasSuffix(path, filename, "manifest.json") err = fileutil.CopyDirHasSuffix(path, filename, "manifest.json")
} }

@ -10,6 +10,7 @@ const (
fileChromiumCookie = "Cookies" fileChromiumCookie = "Cookies"
fileChromiumBookmark = "Bookmarks" fileChromiumBookmark = "Bookmarks"
fileChromiumLocalStorage = "Local Storage/leveldb" fileChromiumLocalStorage = "Local Storage/leveldb"
fileChromiumSessionStorage = "Session Storage"
fileChromiumExtension = "Extensions" fileChromiumExtension = "Extensions"
fileYandexPassword = "Ya Passman Data" fileYandexPassword = "Ya Passman Data"
@ -37,6 +38,7 @@ const (
TempChromiumDownload = "download" TempChromiumDownload = "download"
TempChromiumCreditCard = "creditCard" TempChromiumCreditCard = "creditCard"
TempChromiumLocalStorage = "localStorage" TempChromiumLocalStorage = "localStorage"
TempChromiumSessionStorage = "sessionStorage"
TempChromiumExtension = "extension" TempChromiumExtension = "extension"
TempYandexPassword = "yandexPassword" TempYandexPassword = "yandexPassword"
@ -49,6 +51,7 @@ const (
TempFirefoxHistory = "firefoxHistory" TempFirefoxHistory = "firefoxHistory"
TempFirefoxDownload = "firefoxDownload" TempFirefoxDownload = "firefoxDownload"
TempFirefoxLocalStorage = "firefoxLocalStorage" TempFirefoxLocalStorage = "firefoxLocalStorage"
TempFirefoxSessionStorage = "firefoxSessionStorage"
TempFirefoxCreditCard = "" TempFirefoxCreditCard = ""
TempFirefoxExtension = "firefoxExtension" TempFirefoxExtension = "firefoxExtension"
) )

@ -11,6 +11,7 @@ const (
ChromiumDownload ChromiumDownload
ChromiumCreditCard ChromiumCreditCard
ChromiumLocalStorage ChromiumLocalStorage
ChromiumSessionStorage
ChromiumExtension ChromiumExtension
YandexPassword YandexPassword
@ -24,6 +25,7 @@ const (
FirefoxDownload FirefoxDownload
FirefoxCreditCard FirefoxCreditCard
FirefoxLocalStorage FirefoxLocalStorage
FirefoxSessionStorage
FirefoxExtension FirefoxExtension
) )
@ -41,6 +43,8 @@ func (i Item) FileName() string {
return fileChromiumDownload return fileChromiumDownload
case ChromiumLocalStorage: case ChromiumLocalStorage:
return fileChromiumLocalStorage return fileChromiumLocalStorage
case ChromiumSessionStorage:
return fileChromiumSessionStorage
case ChromiumCreditCard: case ChromiumCreditCard:
return fileChromiumCredit return fileChromiumCredit
case ChromiumExtension: case ChromiumExtension:
@ -88,6 +92,8 @@ func (i Item) String() string {
return TempChromiumDownload return TempChromiumDownload
case ChromiumLocalStorage: case ChromiumLocalStorage:
return TempChromiumLocalStorage return TempChromiumLocalStorage
case ChromiumSessionStorage:
return TempChromiumSessionStorage
case ChromiumCreditCard: case ChromiumCreditCard:
return TempChromiumCreditCard return TempChromiumCreditCard
case ChromiumExtension: case ChromiumExtension:
@ -112,6 +118,8 @@ func (i Item) String() string {
return TempFirefoxHistory return TempFirefoxHistory
case FirefoxLocalStorage: case FirefoxLocalStorage:
return TempFirefoxLocalStorage return TempFirefoxLocalStorage
case FirefoxSessionStorage:
return TempFirefoxSessionStorage
case FirefoxCreditCard: case FirefoxCreditCard:
return UnsupportedItem return UnsupportedItem
case FirefoxExtension: case FirefoxExtension:
@ -155,6 +163,7 @@ var DefaultFirefox = []Item{
FirefoxDownload, FirefoxDownload,
FirefoxCreditCard, FirefoxCreditCard,
FirefoxLocalStorage, FirefoxLocalStorage,
FirefoxSessionStorage,
FirefoxExtension, FirefoxExtension,
} }
@ -168,6 +177,7 @@ var DefaultYandex = []Item{
ChromiumExtension, ChromiumExtension,
YandexPassword, YandexPassword,
ChromiumLocalStorage, ChromiumLocalStorage,
ChromiumSessionStorage,
YandexCreditCard, YandexCreditCard,
} }
@ -181,5 +191,6 @@ var DefaultChromium = []Item{
ChromiumDownload, ChromiumDownload,
ChromiumCreditCard, ChromiumCreditCard,
ChromiumLocalStorage, ChromiumLocalStorage,
ChromiumSessionStorage,
ChromiumExtension, ChromiumExtension,
} }

Loading…
Cancel
Save