chore: support firefox for linux github action

pull/83/head
ᴍᴏᴏɴD4ʀᴋ 4 years ago
parent f4294839f6
commit 500ac34ab3
  1. 16
      .github/workflows/release.yml
  2. 14
      README.md
  3. 52
      core/common.go
  4. 2
      utils/utils_linux.go

@ -11,9 +11,6 @@ jobs:
matrix: matrix:
os: [windows-latest, macos-latest] os: [windows-latest, macos-latest]
arch: [amd64] arch: [amd64]
# We sometimes use different verbiage for things (e.g. "darwin"
# for the GOOS build flag and "osx" in the actual release ZIP).
# We need to specify those here.
include: include:
- os: windows-latest - os: windows-latest
goos: windows goos: windows
@ -23,16 +20,22 @@ jobs:
goos: darwin goos: darwin
bin: 'hack-browser-data' bin: 'hack-browser-data'
releaseos: osx releaseos: osx
- os: ubuntu-latest
goos: linux
bin: 'hack-browser-data'
releaseos: linux
exclude: exclude:
- os: macos-latest - os: macos-latest
arch: '386' arch: '386'
- os: windows-latest
arch: '386'
steps: steps:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.14 go-version: 1.14
# - if: matrix.os == 'ubuntu-latest' - if: matrix.os == 'ubuntu-latest'
# run: sudo apt-get update && sudo apt-get install -y gcc-multilib run: sudo apt-get update && sudo apt-get install -y gcc-multilib
- if: matrix.arch == '386' - if: matrix.arch == '386'
run: echo "::set-env name=RELEASE::hack-browser-data-${{ github.event.release.tag_name }}-${{ matrix.releaseos}}-32bit" run: echo "::set-env name=RELEASE::hack-browser-data-${{ github.event.release.tag_name }}-${{ matrix.releaseos}}-32bit"
- if: matrix.arch == 'amd64' - if: matrix.arch == 'amd64'
@ -49,7 +52,6 @@ jobs:
with: with:
name: ${{ env.RELEASE }} name: ${{ env.RELEASE }}
path: ${{ matrix.bin }} path: ${{ matrix.bin }}
package: package:
name: Package Assets name: Package Assets
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -91,8 +93,6 @@ jobs:
with: with:
name: releases name: releases
path: releases/ path: releases/
# I would love to use @actions/upload-release-asset, but they don't
# support wildcards in the asset path. Ref #9, #24, and #47
- name: Upload Archives to Release - name: Upload Archives to Release
env: env:
UPLOAD_URL: ${{ github.event.release.upload_url }} UPLOAD_URL: ${{ github.event.release.upload_url }}

@ -1,6 +1,6 @@
# HackBrowserData # HackBrowserData
hack-browser-data is an open-source tool that could help you export data from browser. It supports the most popular browsers on the market and runs on Windows and macOS. hack-browser-data is an open-source tool that could help you export data from browser. It supports the most popular browsers on the market and runs on Windows, macOS and Linux.
### Supported Browser ### Supported Browser
@ -27,11 +27,9 @@ Because of the security policies, all those browsers require a password.
#### Linux #### Linux
These browsers will be supported in the future.
| Browser | Password | Cookie | Bookmark | History | | Browser | Password | Cookie | Bookmark | History |
| :---------------------------------- | :------: | :----: | :------: | :-----: | | :---------------------------------- | :------: | :----: | :------: | :-----: |
| Firefox | ❌ | ❌ | ❌ | ❌ | | Firefox | ✅ | ✅ | ✅ | ✅ |
| Google Chrome | ❌ | ❌ | ❌ | ❌ | | Google Chrome | ❌ | ❌ | ❌ | ❌ |
@ -64,10 +62,10 @@ USAGE:
Get all data(password/cookie/history/bookmark) from chrome Get all data(password/cookie/history/bookmark) from chrome
GLOBAL OPTIONS: GLOBAL OPTIONS:
--verbose, --vv verbose (default: false) --verbose, --vv Verbose (default: false)
--browser value, -b value available browsers: chrome|edge|360speed|qq|firefox (default: "chrome") --browser value, -b value Available browsers: chrome|edge|360speed|qq|firefox (default: "chrome")
--results-dir value, --dir value export dir (default: "results") --results-dir value, --dir value Export dir (default: "results")
--format value, -f value result format, csv|json (default: "csv") --format value, -f value Format, csv|json (default: "csv")
--export-data value, -e value all|password|cookie|history|bookmark (default: "all") --export-data value, -e value all|password|cookie|history|bookmark (default: "all")
--help, -h show help (default: false) --help, -h show help (default: false)

@ -98,7 +98,11 @@ var bookmarkList BookmarkSlice
func parseBookmarks() { func parseBookmarks() {
bookmarks, err := utils.ReadFile(utils.Bookmarks) bookmarks, err := utils.ReadFile(utils.Bookmarks)
defer os.Remove(utils.Bookmarks) defer func() {
if err := os.Remove(utils.Bookmarks); err != nil {
log.Error(err)
}
}()
if err != nil { if err != nil {
log.Debug(err) log.Debug(err)
} }
@ -119,7 +123,11 @@ func parseLogin() {
var loginItemList LoginDataSlice var loginItemList LoginDataSlice
login := loginData{} login := loginData{}
loginDB, err := sql.Open("sqlite3", utils.LoginData) loginDB, err := sql.Open("sqlite3", utils.LoginData)
defer os.Remove(utils.LoginData) defer func() {
if err := os.Remove(utils.LoginData); err != nil {
log.Error(err)
}
}()
defer func() { defer func() {
if err := loginDB.Close(); err != nil { if err := loginDB.Close(); err != nil {
log.Debug(err) log.Debug(err)
@ -173,7 +181,11 @@ func parseCookie() {
cookie := cookies{} cookie := cookies{}
cookieMap := make(map[string][]cookies) cookieMap := make(map[string][]cookies)
cookieDB, err := sql.Open("sqlite3", utils.Cookies) cookieDB, err := sql.Open("sqlite3", utils.Cookies)
defer os.Remove(utils.Cookies) defer func() {
if err := os.Remove(utils.Cookies); err != nil {
log.Error(err)
}
}()
defer func() { defer func() {
if err := cookieDB.Close(); err != nil { if err := cookieDB.Close(); err != nil {
log.Debug(err) log.Debug(err)
@ -232,7 +244,11 @@ func parseHistory() {
var historyList HistorySlice var historyList HistorySlice
h := history{} h := history{}
historyDB, err := sql.Open("sqlite3", utils.History) historyDB, err := sql.Open("sqlite3", utils.History)
defer os.Remove(utils.History) defer func() {
if err := os.Remove(utils.History); err != nil {
log.Error(err)
}
}()
defer func() { defer func() {
if err := historyDB.Close(); err != nil { if err := historyDB.Close(); err != nil {
log.Debug(err) log.Debug(err)
@ -305,7 +321,11 @@ func parseFirefoxData() {
) )
tempMap = make(map[int64]string) tempMap = make(map[int64]string)
keyDB, err = sql.Open("sqlite3", utils.FirefoxData) keyDB, err = sql.Open("sqlite3", utils.FirefoxData)
defer os.Remove(utils.FirefoxData) defer func() {
if err := os.Remove(utils.FirefoxData); err != nil {
log.Error(err)
}
}()
defer func() { defer func() {
err := keyDB.Close() err := keyDB.Close()
if err != nil { if err != nil {
@ -378,11 +398,11 @@ func GetDecryptKey() (b [][]byte) {
pwdRows *sql.Rows pwdRows *sql.Rows
nssRows *sql.Rows nssRows *sql.Rows
) )
//defer func() { defer func() {
// if err := os.Remove(utils.FirefoxKey4DB); err != nil { if err := os.Remove(utils.FirefoxKey4DB); err != nil {
// log.Error(err) log.Error(err)
// } }
//}() }()
keyDB, err = sql.Open("sqlite3", utils.FirefoxKey4DB) keyDB, err = sql.Open("sqlite3", utils.FirefoxKey4DB)
defer func() { defer func() {
if err := keyDB.Close(); err != nil { if err := keyDB.Close(); err != nil {
@ -499,7 +519,11 @@ func parseFirefoxCookie() {
cookie := cookies{} cookie := cookies{}
cookieMap := make(map[string][]cookies) cookieMap := make(map[string][]cookies)
cookieDB, err := sql.Open("sqlite3", utils.FirefoxCookie) cookieDB, err := sql.Open("sqlite3", utils.FirefoxCookie)
defer os.Remove(utils.FirefoxCookie) defer func() {
if err := os.Remove(utils.FirefoxCookie); err != nil {
log.Debug(err)
}
}()
defer func() { defer func() {
if err := cookieDB.Close(); err != nil { if err := cookieDB.Close(); err != nil {
log.Debug(err) log.Debug(err)
@ -548,7 +572,11 @@ func GetLoginData() (l []loginData) {
if err != nil { if err != nil {
log.Warn(err) log.Warn(err)
} }
//defer os.Remove(utils.FirefoxLoginData) defer func() {
if err := os.Remove(utils.FirefoxLoginData); err != nil {
log.Error(err)
}
}()
h := gjson.GetBytes(s, "logins") h := gjson.GetBytes(s, "logins")
if h.Exists() { if h.Exists() {
for _, v := range h.Array() { for _, v := range h.Array() {

@ -13,7 +13,7 @@ import (
) )
const ( const (
fireFoxProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-release/" fireFoxProfilePath = "/home/*/.mozilla/firefox/*.default-release/"
fireFoxCommand = "" fireFoxCommand = ""
) )

Loading…
Cancel
Save