feat: support brave browser, Close #31

pull/83/head
ᴍᴏᴏɴD4ʀᴋ 4 years ago
parent f61750b1bf
commit 25bac647e6
  1. 2
      cmd/cmd.go
  2. 1
      core/browser.go
  3. 6
      core/browser_darwin.go
  4. 8
      core/browser_linux.go
  5. 8
      core/browser_windows.go
  6. 6
      core/common/parse.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.4",
Version: "0.2.5",
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"},

@ -15,6 +15,7 @@ const (
firefoxName = "Firefox"
speed360Name = "360speed"
qqBrowserName = "qq"
braveName = "Brave"
)
type Browser interface {

@ -13,6 +13,7 @@ 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/*/"
)
var (
@ -38,6 +39,11 @@ var (
Name: edgeName,
New: NewChromium,
},
"brave": {
ProfilePath: braveProfilePath,
Name: braveName,
New: NewChromium,
},
}
)

@ -13,11 +13,13 @@ const (
fireFoxProfilePath = "/home/*/.mozilla/firefox/*.default-release/"
chromeProfilePath = "/home/*/.config/google-chrome/*/"
edgeProfilePath = "/home/*/.config/microsoft-edge*/*/"
braveProfilePath = "/home/*/.config/BraveSoftware/Brave-Browser/*/"
)
const (
chromeStorageName = "Chrome Safe Storage"
edgeStorageName = "Chromium Safe Storage"
braveStorageName = "Brave Safe Storage"
)
var (
@ -45,6 +47,12 @@ var (
Storage: edgeStorageName,
New: NewChromium,
},
"brave": {
ProfilePath: braveProfilePath,
Name: braveName,
Storage: braveStorageName,
New: NewChromium,
},
}
)

@ -15,6 +15,8 @@ const (
chromeKeyPath = "/AppData/Local/Google/Chrome/User Data/Local State"
edgeProfilePath = "/AppData/Local/Microsoft/Edge/User Data/*/"
edgeKeyPath = "/AppData/Local/Microsoft/Edge/User Data/Local State"
braveProfilePath = "/AppData/Local/BraveSoftware/Brave-Browser/User Data/*/"
braveKeyPath = "/AppData/Local/BraveSoftware/Brave-Browser/User Data/Local State"
speed360ProfilePath = "/AppData/Local/360chrome/Chrome/User Data/*/"
speed360KeyPath = ""
qqBrowserProfilePath = "/AppData/Local/Tencent/QQBrowser/User Data/*/"
@ -58,6 +60,12 @@ var (
Name: firefoxName,
New: NewFirefox,
},
"brave": {
ProfilePath: os.Getenv("USERPROFILE") + braveProfilePath,
KeyPath: os.Getenv("USERPROFILE") + braveKeyPath,
Name: braveName,
New: NewChromium,
},
}
)

@ -184,6 +184,9 @@ func (c *cookies) ChromeParse(secretKey []byte) error {
}
}()
rows, err := cookieDB.Query(queryChromiumCookie)
if err != nil {
return err
}
defer func() {
if err := rows.Close(); err != nil {
log.Debug(err)
@ -308,6 +311,9 @@ func (h *historyData) ChromeParse(key []byte) error {
}
}()
rows, err := historyDB.Query(queryChromiumHistory)
if err != nil {
return err
}
defer func() {
if err := rows.Close(); err != nil {
log.Debug(err)

Loading…
Cancel
Save