mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
chore: update project layout
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
package browser
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/moond4rk/HackBrowserData/browingdata"
|
||||
"github.com/moond4rk/HackBrowserData/browser/chromium"
|
||||
"github.com/moond4rk/HackBrowserData/browser/firefox"
|
||||
"github.com/moond4rk/HackBrowserData/log"
|
||||
"github.com/moond4rk/HackBrowserData/utils/fileutil"
|
||||
"github.com/moond4rk/HackBrowserData/utils/typeutil"
|
||||
)
|
||||
|
||||
type Browser interface {
|
||||
// Name is browser's name
|
||||
Name() string
|
||||
// BrowsingData returns all browsing data in the browser.
|
||||
BrowsingData() (*browingdata.Data, error)
|
||||
}
|
||||
|
||||
func PickBrowsers(name, profile string) ([]Browser, error) {
|
||||
var browsers []Browser
|
||||
clist := pickChromium(name, profile)
|
||||
for _, b := range clist {
|
||||
if b != nil {
|
||||
browsers = append(browsers, b)
|
||||
}
|
||||
}
|
||||
flist := pickFirefox(name, profile)
|
||||
for _, b := range flist {
|
||||
if b != nil {
|
||||
browsers = append(browsers, b)
|
||||
}
|
||||
}
|
||||
return browsers, nil
|
||||
}
|
||||
|
||||
func pickChromium(name, profile string) []Browser {
|
||||
var browsers []Browser
|
||||
name = strings.ToLower(name)
|
||||
if name == "all" {
|
||||
for _, v := range chromiumList {
|
||||
if !fileutil.FolderExists(filepath.Clean(v.profilePath)) {
|
||||
log.Noticef("find browser %s failed, profile folder does not exist", v.name)
|
||||
continue
|
||||
}
|
||||
if multiChromium, err := chromium.New(v.name, v.storage, v.profilePath, v.items); err == nil {
|
||||
log.Noticef("find browser %s success", v.name)
|
||||
for _, b := range multiChromium {
|
||||
log.Noticef("find browser %s success", b.Name())
|
||||
browsers = append(browsers, b)
|
||||
}
|
||||
} else {
|
||||
log.Errorf("new chromium error: %s", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
if c, ok := chromiumList[name]; ok {
|
||||
if profile == "" {
|
||||
profile = c.profilePath
|
||||
}
|
||||
if !fileutil.FolderExists(filepath.Clean(profile)) {
|
||||
log.Fatalf("find browser %s failed, profile folder does not exist", c.name)
|
||||
}
|
||||
chromiumList, err := chromium.New(c.name, c.storage, profile, c.items)
|
||||
if err != nil {
|
||||
log.Fatalf("new chromium error: %s", err)
|
||||
}
|
||||
for _, b := range chromiumList {
|
||||
log.Noticef("find browser %s success", b.Name())
|
||||
browsers = append(browsers, b)
|
||||
}
|
||||
}
|
||||
return browsers
|
||||
}
|
||||
|
||||
func pickFirefox(name, profile string) []Browser {
|
||||
var browsers []Browser
|
||||
name = strings.ToLower(name)
|
||||
if name == "all" || name == "firefox" {
|
||||
for _, v := range firefoxList {
|
||||
if profile == "" {
|
||||
profile = v.profilePath
|
||||
} else {
|
||||
profile = fileutil.ParentDir(profile)
|
||||
}
|
||||
if !fileutil.FolderExists(filepath.Clean(profile)) {
|
||||
log.Noticef("find browser firefox %s failed, profile folder does not exist", v.name)
|
||||
continue
|
||||
}
|
||||
if multiFirefox, err := firefox.New(v.name, v.storage, profile, v.items); err == nil {
|
||||
for _, b := range multiFirefox {
|
||||
log.Noticef("find browser firefox %s success", b.Name())
|
||||
browsers = append(browsers, b)
|
||||
}
|
||||
} else {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
return browsers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func ListBrowsers() []string {
|
||||
var l []string
|
||||
l = append(l, typeutil.Keys(chromiumList)...)
|
||||
l = append(l, typeutil.Keys(firefoxList)...)
|
||||
sort.Strings(l)
|
||||
return l
|
||||
}
|
||||
|
||||
func Names() string {
|
||||
return strings.Join(ListBrowsers(), "|")
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package chromium
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/moond4rk/HackBrowserData/browingdata"
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
"github.com/moond4rk/HackBrowserData/utils/fileutil"
|
||||
"github.com/moond4rk/HackBrowserData/utils/typeutil"
|
||||
)
|
||||
|
||||
type Chromium struct {
|
||||
name string
|
||||
storage string
|
||||
profilePath string
|
||||
masterKey []byte
|
||||
items []item.Item
|
||||
itemPaths map[item.Item]string
|
||||
}
|
||||
|
||||
// New create instance of Chromium browser, fill item's path if item is existed.
|
||||
func New(name, storage, profilePath string, items []item.Item) ([]*Chromium, error) {
|
||||
c := &Chromium{
|
||||
name: name,
|
||||
storage: storage,
|
||||
profilePath: profilePath,
|
||||
items: items,
|
||||
}
|
||||
multiItemPaths, err := c.getMultiItemPath(c.profilePath, c.items)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chromiumList := make([]*Chromium, 0, len(multiItemPaths))
|
||||
for user, itemPaths := range multiItemPaths {
|
||||
chromiumList = append(chromiumList, &Chromium{
|
||||
name: fileutil.BrowserName(name, user),
|
||||
items: typeutil.Keys(itemPaths),
|
||||
itemPaths: itemPaths,
|
||||
storage: storage,
|
||||
})
|
||||
}
|
||||
return chromiumList, nil
|
||||
}
|
||||
|
||||
func (c *Chromium) Name() string {
|
||||
return c.name
|
||||
}
|
||||
|
||||
func (c *Chromium) BrowsingData() (*browingdata.Data, error) {
|
||||
b := browingdata.New(c.items)
|
||||
|
||||
if err := c.copyItemToLocal(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
masterKey, err := c.GetMasterKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c.masterKey = masterKey
|
||||
if err := b.Recovery(c.masterKey); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func (c *Chromium) copyItemToLocal() error {
|
||||
for i, path := range c.itemPaths {
|
||||
filename := i.String()
|
||||
var err error
|
||||
switch {
|
||||
case fileutil.FolderExists(path):
|
||||
if i == item.ChromiumLocalStorage {
|
||||
err = fileutil.CopyDir(path, filename, "lock")
|
||||
}
|
||||
if i == item.ChromiumExtension {
|
||||
err = fileutil.CopyDirHasSuffix(path, filename, "manifest.json")
|
||||
}
|
||||
default:
|
||||
err = fileutil.CopyFile(path, filename)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Chromium) getMultiItemPath(profilePath string, items []item.Item) (map[string]map[item.Item]string, error) {
|
||||
// multiItemPaths is a map of user to item path, map[profile 1][item's name & path key pair]
|
||||
multiItemPaths := make(map[string]map[item.Item]string)
|
||||
parentDir := fileutil.ParentDir(profilePath)
|
||||
err := filepath.Walk(parentDir, chromiumWalkFunc(items, multiItemPaths))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var keyPath string
|
||||
var dir string
|
||||
for userDir, v := range multiItemPaths {
|
||||
for _, p := range v {
|
||||
if strings.HasSuffix(p, item.ChromiumKey.FileName()) {
|
||||
keyPath = p
|
||||
dir = userDir
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
t := make(map[string]map[item.Item]string)
|
||||
for userDir, v := range multiItemPaths {
|
||||
if userDir == dir {
|
||||
continue
|
||||
}
|
||||
t[userDir] = v
|
||||
t[userDir][item.ChromiumKey] = keyPath
|
||||
fillLocalStoragePath(t[userDir], item.ChromiumLocalStorage)
|
||||
}
|
||||
return t, nil
|
||||
}
|
||||
|
||||
func chromiumWalkFunc(items []item.Item, multiItemPaths map[string]map[item.Item]string) filepath.WalkFunc {
|
||||
return func(path string, info fs.FileInfo, err error) error {
|
||||
for _, v := range items {
|
||||
if info.Name() == v.FileName() {
|
||||
if strings.Contains(path, "System Profile") {
|
||||
continue
|
||||
}
|
||||
profileFolder := fileutil.ParentBaseDir(path)
|
||||
if strings.Contains(filepath.ToSlash(path), "/Network/Cookies") {
|
||||
profileFolder = fileutil.BaseDir(strings.ReplaceAll(filepath.ToSlash(path), "/Network/Cookies", ""))
|
||||
}
|
||||
if _, exist := multiItemPaths[profileFolder]; exist {
|
||||
multiItemPaths[profileFolder][v] = path
|
||||
} else {
|
||||
multiItemPaths[profileFolder] = map[item.Item]string{v: path}
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
func fillLocalStoragePath(itemPaths map[item.Item]string, storage item.Item) {
|
||||
if p, ok := itemPaths[item.ChromiumHistory]; ok {
|
||||
lsp := filepath.Join(filepath.Dir(p), storage.FileName())
|
||||
if fileutil.FolderExists(lsp) {
|
||||
itemPaths[item.ChromiumLocalStorage] = lsp
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
//go:build darwin
|
||||
|
||||
package chromium
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha1"
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/crypto/pbkdf2"
|
||||
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
"github.com/moond4rk/HackBrowserData/log"
|
||||
)
|
||||
|
||||
var (
|
||||
errWrongSecurityCommand = errors.New("wrong security command")
|
||||
errCouldNotFindInKeychain = errors.New("could not be find in keychain")
|
||||
)
|
||||
|
||||
func (c *Chromium) GetMasterKey() ([]byte, error) {
|
||||
var (
|
||||
cmd *exec.Cmd
|
||||
stdout, stderr bytes.Buffer
|
||||
)
|
||||
// don't need chromium key file for macOS
|
||||
defer os.Remove(item.TempChromiumKey)
|
||||
// Get the master key from the keychain
|
||||
// $ security find-generic-password -wa 'Chrome'
|
||||
cmd = exec.Command("security", "find-generic-password", "-wa", strings.TrimSpace(c.storage)) //nolint:gosec
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if stderr.Len() > 0 {
|
||||
if strings.Contains(stderr.String(), "could not be found") {
|
||||
return nil, errCouldNotFindInKeychain
|
||||
}
|
||||
return nil, errors.New(stderr.String())
|
||||
}
|
||||
chromeSecret := bytes.TrimSpace(stdout.Bytes())
|
||||
if chromeSecret == nil {
|
||||
return nil, errWrongSecurityCommand
|
||||
}
|
||||
chromeSalt := []byte("saltysalt")
|
||||
// @https://source.chromium.org/chromium/chromium/src/+/master:components/os_crypt/os_crypt_mac.mm;l=157
|
||||
key := pbkdf2.Key(chromeSecret, chromeSalt, 1003, 16, sha1.New)
|
||||
if key == nil {
|
||||
return nil, errWrongSecurityCommand
|
||||
}
|
||||
c.masterKey = key
|
||||
log.Infof("%s initialized master key success", c.name)
|
||||
return key, nil
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
//go:build linux
|
||||
|
||||
package chromium
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"github.com/godbus/dbus/v5"
|
||||
keyring "github.com/ppacher/go-dbus-keyring"
|
||||
"golang.org/x/crypto/pbkdf2"
|
||||
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
"github.com/moond4rk/HackBrowserData/log"
|
||||
)
|
||||
|
||||
func (c *Chromium) GetMasterKey() ([]byte, error) {
|
||||
// what is d-bus @https://dbus.freedesktop.org/
|
||||
var chromiumSecret []byte
|
||||
conn, err := dbus.SessionBus()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer os.Remove(item.TempChromiumKey)
|
||||
svc, err := keyring.GetSecretService(conn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
session, err := svc.OpenSession()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
if err := session.Close(); err != nil {
|
||||
log.Errorf("close session failed: %v", err)
|
||||
}
|
||||
}()
|
||||
collections, err := svc.GetAllCollections()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, col := range collections {
|
||||
items, err := col.GetAllItems()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, i := range items {
|
||||
label, err := i.GetLabel()
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
continue
|
||||
}
|
||||
if label == c.storage {
|
||||
se, err := i.GetSecret(session.Path())
|
||||
if err != nil {
|
||||
return nil, errors.New("get storage from dbus error:" + err.Error())
|
||||
}
|
||||
chromiumSecret = se.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
if chromiumSecret == nil {
|
||||
// @https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/os_crypt_linux.cc;l=100
|
||||
chromiumSecret = []byte("peanuts")
|
||||
}
|
||||
chromiumSalt := []byte("saltysalt")
|
||||
// @https://source.chromium.org/chromium/chromium/src/+/master:components/os_crypt/os_crypt_linux.cc
|
||||
key := pbkdf2.Key(chromiumSecret, chromiumSalt, 1, 16, sha1.New)
|
||||
c.masterKey = key
|
||||
log.Infof("%s initialized master key success", c.name)
|
||||
return key, nil
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//go:build windows
|
||||
|
||||
package chromium
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
"github.com/moond4rk/HackBrowserData/log"
|
||||
"github.com/moond4rk/HackBrowserData/utils/fileutil"
|
||||
)
|
||||
|
||||
var errDecodeMasterKeyFailed = errors.New("decode master key failed")
|
||||
|
||||
func (c *Chromium) GetMasterKey() ([]byte, error) {
|
||||
keyFile, err := fileutil.ReadFile(item.TempChromiumKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer os.Remove(keyFile)
|
||||
encryptedKey := gjson.Get(keyFile, "os_crypt.encrypted_key")
|
||||
if !encryptedKey.Exists() {
|
||||
return nil, nil
|
||||
}
|
||||
pureKey, err := base64.StdEncoding.DecodeString(encryptedKey.String())
|
||||
if err != nil {
|
||||
return nil, errDecodeMasterKeyFailed
|
||||
}
|
||||
c.masterKey, err = crypto.DPAPI(pureKey[5:])
|
||||
log.Infof("%s initialized master key success", c.name)
|
||||
return c.masterKey, err
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package browser
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// home dir path for all platforms
|
||||
var homeDir, _ = os.UserHomeDir()
|
||||
|
||||
const (
|
||||
chromeName = "Chrome"
|
||||
chromeBetaName = "Chrome Beta"
|
||||
chromiumName = "Chromium"
|
||||
edgeName = "Microsoft Edge"
|
||||
braveName = "Brave"
|
||||
operaName = "Opera"
|
||||
operaGXName = "OperaGX"
|
||||
vivaldiName = "Vivaldi"
|
||||
coccocName = "CocCoc"
|
||||
yandexName = "Yandex"
|
||||
firefoxName = "Firefox"
|
||||
speed360Name = "360speed"
|
||||
qqBrowserName = "QQ"
|
||||
dcBrowserName = "DC"
|
||||
sogouName = "Sogou"
|
||||
)
|
||||
@@ -0,0 +1,107 @@
|
||||
package firefox
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/moond4rk/HackBrowserData/browingdata"
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
"github.com/moond4rk/HackBrowserData/utils/fileutil"
|
||||
"github.com/moond4rk/HackBrowserData/utils/typeutil"
|
||||
)
|
||||
|
||||
type Firefox struct {
|
||||
name string
|
||||
storage string
|
||||
profilePath string
|
||||
masterKey []byte
|
||||
items []item.Item
|
||||
itemPaths map[item.Item]string
|
||||
}
|
||||
|
||||
var ErrProfilePathNotFound = errors.New("profile path not found")
|
||||
|
||||
// New returns a new Firefox instance.
|
||||
func New(name, storage, profilePath string, items []item.Item) ([]*Firefox, error) {
|
||||
f := &Firefox{
|
||||
name: name,
|
||||
storage: storage,
|
||||
profilePath: profilePath,
|
||||
items: items,
|
||||
}
|
||||
multiItemPaths, err := f.getMultiItemPath(f.profilePath, f.items)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
firefoxList := make([]*Firefox, 0, len(multiItemPaths))
|
||||
for name, itemPaths := range multiItemPaths {
|
||||
firefoxList = append(firefoxList, &Firefox{
|
||||
name: fmt.Sprintf("Firefox-%s", name),
|
||||
items: typeutil.Keys(itemPaths),
|
||||
itemPaths: itemPaths,
|
||||
})
|
||||
}
|
||||
return firefoxList, nil
|
||||
}
|
||||
|
||||
func (f *Firefox) getMultiItemPath(profilePath string, items []item.Item) (map[string]map[item.Item]string, error) {
|
||||
multiItemPaths := make(map[string]map[item.Item]string)
|
||||
err := filepath.Walk(profilePath, firefoxWalkFunc(items, multiItemPaths))
|
||||
return multiItemPaths, err
|
||||
}
|
||||
|
||||
func (f *Firefox) copyItemToLocal() error {
|
||||
for i, path := range f.itemPaths {
|
||||
filename := i.String()
|
||||
if err := fileutil.CopyFile(path, filename); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func firefoxWalkFunc(items []item.Item, multiItemPaths map[string]map[item.Item]string) filepath.WalkFunc {
|
||||
return func(path string, info fs.FileInfo, err error) error {
|
||||
for _, v := range items {
|
||||
if info.Name() == v.FileName() {
|
||||
parentBaseDir := fileutil.ParentBaseDir(path)
|
||||
if _, exist := multiItemPaths[parentBaseDir]; exist {
|
||||
multiItemPaths[parentBaseDir][v] = path
|
||||
} else {
|
||||
multiItemPaths[parentBaseDir] = map[item.Item]string{v: path}
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Firefox) GetMasterKey() ([]byte, error) {
|
||||
return f.masterKey, nil
|
||||
}
|
||||
|
||||
func (f *Firefox) Name() string {
|
||||
return f.name
|
||||
}
|
||||
|
||||
func (f *Firefox) BrowsingData() (*browingdata.Data, error) {
|
||||
b := browingdata.New(f.items)
|
||||
|
||||
if err := f.copyItemToLocal(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
masterKey, err := f.GetMasterKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
f.masterKey = masterKey
|
||||
if err := b.Recovery(f.masterKey); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
//go:build darwin
|
||||
|
||||
package browser
|
||||
|
||||
import (
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
)
|
||||
|
||||
var (
|
||||
chromiumList = map[string]struct {
|
||||
name string
|
||||
storage string
|
||||
profilePath string
|
||||
items []item.Item
|
||||
}{
|
||||
"chrome": {
|
||||
name: chromeName,
|
||||
storage: chromeStorageName,
|
||||
profilePath: chromeProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"edge": {
|
||||
name: edgeName,
|
||||
storage: edgeStorageName,
|
||||
profilePath: edgeProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"chromium": {
|
||||
name: chromiumName,
|
||||
storage: chromiumStorageName,
|
||||
profilePath: chromiumProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"chrome-beta": {
|
||||
name: chromeBetaName,
|
||||
storage: chromeBetaStorageName,
|
||||
profilePath: chromeBetaProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"opera": {
|
||||
name: operaName,
|
||||
profilePath: operaProfilePath,
|
||||
storage: operaStorageName,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"opera-gx": {
|
||||
name: operaGXName,
|
||||
profilePath: operaGXProfilePath,
|
||||
storage: operaStorageName,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"vivaldi": {
|
||||
name: vivaldiName,
|
||||
storage: vivaldiStorageName,
|
||||
profilePath: vivaldiProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"coccoc": {
|
||||
name: coccocName,
|
||||
storage: coccocStorageName,
|
||||
profilePath: coccocProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"brave": {
|
||||
name: braveName,
|
||||
profilePath: braveProfilePath,
|
||||
storage: braveStorageName,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"yandex": {
|
||||
name: yandexName,
|
||||
storage: yandexStorageName,
|
||||
profilePath: yandexProfilePath,
|
||||
items: item.DefaultYandex,
|
||||
},
|
||||
}
|
||||
firefoxList = map[string]struct {
|
||||
name string
|
||||
storage string
|
||||
profilePath string
|
||||
items []item.Item
|
||||
}{
|
||||
"firefox": {
|
||||
name: firefoxName,
|
||||
profilePath: firefoxProfilePath,
|
||||
items: item.DefaultFirefox,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
chromeProfilePath = homeDir + "/Library/Application Support/Google/Chrome/Default/"
|
||||
chromeBetaProfilePath = homeDir + "/Library/Application Support/Google/Chrome Beta/Default/"
|
||||
chromiumProfilePath = homeDir + "/Library/Application Support/Chromium/Default/"
|
||||
edgeProfilePath = homeDir + "/Library/Application Support/Microsoft Edge/Default/"
|
||||
braveProfilePath = homeDir + "/Library/Application Support/BraveSoftware/Brave-Browser/Default/"
|
||||
operaProfilePath = homeDir + "/Library/Application Support/com.operasoftware.Opera/Default/"
|
||||
operaGXProfilePath = homeDir + "/Library/Application Support/com.operasoftware.OperaGX/Default/"
|
||||
vivaldiProfilePath = homeDir + "/Library/Application Support/Vivaldi/Default/"
|
||||
coccocProfilePath = homeDir + "/Library/Application Support/Coccoc/Default/"
|
||||
yandexProfilePath = homeDir + "/Library/Application Support/Yandex/YandexBrowser/Default/"
|
||||
|
||||
firefoxProfilePath = homeDir + "/Library/Application Support/Firefox/Profiles/"
|
||||
)
|
||||
|
||||
const (
|
||||
chromeStorageName = "Chrome"
|
||||
chromeBetaStorageName = "Chrome"
|
||||
chromiumStorageName = "Chromium"
|
||||
edgeStorageName = "Microsoft Edge"
|
||||
braveStorageName = "Brave"
|
||||
operaStorageName = "Opera"
|
||||
vivaldiStorageName = "Vivaldi"
|
||||
coccocStorageName = "CocCoc"
|
||||
yandexStorageName = "Yandex"
|
||||
)
|
||||
@@ -0,0 +1,92 @@
|
||||
//go:build linux
|
||||
|
||||
package browser
|
||||
|
||||
import (
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
)
|
||||
|
||||
var (
|
||||
chromiumList = map[string]struct {
|
||||
name string
|
||||
storage string
|
||||
profilePath string
|
||||
items []item.Item
|
||||
}{
|
||||
"chrome": {
|
||||
name: chromeName,
|
||||
storage: chromeStorageName,
|
||||
profilePath: chromeProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"edge": {
|
||||
name: edgeName,
|
||||
storage: edgeStorageName,
|
||||
profilePath: edgeProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"chromium": {
|
||||
name: chromiumName,
|
||||
storage: chromiumStorageName,
|
||||
profilePath: chromiumProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"chrome-beta": {
|
||||
name: chromeBetaName,
|
||||
storage: chromeBetaStorageName,
|
||||
profilePath: chromeBetaProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"opera": {
|
||||
name: operaName,
|
||||
profilePath: operaProfilePath,
|
||||
storage: operaStorageName,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"vivaldi": {
|
||||
name: vivaldiName,
|
||||
storage: vivaldiStorageName,
|
||||
profilePath: vivaldiProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"brave": {
|
||||
name: braveName,
|
||||
profilePath: braveProfilePath,
|
||||
storage: braveStorageName,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
}
|
||||
firefoxList = map[string]struct {
|
||||
name string
|
||||
storage string
|
||||
profilePath string
|
||||
items []item.Item
|
||||
}{
|
||||
"firefox": {
|
||||
name: firefoxName,
|
||||
profilePath: firefoxProfilePath,
|
||||
items: item.DefaultFirefox,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
firefoxProfilePath = homeDir + "/.mozilla/firefox/"
|
||||
chromeProfilePath = homeDir + "/.config/google-chrome/Default/"
|
||||
chromiumProfilePath = homeDir + "/.config/chromium/Default/"
|
||||
edgeProfilePath = homeDir + "/.config/microsoft-edge/Default/"
|
||||
braveProfilePath = homeDir + "/.config/BraveSoftware/Brave-Browser/Default/"
|
||||
chromeBetaProfilePath = homeDir + "/.config/google-chrome-beta/Default/"
|
||||
operaProfilePath = homeDir + "/.config/opera/Default/"
|
||||
vivaldiProfilePath = homeDir + "/.config/vivaldi/Default/"
|
||||
)
|
||||
|
||||
const (
|
||||
chromeStorageName = "Chrome Safe Storage"
|
||||
chromiumStorageName = "Chromium Safe Storage"
|
||||
edgeStorageName = "Chromium Safe Storage"
|
||||
braveStorageName = "Brave Safe Storage"
|
||||
chromeBetaStorageName = "Chrome Safe Storage"
|
||||
operaStorageName = "Chromium Safe Storage"
|
||||
vivaldiStorageName = "Chrome Safe Storage"
|
||||
)
|
||||
@@ -0,0 +1,118 @@
|
||||
//go:build windows
|
||||
|
||||
package browser
|
||||
|
||||
import (
|
||||
"github.com/moond4rk/HackBrowserData/item"
|
||||
)
|
||||
|
||||
var (
|
||||
chromiumList = map[string]struct {
|
||||
name string
|
||||
profilePath string
|
||||
storage string
|
||||
items []item.Item
|
||||
}{
|
||||
"chrome": {
|
||||
name: chromeName,
|
||||
profilePath: chromeUserDataPath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"edge": {
|
||||
name: edgeName,
|
||||
profilePath: edgeProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"chromium": {
|
||||
name: chromiumName,
|
||||
profilePath: chromiumUserDataPath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"chrome-beta": {
|
||||
name: chromeBetaName,
|
||||
profilePath: chromeBetaUserDataPath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"opera": {
|
||||
name: operaName,
|
||||
profilePath: operaProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"opera-gx": {
|
||||
name: operaGXName,
|
||||
profilePath: operaGXProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"vivaldi": {
|
||||
name: vivaldiName,
|
||||
profilePath: vivaldiProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"coccoc": {
|
||||
name: coccocName,
|
||||
profilePath: coccocProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"brave": {
|
||||
name: braveName,
|
||||
profilePath: braveProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"yandex": {
|
||||
name: yandexName,
|
||||
profilePath: yandexProfilePath,
|
||||
items: item.DefaultYandex,
|
||||
},
|
||||
"360": {
|
||||
name: speed360Name,
|
||||
profilePath: speed360ProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"qq": {
|
||||
name: qqBrowserName,
|
||||
profilePath: qqBrowserProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"dc": {
|
||||
name: dcBrowserName,
|
||||
profilePath: dcBrowserProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
"sogou": {
|
||||
name: sogouName,
|
||||
profilePath: sogouProfilePath,
|
||||
items: item.DefaultChromium,
|
||||
},
|
||||
}
|
||||
firefoxList = map[string]struct {
|
||||
name string
|
||||
storage string
|
||||
profilePath string
|
||||
items []item.Item
|
||||
}{
|
||||
"firefox": {
|
||||
name: firefoxName,
|
||||
profilePath: firefoxProfilePath,
|
||||
items: item.DefaultFirefox,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
chromeUserDataPath = homeDir + "/AppData/Local/Google/Chrome/User Data/Default/"
|
||||
chromeBetaUserDataPath = homeDir + "/AppData/Local/Google/Chrome Beta/User Data/Default/"
|
||||
chromiumUserDataPath = homeDir + "/AppData/Local/Chromium/User Data/Default/"
|
||||
edgeProfilePath = homeDir + "/AppData/Local/Microsoft/Edge/User Data/Default/"
|
||||
braveProfilePath = homeDir + "/AppData/Local/BraveSoftware/Brave-Browser/User Data/Default/"
|
||||
speed360ProfilePath = homeDir + "/AppData/Local/360chrome/Chrome/User Data/Default/"
|
||||
qqBrowserProfilePath = homeDir + "/AppData/Local/Tencent/QQBrowser/User Data/Default/"
|
||||
operaProfilePath = homeDir + "/AppData/Roaming/Opera Software/Opera Stable/"
|
||||
operaGXProfilePath = homeDir + "/AppData/Roaming/Opera Software/Opera GX Stable/"
|
||||
vivaldiProfilePath = homeDir + "/AppData/Local/Vivaldi/User Data/Default/"
|
||||
coccocProfilePath = homeDir + "/AppData/Local/CocCoc/Browser/User Data/Default/"
|
||||
yandexProfilePath = homeDir + "/AppData/Local/Yandex/YandexBrowser/User Data/Default/"
|
||||
dcBrowserProfilePath = homeDir + "/AppData/Local/DCBrowser/User Data/Default/"
|
||||
sogouProfilePath = homeDir + "/AppData/Roaming/SogouExplorer/Webkit/Default/"
|
||||
|
||||
firefoxProfilePath = homeDir + "/AppData/Roaming/Mozilla/Firefox/Profiles/"
|
||||
)
|
||||
Reference in New Issue
Block a user