diff --git a/cmd/cmd.go b/cmd/cmd.go index cd1c523..09e9c00 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.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"}, diff --git a/core/browser.go b/core/browser.go index e1b60fd..9990933 100644 --- a/core/browser.go +++ b/core/browser.go @@ -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 } diff --git a/core/browser_darwin.go b/core/browser_darwin.go index d5b1b4f..f46347e 100644 --- a/core/browser_darwin.go +++ b/core/browser_darwin.go @@ -10,10 +10,18 @@ import ( ) const ( - chromeProfilePath = "/Users/*/Library/Application Support/Google/Chrome/*/" - edgeProfilePath = "/Users/*/Library/Application Support/Microsoft Edge/*/" - fireFoxProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-release/" - braveProfilePath = "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/*/" + 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 ( @@ -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() diff --git a/core/browser_linux.go b/core/browser_linux.go index 3049d73..10e83b2 100644 --- a/core/browser_linux.go +++ b/core/browser_linux.go @@ -11,16 +11,18 @@ import ( ) const ( - fireFoxProfilePath = "/home/*/.mozilla/firefox/*.default-release/" - chromeProfilePath = "/home/*/.config/google-chrome/*/" - edgeProfilePath = "/home/*/.config/microsoft-edge*/*/" - braveProfilePath = "/home/*/.config/BraveSoftware/Brave-Browser/*/" + fireFoxProfilePath = "/home/*/.mozilla/firefox/*.default-release/" + 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" + 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, + }, } )