support chrome beta

moond4rk 4 years ago
parent 19410d4666
commit 8e50fa6c12
  1. 2
      cmd/cmd.go
  2. 2
      core/browser.go
  3. 19
      core/browser_darwin.go
  4. 8
      core/browser_linux.go

@ -23,7 +23,7 @@ func Execute() {
Name: "hack-browser-data",
Usage: "Export passwords/cookies/history/bookmarks from browser",
UsageText: "[hack-browser-data -b chrome -f json -dir results -cc]\n Get all data(password/cookie/history/bookmark) from chrome",
Version: "0.2.7",
Version: "0.2.8",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "verbose", Aliases: []string{"vv"}, Destination: &verbose, Value: false, Usage: "Verbose"},
&cli.BoolFlag{Name: "compress", Aliases: []string{"cc"}, Destination: &compress, Value: false, Usage: "Compress result to zip"},

@ -102,7 +102,7 @@ type Chromium struct {
name string
profilePath string
keyPath string
storage string // use for linux browser
storage string // storage use for linux and macOS, get secret key
secretKey []byte
}

@ -11,11 +11,19 @@ import (
const (
chromeProfilePath = "/Users/*/Library/Application Support/Google/Chrome/*/"
chromeBetaProfilePath = "/Users/*/Library/Application Support/Google/Chrome Beta/*/"
edgeProfilePath = "/Users/*/Library/Application Support/Microsoft Edge/*/"
fireFoxProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-release/"
braveProfilePath = "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/*/"
)
const (
chromeStorageName = "Chrome"
chromeBetaStorageName = "Chrome"
edgeStorageName = "Microsoft Edge"
braveStorageName = "Brave"
)
var (
browserList = map[string]struct {
ProfilePath string
@ -32,16 +40,25 @@ var (
"chrome": {
ProfilePath: chromeProfilePath,
Name: chromeName,
Storage: chromeStorageName,
New: NewChromium,
},
"edge": {
ProfilePath: edgeProfilePath,
Name: edgeName,
Storage: edgeStorageName,
New: NewChromium,
},
"brave": {
ProfilePath: braveProfilePath,
Name: braveName,
Storage: braveStorageName,
New: NewChromium,
},
"chrome-beta": {
ProfilePath: chromeBetaProfilePath,
Name: chromeBetaName,
Storage: chromeBetaStorageName,
New: NewChromium,
},
}
@ -53,7 +70,7 @@ func (c *Chromium) InitSecretKey() error {
stdout, stderr bytes.Buffer
)
// ➜ security find-generic-password -wa 'Chrome'
cmd = exec.Command("security", "find-generic-password", "-wa", c.name)
cmd = exec.Command("security", "find-generic-password", "-wa", c.storage)
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err := cmd.Run()

@ -15,12 +15,14 @@ const (
chromeProfilePath = "/home/*/.config/google-chrome/*/"
edgeProfilePath = "/home/*/.config/microsoft-edge*/*/"
braveProfilePath = "/home/*/.config/BraveSoftware/Brave-Browser/*/"
chromeBateProfilePath = "/home/*/.config/google-chrome-beta/*/"
)
const (
chromeStorageName = "Chrome Safe Storage"
edgeStorageName = "Chromium Safe Storage"
braveStorageName = "Brave Safe Storage"
chromeBetaStorageName = "Chrome Safe Storage"
)
var (
@ -54,6 +56,12 @@ var (
Storage: braveStorageName,
New: NewChromium,
},
"chrome-beta": {
ProfilePath: chromeBateProfilePath,
Name: chromeBetaName,
Storage: chromeBetaStorageName,
New: NewChromium,
},
}
)

Loading…
Cancel
Save