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. 57
      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")
} }

@ -2,15 +2,16 @@ package item
// item's default filename // item's default filename
const ( const (
fileChromiumKey = "Local State" fileChromiumKey = "Local State"
fileChromiumCredit = "Web Data" fileChromiumCredit = "Web Data"
fileChromiumPassword = "Login Data" fileChromiumPassword = "Login Data"
fileChromiumHistory = "History" fileChromiumHistory = "History"
fileChromiumDownload = "History" fileChromiumDownload = "History"
fileChromiumCookie = "Cookies" fileChromiumCookie = "Cookies"
fileChromiumBookmark = "Bookmarks" fileChromiumBookmark = "Bookmarks"
fileChromiumLocalStorage = "Local Storage/leveldb" fileChromiumLocalStorage = "Local Storage/leveldb"
fileChromiumExtension = "Extensions" fileChromiumSessionStorage = "Session Storage"
fileChromiumExtension = "Extensions"
fileYandexPassword = "Ya Passman Data" fileYandexPassword = "Ya Passman Data"
fileYandexCredit = "Ya Credit Cards" fileYandexCredit = "Ya Credit Cards"
@ -29,26 +30,28 @@ const (
) )
const ( const (
TempChromiumKey = "chromiumKey" TempChromiumKey = "chromiumKey"
TempChromiumPassword = "password" TempChromiumPassword = "password"
TempChromiumCookie = "cookie" TempChromiumCookie = "cookie"
TempChromiumBookmark = "bookmark" TempChromiumBookmark = "bookmark"
TempChromiumHistory = "history" TempChromiumHistory = "history"
TempChromiumDownload = "download" TempChromiumDownload = "download"
TempChromiumCreditCard = "creditCard" TempChromiumCreditCard = "creditCard"
TempChromiumLocalStorage = "localStorage" TempChromiumLocalStorage = "localStorage"
TempChromiumExtension = "extension" TempChromiumSessionStorage = "sessionStorage"
TempChromiumExtension = "extension"
TempYandexPassword = "yandexPassword" TempYandexPassword = "yandexPassword"
TempYandexCreditCard = "yandexCreditCard" TempYandexCreditCard = "yandexCreditCard"
TempFirefoxKey4 = "firefoxKey4" TempFirefoxKey4 = "firefoxKey4"
TempFirefoxPassword = "firefoxPassword" TempFirefoxPassword = "firefoxPassword"
TempFirefoxCookie = "firefoxCookie" TempFirefoxCookie = "firefoxCookie"
TempFirefoxBookmark = "firefoxBookmark" TempFirefoxBookmark = "firefoxBookmark"
TempFirefoxHistory = "firefoxHistory" TempFirefoxHistory = "firefoxHistory"
TempFirefoxDownload = "firefoxDownload" TempFirefoxDownload = "firefoxDownload"
TempFirefoxLocalStorage = "firefoxLocalStorage" TempFirefoxLocalStorage = "firefoxLocalStorage"
TempFirefoxCreditCard = "" TempFirefoxSessionStorage = "firefoxSessionStorage"
TempFirefoxExtension = "firefoxExtension" TempFirefoxCreditCard = ""
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