43 Commits

Author SHA1 Message Date
Roger d105a1f488 feat: add Safari bookmark and download extraction from plist (#567)
* feat: add Safari bookmark and download extraction from plist files
* test: add nested folder test for bookmark tree traversal
Part of #565
2026-04-12 01:50:54 +08:00
Roger 7bf1759dd9 feat: add Safari cookie extraction from BinaryCookies format (#566)
* feat: add Safari cookie extraction from BinaryCookies format
* fix: use expiry presence instead of current time for HasExpire
2026-04-12 01:16:59 +08:00
Roger ccc8643d86 feat: add interactive terminal password prompt for keychain unlock (#558)
* feat(darwin): add interactive terminal password prompt for keychain unlock (#556)
* test: add unit tests for keyretriever and address review feedback

- Add errStorageNotFound sentinel error for precise error matching
- Non-TTY TerminalPasswordRetriever returns nil silently (review #558)
- Add darwin tests: findStorageKey, empty password, non-TTY skip
- Add linux tests: FallbackRetriever peanuts key, DefaultRetriever chain

* fix: add nolint:unused for errStorageNotFound on Windows, clean up error message

errStorageNotFound is only used on darwin/linux; Windows lint flagged it
as unused. Also simplify error format to avoid "storage" duplication.

* fix: add nolint:unused for errStorageNotFound, simplify error message

errStorageNotFound is only referenced on darwin and linux; Windows lint
flags it as unused. Also remove redundant "storage" prefix from the
error format string.
2026-04-06 01:27:13 +08:00
Roger 4af2ded428 feat: cli migrate to cobra with subcommands (#550)
* feat: migrate CLI to cobra with dump/list/version subcommands (#546)
* fix: remove residual duckduckgo references and add README/LICENSE to release archives
* fix: address PR review feedback from Copilot
2026-04-05 14:25:51 +08:00
Roger e35907de6f refactor: remove dead code and rename V2 files (#541)
* refactor: remove V1 dead code and rename V2 files

- Delete extractor/ package (V1 Extractor interface and registry)
- Delete browserdata/ package (V1 orchestrator, outputter, 9 sub-packages)
- Delete V1 browser implementations (chromium.go, chromium_{platform}.go, firefox.go)
- Delete types/types.go (V1 DataType enum) and utils/byteutil/
- Remove gocsv and go-sqlmock dependencies, demote x/text to indirect
- Upgrade keychainbreaker v0.1.0 → v0.2.5
- Rename chromium_new.go → chromium.go, firefox_new.go → firefox.go

* refactor: remove unused V1 utility functions

Remove functions no longer called by V2 code:
- fileutil: IsDirExists, CopyDir, BrowserName, ReadFile, CopyFile,
  Filename, ParentDir, ParentBaseDir, BaseDir
- typeutil: Keys, IntToBool
2026-04-04 15:51:54 +08:00
Roger 9fb5165fcb feat: add crypto/keyretriever with keychainbreaker integration (#518)
* feat: add crypto/keyretriever package for Chromium master key retrieval

* feat: complete keyretriever with gcoredump, chainbreaker, and tests

* refactor: replace internal chainbreaker with keychainbreaker v0.1.0

Replace the incomplete internal chainbreaker implementation (~1400 lines
of duplicated code) with the external keychainbreaker package, which
provides a complete, well-tested keychain parsing library.

Changes:
- Add github.com/moond4rk/keychainbreaker v0.1.0 dependency
- Update gcoredump_darwin.go to use keychainbreaker API (Open/Unlock/GenericPasswords)
- Add KeychainPasswordRetriever for password-based keychain unlocking
  with sync.Once caching across multiple browser queries
- Unify DefaultRetriever(keychainPassword string) signature across all platforms
- Delete utils/chainbreaker/ (696 lines + test + testdata)
- Delete crypto/keyretriever/chainbreaker_darwin.go (696 lines duplicate)
- Delete browser/exploit/gcoredump/ (duplicate of keyretriever version)
- Update chromium_darwin.go to use keyretriever.DecryptKeychain
- Clean up .golangci.yml lint exceptions and .gitignore entries
- Use errors.Is() instead of == for context.DeadlineExceeded check

* refactor: improve gcoredump exploit code quality and add comments
* fix: address Copilot review feedback on keyretriever
2026-04-04 01:41:01 +08:00
Roger cbd4594958 chore(deps): bump dependencies compatible with Go 1.20 (#509)
- github.com/stretchr/testify 1.9.0 → 1.11.1
- github.com/godbus/dbus/v5 5.1.0 → 5.2.2
- github.com/urfave/cli/v2 2.27.4 → 2.27.7
- github.com/otiai10/copy 1.14.0 → 1.14.1
- modernc.org/sqlite stays at 1.31.1 (v1.32+ requires Go 1.21)
2026-03-23 00:39:44 +08:00
ᴍᴏᴏɴD4ʀᴋ ad020cf135 chore: downgrade golang version to 1.20, support Windows 7. (#435)
* chore: downgrade golang version to 1.20, support windows 7

* chore: Update dependencies for Go project.

- Update dependencies in go.sum
- Improvements and optimizations in various files
- Bug fixes and error handling enhancements

* chore: Update modernc.org/sqlite library versions in go.mod and go.sum files

- Update version of `modernc.org/sqlite` to `v1.31.1` in `go.mod` and `go.sum` files
- Update module hash in `go.sum` file for `modernc.org/sqlite`
- Ensure consistency between `go.mod` and `go.sum` files in relation to `modernc.org/sqlite` version

* chore: replace log/slog with standard logger (#436)

* chore: replace log/slog with standard logger

* chore: Update Go dependencies and versions

- Update Go version from `1.22.5` to `1.20` and other dependencies
- Update critical dependencies to latest versions
- Ensure compatibility with new versions of dependencies

* chore: Optimize dependency management in workflows

- Update build and lint workflows to use `go mod tidy` for getting dependencies
- Change modules download mode to `'mod'` in linters configuration
- Add step to get dependencies in lint workflow

* refactor: Update dependencies and refactor Chromium key deletion logic

- Update `modernc.org/sqlite` to `v1.31.1` in `go.mod` and `go.sum`
- Increase version number to `0.5.0` in `cmd/hack-browser-data/main.go`
- Refactor and update logic for filtering and copying items in `browser/chromium/chromium.go`

* Improve logging functionality and data type conversion

- Add `String()` method to `DataType` enum in types.go
- Update log level to Debug in logger_test.go
- Set log level to Debug in `TestLoggerDebug` and `TestLoggerDebugf` functions
2024-10-22 13:01:13 +08:00
moonD4rk 31591411e4 chore: Update third-party library versions 2024-10-22 13:01:13 +08:00
ᴍᴏᴏɴD4ʀᴋ f3d9540016 chore: Update dependencies to latest versions (#426)
* chore: Update dependencies to latest versions

- Update dependencies versions in `go.mod` file
- Address security vulnerabilities by updating third-party libraries
- Improve performance and stability with updated dependencies

* ci: Implement stronger crypto algorithms enforcement.

- Exclude weak crypto algorithms using `G405` in the `.golangci.yml` file.
2024-09-30 19:18:40 +08:00
ᴍᴏᴏɴD4ʀᴋ 6a495a1449 chore(deps): bump golang dependencies (#380)
* chore(deps): bump github.com/tidwall/gjson from 1.17.1 to 1.17.3

Bumps [github.com/tidwall/gjson](https://github.com/tidwall/gjson) from 1.17.1 to 1.17.3.
- [Commits](https://github.com/tidwall/gjson/compare/v1.17.1...v1.17.3)

---
updated-dependencies:
- dependency-name: github.com/tidwall/gjson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump modernc.org/sqlite from 1.30.1 to 1.31.1

Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.30.1 to 1.31.1.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.30.1...v1.31.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-11 08:26:22 +08:00
dependabot[bot] 654dec8876 chore(deps): bump modernc.org/sqlite from 1.29.6 to 1.30.1
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.29.6 to 1.30.1.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.29.6...v1.30.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 22:47:11 +08:00
ᴍᴏᴏɴD4ʀᴋ 06fc064418 refactor/dependence: Upgrade Golang version and dependencies. (#322)
* chore: Set up automated package updates with dependabot.
2024-04-12 20:01:29 +08:00
ᴍᴏᴏɴD4ʀᴋ c150b22c1b feat: refactor firefox get master key retrieval and decryption functions. (#300)
* refactor: Simplify Firefox master key retrieval and decryption functions.

- Simplify variable names and functions in browsingdata/password/password.go
- Modify Decrypt function for each PBE type to have only one parameter named globalSalt in crypto/crypto.go
- Implement functions to retrieve master key from Firefox's key4.db file and query metadata and private NSS data in browser/firefox/firefox.go

* chore: Add dependencies and tests to Firefox package.

- Add go-sqlmock and github.com/kisielk/sqlstruct dependencies
- Add tests for Firefox package metadata and nssPrivate query
- Add test for Firefox's processMasterKey function (currently commented out)

* refactor: Refactor Firefox test functions, remove unused code

- Remove unused test function in firefox_test.go file
- Clean up code by removing unnecessary changes
- Simplify file structure for easier maintenance and readability
2024-01-27 23:15:05 +08:00
ᴍᴏᴏɴD4ʀᴋ baa0e09ad2 dev: Remove CGO go-sqlite3 with pure go driver (#292)
* chore: Resize logo and update browser support in READMEs (#284)

* chore: Resize logo and update browser support in READMEs

* docs: Update Coverage Status badge URL

* chore: add typos check linter in github actions (#285)

* refactor: Disable JSON handling in logger/logger.go.

* chore: Standardize spelling and add typos check workflows.

* refactor: Update SQLite driver import for browsing data package.

* refactor: Refactor browsing data package to use SQLite driver instead of SQLite3.

* docs: Add contribution guidelines to README file (#289)

* chore: Refactor file and directory names for improved organization and consistency
2024-01-19 15:45:24 +08:00
ᴍᴏᴏɴD4ʀᴋ e48f35cfd3 feat: refactor logger to standard library (#280)
* refactor: Refactor logging to use structured slog package.

- Remove `gookit` dependencies from `go.sum`
- Improve error logging in multiple packages by replacing `log` with `log/slog`
- Update dependencies in `go.mod`
- Add new `logger` package with test cases
- Refactor logging statements in multiple packages to use `slog` instead of `log`
- Change logging format and level in multiple packages for better structured logging

* refactor: Refactor logger package and add handler interface

- Refactor logger package
- Rename `defaultHandler` to `DefaultLogger`
- Move `ReplaceAttr` function to `Logger` struct
- Implement `LogHandler` struct with `slog.Handler` interface
- Add new `Logger` methods for configuration
- Add `SetMaxLevel`, `SetJSONHandler`, `SetTextHandler`, `SetOutput`, `SetVerbose`, `SetReplaceAttrFunc`
- Add verbose flag to `cmd/hack-browser-data/main.go` to increase logging

* refactor: Refactor logger package to use simplified handler initialization.

- Refactor logger package to use Default instead of DefaultLogger
- Update `NewHandler` method to correctly reference `Default` logger and simplify handler initialization
- Update tests for logger to reflect changes in Default usage
- Rename `DefaultLogger` to `Default` and update comments to better reflect its purpose
- Update function calls in hack-browser-data main.go to reflect logger package updates

* refactor: Refactor logging in Chromium implementation

Refactor logging and simplify decryption in chromium files
- Replace logger package import with shared slog package
- Change logging messages to use slog instead of logger
- Simplify decryption process by removing first 5 characters of encrypted key
- Refactor error logging in linux file to use shared slog package
- Replace string concatenation with formatted string in linux error message
2024-01-16 14:06:13 +08:00
moonD4rk baac121610 chore: Refactor and update dependencies in go.mod file
- Refactor and optimize parsing function in browsingdata extension
- Update dependency versions and indirect versions in go.mod
2024-01-09 18:10:14 +08:00
moonD4rk 83fc248195 chore: update Go version and dependencies for builds
- Update Go version from `1.20` to `1.21` in go.mod, .github/workflows/build.yml, and .github/workflows/lint.yml
2023-10-02 22:37:42 +08:00
moonD4rk 4fb2acd85c feat: test case for convert utf16 value to utf8 2023-05-08 19:22:55 +08:00
moonD4rk fbe61a2cf4 chore: upgrade package dependencies 2023-03-11 19:18:11 +08:00
moonD4rk 7e6c18caea chore: upgrade package dependencies 2023-03-09 17:55:39 +08:00
moonD4rk b7cabaa7b9 chore: upgrade go mod, remove json iterator dep 2022-10-30 13:37:49 +08:00
ᴍᴏᴏɴD4ʀᴋ d1ae09d9e4 fix: add utf8 encoder for outputter 2022-06-05 15:15:41 +08:00
ᴍᴏᴏɴD4ʀᴋ 4fe266d954 feat: support export chromium local storage 2022-04-19 22:33:12 +08:00
ᴍᴏᴏɴD4ʀᴋ 121e49bdff feat: add local storage for firefox 2022-04-19 21:28:43 +08:00
ᴍᴏᴏɴD4ʀᴋ 806c5bf2ee refactor: replace util with go generics 2022-04-17 16:35:40 +08:00
ᴍᴏᴏɴD4ʀᴋ a0eeee8604 feat: replace log with stdout color 2022-04-16 03:57:19 +08:00
ᴍᴏᴏɴD4ʀᴋ 8f7e602e9f feat: support profile path cmd options 2022-04-14 23:36:11 +08:00
ᴍᴏᴏɴD4ʀᴋ a499c3ca0f feat: add chromium for windows 2022-04-13 15:49:15 +08:00
ᴍᴏᴏɴD4ʀᴋ b8da73e543 feat: update dep 2022-04-12 18:23:39 +08:00
ᴍᴏᴏɴD4ʀᴋ b064326103 chore: update go mod and git ignore 2022-04-12 13:48:28 +08:00
ᴍᴏᴏɴD4ʀᴋ a6efcff6ea feat: rename browser layout and add generics util function 2022-04-08 19:08:22 +08:00
ᴍᴏᴏɴD4ʀᴋ 4f7adf3db7 feat: rename item name 2022-04-02 14:47:12 +08:00
ᴍᴏᴏɴD4ʀᴋ 9129c2a0c7 dev-feat: add chromium browser for macos 2021-12-31 16:50:50 +08:00
ᴍᴏᴏɴD4ʀᴋ 3e6ecfb9da fix: upgrade go-sqlite3 verion, remove compile warning. Close #103 2021-12-13 21:58:25 +08:00
dependabot[bot] 176400adeb chore(deps): bump github.com/tidwall/gjson from 1.6.0 to 1.9.3
Bumps [github.com/tidwall/gjson](https://github.com/tidwall/gjson) from 1.6.0 to 1.9.3.
- [Release notes](https://github.com/tidwall/gjson/releases)
- [Commits](https://github.com/tidwall/gjson/compare/v1.6.0...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/tidwall/gjson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-25 02:25:07 +00:00
ᴍᴏᴏɴD4ʀᴋ b806827f6c feat: decrypt chrome for linux password with dbus Close #4 2020-07-25 22:17:50 +08:00
ᴍᴏᴏɴD4ʀᴋ aab3aafad7 refactor: remove zap log package Close #19 2020-07-24 17:39:44 +08:00
ᴍᴏᴏɴD4ʀᴋ 107e9aaca0 feat: csv separator replace to comma 2020-06-30 14:13:53 +08:00
ᴍᴏᴏɴD4ʀᴋ 55bfd89fa9 feat: add csv and json output 2020-06-23 18:30:00 +08:00
ᴍᴏᴏɴD4ʀᴋ 7e472c5cee feat: add history parse 2020-06-22 17:23:18 +08:00
ᴍᴏᴏɴD4ʀᴋ 000c4fe583 refactor: remove go-openssl package 2020-06-20 23:22:05 +08:00
ᴍᴏᴏɴD4ʀᴋ 891e3fac81 feat: add chrome password decrypt 2020-06-19 20:43:31 +08:00