2022-04-02 06:47:12 +00:00
|
|
|
package item
|
|
|
|
|
|
|
|
import (
|
2022-04-08 11:06:04 +00:00
|
|
|
data2 "hack-browser-data/internal/browingdata"
|
2022-04-02 06:47:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var DefaultFirefox = []Item{
|
|
|
|
FirefoxKey4,
|
|
|
|
FirefoxPassword,
|
|
|
|
FirefoxCookie,
|
|
|
|
FirefoxBookmark,
|
|
|
|
FirefoxHistory,
|
|
|
|
FirefoxDownload,
|
|
|
|
FirefoxCreditCard,
|
|
|
|
FirefoxLocalStorage,
|
|
|
|
FirefoxExtension,
|
|
|
|
}
|
|
|
|
|
|
|
|
var DefaultYandex = []Item{
|
|
|
|
ChromiumKey,
|
|
|
|
ChromiumCookie,
|
|
|
|
ChromiumBookmark,
|
|
|
|
ChromiumHistory,
|
|
|
|
ChromiumDownload,
|
|
|
|
ChromiumLocalStorage,
|
|
|
|
ChromiumExtension,
|
|
|
|
YandexPassword,
|
|
|
|
YandexCreditCard,
|
|
|
|
}
|
|
|
|
|
|
|
|
var DefaultChromium = []Item{
|
|
|
|
ChromiumKey,
|
|
|
|
ChromiumPassword,
|
|
|
|
ChromiumCookie,
|
|
|
|
ChromiumBookmark,
|
|
|
|
ChromiumHistory,
|
|
|
|
ChromiumDownload,
|
|
|
|
ChromiumCreditCard,
|
|
|
|
ChromiumLocalStorage,
|
|
|
|
ChromiumExtension,
|
|
|
|
}
|
|
|
|
|
2022-04-02 08:59:34 +00:00
|
|
|
type Item int
|
|
|
|
|
|
|
|
const (
|
|
|
|
ChromiumKey Item = iota
|
|
|
|
ChromiumPassword
|
|
|
|
ChromiumCookie
|
|
|
|
ChromiumBookmark
|
|
|
|
ChromiumHistory
|
|
|
|
ChromiumDownload
|
|
|
|
ChromiumCreditCard
|
|
|
|
ChromiumLocalStorage
|
|
|
|
ChromiumExtension
|
|
|
|
|
|
|
|
YandexPassword
|
|
|
|
YandexCreditCard
|
|
|
|
|
|
|
|
FirefoxKey4
|
|
|
|
FirefoxPassword
|
|
|
|
FirefoxCookie
|
|
|
|
FirefoxBookmark
|
|
|
|
FirefoxHistory
|
|
|
|
FirefoxDownload
|
|
|
|
FirefoxCreditCard
|
|
|
|
FirefoxLocalStorage
|
|
|
|
FirefoxExtension
|
|
|
|
)
|
|
|
|
|
2022-04-02 06:47:12 +00:00
|
|
|
func (i Item) FileName() string {
|
|
|
|
switch i {
|
|
|
|
case ChromiumKey:
|
|
|
|
return fileChromiumKey
|
|
|
|
case ChromiumPassword:
|
|
|
|
return fileChromiumPassword
|
|
|
|
case ChromiumCookie:
|
|
|
|
return fileChromiumCookie
|
|
|
|
case ChromiumBookmark:
|
|
|
|
return fileChromiumBookmark
|
|
|
|
case ChromiumDownload:
|
|
|
|
return fileChromiumDownload
|
|
|
|
case ChromiumLocalStorage:
|
|
|
|
return fileChromiumLocalStorage
|
|
|
|
case ChromiumCreditCard:
|
|
|
|
return fileChromiumCredit
|
|
|
|
case ChromiumExtension:
|
|
|
|
return UnknownItem
|
|
|
|
case ChromiumHistory:
|
|
|
|
return fileChromiumHistory
|
|
|
|
case YandexPassword:
|
|
|
|
return fileYandexPassword
|
|
|
|
case YandexCreditCard:
|
|
|
|
return fileYandexCredit
|
|
|
|
case FirefoxKey4:
|
|
|
|
return fileFirefoxKey4
|
|
|
|
case FirefoxPassword:
|
|
|
|
return fileFirefoxPassword
|
|
|
|
case FirefoxCookie:
|
|
|
|
return fileFirefoxCookie
|
|
|
|
case FirefoxBookmark:
|
|
|
|
return fileFirefoxData
|
|
|
|
case FirefoxDownload:
|
|
|
|
return fileFirefoxData
|
|
|
|
case FirefoxLocalStorage:
|
|
|
|
return UnsupportedItem
|
|
|
|
case FirefoxCreditCard:
|
|
|
|
return UnsupportedItem
|
|
|
|
case FirefoxHistory:
|
|
|
|
return fileFirefoxData
|
|
|
|
case FirefoxExtension:
|
|
|
|
return UnsupportedItem
|
|
|
|
default:
|
|
|
|
return UnknownItem
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i Item) String() string {
|
|
|
|
switch i {
|
|
|
|
case ChromiumKey:
|
|
|
|
return "chromiumKey"
|
|
|
|
case ChromiumPassword:
|
|
|
|
return "password"
|
|
|
|
case ChromiumCookie:
|
|
|
|
return "cookie"
|
|
|
|
case ChromiumBookmark:
|
|
|
|
return "bookmark"
|
|
|
|
case ChromiumDownload:
|
|
|
|
return "download"
|
|
|
|
case ChromiumLocalStorage:
|
|
|
|
return "localStorage"
|
|
|
|
case ChromiumCreditCard:
|
|
|
|
return "creditCard"
|
|
|
|
case ChromiumExtension:
|
|
|
|
return UnsupportedItem
|
|
|
|
case ChromiumHistory:
|
|
|
|
return "history"
|
|
|
|
case YandexPassword:
|
|
|
|
return "yandexPassword"
|
|
|
|
case YandexCreditCard:
|
|
|
|
return "yandexCreditCard"
|
|
|
|
case FirefoxKey4:
|
|
|
|
return "firefoxKey4"
|
|
|
|
case FirefoxPassword:
|
|
|
|
return "firefoxPassword"
|
|
|
|
case FirefoxCookie:
|
|
|
|
return "firefoxCookie"
|
|
|
|
case FirefoxBookmark:
|
|
|
|
return "firefoxBookmark"
|
|
|
|
case FirefoxDownload:
|
|
|
|
return "firefoxDownload"
|
|
|
|
case FirefoxHistory:
|
|
|
|
return "firefoxHistory"
|
|
|
|
case FirefoxLocalStorage:
|
|
|
|
return UnsupportedItem
|
|
|
|
case FirefoxCreditCard:
|
|
|
|
return UnsupportedItem
|
|
|
|
case FirefoxExtension:
|
|
|
|
return UnsupportedItem
|
|
|
|
default:
|
|
|
|
return UnknownItem
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-08 11:06:04 +00:00
|
|
|
// NewBrowsingData returns a new Source instance.
|
|
|
|
// TODO: remove this function
|
|
|
|
func (i Item) NewBrowsingData() data2.Source {
|
2022-04-02 06:47:12 +00:00
|
|
|
switch i {
|
|
|
|
case ChromiumKey:
|
|
|
|
return nil
|
|
|
|
case ChromiumPassword:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumPassword{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case ChromiumCookie:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumCookie{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case ChromiumBookmark:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumBookmark{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case ChromiumDownload:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumDownload{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case ChromiumLocalStorage:
|
|
|
|
return nil
|
|
|
|
case ChromiumCreditCard:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumCreditCard{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case ChromiumExtension:
|
|
|
|
return nil
|
|
|
|
case ChromiumHistory:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumHistory{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case YandexPassword:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumPassword{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case YandexCreditCard:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.ChromiumCreditCard{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case FirefoxPassword:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.FirefoxPassword{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case FirefoxCookie:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.FirefoxCookie{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case FirefoxBookmark:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.FirefoxBookmark{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case FirefoxDownload:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.FirefoxDownload{}
|
2022-04-02 06:47:12 +00:00
|
|
|
case FirefoxHistory:
|
2022-04-02 08:59:34 +00:00
|
|
|
return &data2.FirefoxHistory{}
|
2022-04-02 06:47:12 +00:00
|
|
|
default:
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|