From f8b1de4666007a31a4eb621b6dd071338e5e62ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=8D=E1=B4=8F=E1=B4=8F=C9=B4D4=CA=80=E1=B4=8B?= Date: Sat, 26 Mar 2022 14:03:40 +0800 Subject: [PATCH] refactor: format project layout --- cmd/cmd.go | 12 +- core/browser.go | 2 +- core/browser_linux.go | 2 +- core/browser_windows.go | 2 +- core/data/output.go | 4 +- core/data/parse.go | 4 +- {pkg => internal}/browser/browser.go | 66 +++++++--- {pkg => internal}/browser/browser_darwin.go | 114 +++++++++++++++--- {pkg => internal}/browser/browser_linux.go | 0 {pkg => internal}/browser/browser_test.go | 14 ++- {pkg => internal}/browser/browser_windows.go | 6 +- {pkg => internal}/browser/consts/filename.go | 0 {pkg => internal}/browser/consts/sql.go | 0 {pkg => internal}/browser/data/bookmark.go | 4 +- .../browser/data/browsingdata.go | 0 {pkg => internal}/browser/data/cookie.go | 6 +- {pkg => internal}/browser/data/creditcard.go | 6 +- {pkg => internal}/browser/data/download.go | 4 +- {pkg => internal}/browser/data/history.go | 4 +- {pkg => internal}/browser/data/password.go | 22 ++-- {pkg => internal}/browser/item.go | 32 ++--- .../browser/outputter/outputter.go | 2 +- .../decrypter/decrypter.go | 0 .../decrypter/decrypter_darwin.go | 0 .../decrypter/decrypter_linux.go | 0 .../decrypter/decrypter_windows.go | 0 {pkg => internal}/log/log.go | 0 {utils => internal/utils}/utils.go | 2 +- 28 files changed, 214 insertions(+), 94 deletions(-) rename {pkg => internal}/browser/browser.go (80%) rename {pkg => internal}/browser/browser_darwin.go (60%) rename {pkg => internal}/browser/browser_linux.go (100%) rename {pkg => internal}/browser/browser_test.go (85%) rename {pkg => internal}/browser/browser_windows.go (95%) rename {pkg => internal}/browser/consts/filename.go (100%) rename {pkg => internal}/browser/consts/sql.go (100%) rename {pkg => internal}/browser/data/bookmark.go (96%) rename {pkg => internal}/browser/data/browsingdata.go (100%) rename {pkg => internal}/browser/data/cookie.go (95%) rename {pkg => internal}/browser/data/creditcard.go (93%) rename {pkg => internal}/browser/data/download.go (96%) rename {pkg => internal}/browser/data/history.go (96%) rename {pkg => internal}/browser/data/password.go (87%) rename {pkg => internal}/browser/item.go (84%) rename {pkg => internal}/browser/outputter/outputter.go (97%) rename pkg/decrypter/decrypt.go => internal/decrypter/decrypter.go (100%) rename pkg/decrypter/decrypt_darwin.go => internal/decrypter/decrypter_darwin.go (100%) rename pkg/decrypter/decrypt_linux.go => internal/decrypter/decrypter_linux.go (100%) rename pkg/decrypter/decrypt_windows.go => internal/decrypter/decrypter_windows.go (100%) rename {pkg => internal}/log/log.go (100%) rename {utils => internal/utils}/utils.go (98%) diff --git a/cmd/cmd.go b/cmd/cmd.go index 6b06e4a..0630b02 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -5,11 +5,11 @@ import ( "os" "strings" - "hack-browser-data/pkg/browser" - "hack-browser-data/pkg/browser/outputter" - "hack-browser-data/pkg/log" - "github.com/urfave/cli/v2" + + "hack-browser-data/internal/browser" + "hack-browser-data/internal/browser/outputter" + "hack-browser-data/internal/log" ) var ( @@ -26,7 +26,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.7", + Version: "0.3.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"}, @@ -46,7 +46,7 @@ func Execute() { } else { log.InitLog("error") } - browsers = browser.PickBrowsers(browserName) + browsers = browser.PickBrowser(browserName) output := outputter.NewOutPutter(outputFormat) if err := output.MakeDir(exportDir); err != nil { diff --git a/core/browser.go b/core/browser.go index 4ab36ab..51c46d8 100644 --- a/core/browser.go +++ b/core/browser.go @@ -8,7 +8,7 @@ import ( "strings" "hack-browser-data/core/data" - "hack-browser-data/pkg/log" + "hack-browser-data/internal/log" ) const ( diff --git a/core/browser_linux.go b/core/browser_linux.go index 6d2a264..7af68ac 100644 --- a/core/browser_linux.go +++ b/core/browser_linux.go @@ -7,7 +7,7 @@ import ( keyring "github.com/ppacher/go-dbus-keyring" "golang.org/x/crypto/pbkdf2" - "hack-browser-data/pkg/log" + "hack-browser-data/internal/log" ) const ( diff --git a/core/browser_windows.go b/core/browser_windows.go index faa8d81..3a6381f 100644 --- a/core/browser_windows.go +++ b/core/browser_windows.go @@ -7,7 +7,7 @@ import ( "os" "hack-browser-data/core/decrypt" - "hack-browser-data/utils" + "hack-browser-data/internal/utils" "github.com/tidwall/gjson" ) diff --git a/core/data/output.go b/core/data/output.go index 10cd42b..5565c4b 100644 --- a/core/data/output.go +++ b/core/data/output.go @@ -7,9 +7,9 @@ import ( "os" "sort" - "hack-browser-data/utils" - "github.com/jszwec/csvutil" + + "hack-browser-data/internal/utils" ) var ( diff --git a/core/data/parse.go b/core/data/parse.go index de51608..632d19f 100644 --- a/core/data/parse.go +++ b/core/data/parse.go @@ -12,8 +12,8 @@ import ( "time" "hack-browser-data/core/decrypt" - "hack-browser-data/pkg/log" - "hack-browser-data/utils" + "hack-browser-data/internal/log" + "hack-browser-data/internal/utils" _ "github.com/mattn/go-sqlite3" "github.com/tidwall/gjson" diff --git a/pkg/browser/browser.go b/internal/browser/browser.go similarity index 80% rename from pkg/browser/browser.go rename to internal/browser/browser.go index b34a777..0b2961d 100644 --- a/pkg/browser/browser.go +++ b/internal/browser/browser.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - "hack-browser-data/pkg/browser/data" + "hack-browser-data/internal/browser/data" ) type Browser interface { @@ -27,16 +27,16 @@ var ( homeDir, _ = os.UserHomeDir() ) -func PickBrowsers(name string) []Browser { +func PickBrowser(name string) []Browser { var browsers []Browser - chromiumList := pickChromium(name) - for _, b := range chromiumList { + clist := pickChromium(name) + for _, b := range clist { if b != nil { browsers = append(browsers, b) } } - firefoxList := pickFirefox(name) - for _, b := range firefoxList { + flist := pickFirefox(name) + for _, b := range flist { if b != nil { browsers = append(browsers, b) } @@ -49,11 +49,14 @@ func pickChromium(name string) []Browser { name = strings.ToLower(name) if name == "all" { for _, choice := range chromiumList { - b, err := newChromium(choice.browserInfo, choice.items) - if err != nil { + if b, err := newChromium(choice.browserInfo, choice.items); err == nil { + browsers = append(browsers, b) + } else { + if strings.Contains(err.Error(), "profile path is not exist") { + continue + } panic(err) } - browsers = append(browsers, b) } return browsers } @@ -72,8 +75,8 @@ func pickFirefox(name string) []Browser { var browsers []Browser name = strings.ToLower(name) if name == "all" || name == "firefox" { - for _, v := range firefoxList { - multiFirefox, err := newMultiFirefox(v.browserInfo, v.items) + for _, b := range firefoxList { + multiFirefox, err := newMultiFirefox(b.browserInfo, b.items) if err != nil { panic(err) } @@ -163,6 +166,10 @@ func newMultiFirefox(info *browserInfo, items []item) ([]*firefox, error) { } multiItemPaths, err := getFirefoxItemAbsPath(f.browserInfo.profilePath, f.items) if err != nil { + if strings.Contains(err.Error(), "profile path is not exist") { + fmt.Println(err) + return nil, nil + } panic(err) } var firefoxList []*firefox @@ -182,6 +189,10 @@ func newMultiFirefox(info *browserInfo, items []item) ([]*firefox, error) { func getFirefoxItemAbsPath(profilePath string, items []item) (map[string]map[item]string, error) { var multiItemPaths = make(map[string]map[item]string) absProfilePath := path.Join(homeDir, filepath.Clean(profilePath)) + // TODO: Handle read file error + if !isFileExist(absProfilePath) { + return nil, fmt.Errorf("%s profile path is not exist", absProfilePath) + } err := filepath.Walk(absProfilePath, firefoxWalkFunc(items, multiItemPaths)) return multiItemPaths, err } @@ -250,6 +261,10 @@ func chromiumWalkFunc(items []item, itemPaths map[item]string) filepath.WalkFunc func getChromiumItemAbsPath(profilePath string, items []item) (map[item]string, error) { var itemPaths = make(map[item]string) absProfilePath := path.Join(homeDir, filepath.Clean(profilePath)) + // TODO: Handle file path is not exist + if !isFileExist(absProfilePath) { + return nil, fmt.Errorf("%s profile path is not exist", absProfilePath) + } err := filepath.Walk(absProfilePath, chromiumWalkFunc(items, itemPaths)) return itemPaths, err } @@ -272,6 +287,7 @@ func (f *firefox) GetBrowsingData() []data.BrowsingData { } return browsingData } + func ListBrowser() []string { var l []string for c := range chromiumList { @@ -283,6 +299,13 @@ func ListBrowser() []string { return l } +func isFileExist(path string) bool { + if _, err := os.Stat(path); os.IsNotExist(err) { + return false + } + return true +} + type browserInfo struct { name string storage string @@ -291,10 +314,23 @@ type browserInfo struct { } const ( - chromeName = "Chrome" - edgeName = "Edge" - firefoxName = "Firefox" - yandexName = "Yandex" + 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" + coccocName = "CocCoc" + yandexName = "Yandex" ) var defaultFirefoxItems = []item{ diff --git a/pkg/browser/browser_darwin.go b/internal/browser/browser_darwin.go similarity index 60% rename from pkg/browser/browser_darwin.go rename to internal/browser/browser_darwin.go index 2a167d8..9c3ae12 100644 --- a/pkg/browser/browser_darwin.go +++ b/internal/browser/browser_darwin.go @@ -13,7 +13,6 @@ var ( chromiumList = map[string]struct { browserInfo *browserInfo items []item - // New func(browser *browserInfo, items []item) *firefox }{ "chrome": { browserInfo: chromeInfo, @@ -23,6 +22,38 @@ var ( browserInfo: edgeInfo, items: defaultChromiumItems, }, + "chromium": { + browserInfo: chromiumInfo, + items: defaultChromiumItems, + }, + "chrome-beta": { + browserInfo: chromeBetaInfo, + items: defaultChromiumItems, + }, + "opera": { + browserInfo: operaInfo, + items: defaultChromiumItems, + }, + "opera-gx": { + browserInfo: operaGXInfo, + items: defaultChromiumItems, + }, + "vivaldi": { + browserInfo: vivaldiInfo, + items: defaultChromiumItems, + }, + "coccoc": { + browserInfo: coccocInfo, + items: defaultChromiumItems, + }, + "brave": { + browserInfo: braveInfo, + items: defaultChromiumItems, + }, + "yandex": { + browserInfo: yandexInfo, + items: defaultYandexItems, + }, } firefoxList = map[string]struct { browserInfo *browserInfo @@ -63,26 +94,12 @@ func (c *chromium) GetMasterKey() ([]byte, error) { var chromeSalt = []byte("saltysalt") // @https://source.chromium.org/chromium/chromium/src/+/master:components/os_crypt/os_crypt_mac.mm;l=157 key := pbkdf2.Key(chromeSecret, chromeSalt, 1003, 16, sha1.New) - c.browserInfo.masterKey = key - return key, nil -} - -var ( - chromeInfo = &browserInfo{ - name: chromeName, - storage: chromeStorageName, - profilePath: chromeProfilePath, - } - edgeInfo = &browserInfo{ - name: edgeName, - storage: edgeStorageName, - profilePath: edgeProfilePath, - } - firefoxInfo = &browserInfo{ - name: firefoxName, - profilePath: firefoxProfilePath, + if key != nil { + c.browserInfo.masterKey = key + return key, nil } -) + return nil, errors.New("macOS wrong security command") +} const ( chromeProfilePath = "/Library/Application Support/Google/Chrome/" @@ -110,3 +127,60 @@ const ( coccocStorageName = "CocCoc" yandexStorageName = "Yandex" ) + +var ( + chromeInfo = &browserInfo{ + name: chromeName, + storage: chromeStorageName, + profilePath: chromeProfilePath, + } + chromiumInfo = &browserInfo{ + name: chromiumName, + storage: chromiumStorageName, + profilePath: chromiumProfilePath, + } + chromeBetaInfo = &browserInfo{ + name: chromeBetaName, + storage: chromeBetaStorageName, + profilePath: chromeBetaProfilePath, + } + operaInfo = &browserInfo{ + name: operaName, + profilePath: operaProfilePath, + storage: operaStorageName, + } + operaGXInfo = &browserInfo{ + name: operaGXName, + profilePath: operaGXProfilePath, + storage: operaStorageName, + } + edgeInfo = &browserInfo{ + name: edgeName, + storage: edgeStorageName, + profilePath: edgeProfilePath, + } + braveInfo = &browserInfo{ + name: braveName, + profilePath: braveProfilePath, + storage: braveStorageName, + } + vivaldiInfo = &browserInfo{ + name: vivaldiName, + storage: vivaldiStorageName, + profilePath: vivaldiProfilePath, + } + coccocInfo = &browserInfo{ + name: coccocName, + storage: coccocStorageName, + profilePath: coccocProfilePath, + } + yandexInfo = &browserInfo{ + name: yandexName, + storage: yandexStorageName, + profilePath: yandexProfilePath, + } + firefoxInfo = &browserInfo{ + name: firefoxName, + profilePath: firefoxProfilePath, + } +) diff --git a/pkg/browser/browser_linux.go b/internal/browser/browser_linux.go similarity index 100% rename from pkg/browser/browser_linux.go rename to internal/browser/browser_linux.go diff --git a/pkg/browser/browser_test.go b/internal/browser/browser_test.go similarity index 85% rename from pkg/browser/browser_test.go rename to internal/browser/browser_test.go index f19eb61..47ebf56 100644 --- a/pkg/browser/browser_test.go +++ b/internal/browser/browser_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "hack-browser-data/pkg/browser/outputter" - "hack-browser-data/pkg/log" + "hack-browser-data/internal/browser/outputter" + "hack-browser-data/internal/log" ) func TestPickChromium(t *testing.T) { @@ -44,6 +44,16 @@ func TestPickChromium(t *testing.T) { } } +func TestPickBrowsers(t *testing.T) { + browsers := PickBrowser("all") + for _, v := range browsers { + fmt.Println(v.GetName()) + } + // filetype := "json" + // dir := "result" + // output := outputter.NewOutPutter(filetype) +} + func TestPickFirefox(t *testing.T) { browsers := pickFirefox("all") filetype := "json" diff --git a/pkg/browser/browser_windows.go b/internal/browser/browser_windows.go similarity index 95% rename from pkg/browser/browser_windows.go rename to internal/browser/browser_windows.go index e092d48..ab78bda 100644 --- a/pkg/browser/browser_windows.go +++ b/internal/browser/browser_windows.go @@ -6,9 +6,9 @@ import ( "github.com/tidwall/gjson" - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/pkg/decrypter" - "hack-browser-data/utils" + "hack-browser-data/internal/browser/consts" + "hack-browser-data/internal/decrypter" + "hack-browser-data/internal/utils" ) var ( diff --git a/pkg/browser/consts/filename.go b/internal/browser/consts/filename.go similarity index 100% rename from pkg/browser/consts/filename.go rename to internal/browser/consts/filename.go diff --git a/pkg/browser/consts/sql.go b/internal/browser/consts/sql.go similarity index 100% rename from pkg/browser/consts/sql.go rename to internal/browser/consts/sql.go diff --git a/pkg/browser/data/bookmark.go b/internal/browser/data/bookmark.go similarity index 96% rename from pkg/browser/data/bookmark.go rename to internal/browser/data/bookmark.go index 9c66dda..1da37fe 100644 --- a/pkg/browser/data/bookmark.go +++ b/internal/browser/data/bookmark.go @@ -7,8 +7,8 @@ import ( "github.com/tidwall/gjson" - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/utils" + "hack-browser-data/internal/browser/consts" + "hack-browser-data/internal/utils" ) type ChromiumBookmark []bookmark diff --git a/pkg/browser/data/browsingdata.go b/internal/browser/data/browsingdata.go similarity index 100% rename from pkg/browser/data/browsingdata.go rename to internal/browser/data/browsingdata.go diff --git a/pkg/browser/data/cookie.go b/internal/browser/data/cookie.go similarity index 95% rename from pkg/browser/data/cookie.go rename to internal/browser/data/cookie.go index 4e528db..3a9183a 100644 --- a/pkg/browser/data/cookie.go +++ b/internal/browser/data/cookie.go @@ -5,9 +5,9 @@ import ( "fmt" "sort" - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/pkg/decrypter" - "hack-browser-data/utils" + "hack-browser-data/internal/browser/consts" + "hack-browser-data/internal/decrypter" + "hack-browser-data/internal/utils" _ "github.com/mattn/go-sqlite3" ) diff --git a/pkg/browser/data/creditcard.go b/internal/browser/data/creditcard.go similarity index 93% rename from pkg/browser/data/creditcard.go rename to internal/browser/data/creditcard.go index da078d4..a279db1 100644 --- a/pkg/browser/data/creditcard.go +++ b/internal/browser/data/creditcard.go @@ -4,10 +4,10 @@ import ( "database/sql" "fmt" - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/pkg/decrypter" - _ "github.com/mattn/go-sqlite3" + + "hack-browser-data/internal/browser/consts" + "hack-browser-data/internal/decrypter" ) type ChromiumCreditCard []card diff --git a/pkg/browser/data/download.go b/internal/browser/data/download.go similarity index 96% rename from pkg/browser/data/download.go rename to internal/browser/data/download.go index c4546d7..6b1e11a 100644 --- a/pkg/browser/data/download.go +++ b/internal/browser/data/download.go @@ -8,8 +8,8 @@ import ( "github.com/tidwall/gjson" - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/utils" + "hack-browser-data/internal/browser/consts" + "hack-browser-data/internal/utils" _ "github.com/mattn/go-sqlite3" ) diff --git a/pkg/browser/data/history.go b/internal/browser/data/history.go similarity index 96% rename from pkg/browser/data/history.go rename to internal/browser/data/history.go index 5450f79..dbd1451 100644 --- a/pkg/browser/data/history.go +++ b/internal/browser/data/history.go @@ -5,8 +5,8 @@ import ( "fmt" "sort" - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/utils" + "hack-browser-data/internal/browser/consts" + "hack-browser-data/internal/utils" _ "github.com/mattn/go-sqlite3" ) diff --git a/pkg/browser/data/password.go b/internal/browser/data/password.go similarity index 87% rename from pkg/browser/data/password.go rename to internal/browser/data/password.go index 351b4ea..fef3aab 100644 --- a/pkg/browser/data/password.go +++ b/internal/browser/data/password.go @@ -9,9 +9,9 @@ import ( "sort" "time" - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/pkg/decrypter" - "hack-browser-data/utils" + "hack-browser-data/internal/browser/consts" + decrypter2 "hack-browser-data/internal/decrypter" + "hack-browser-data/internal/utils" _ "github.com/mattn/go-sqlite3" "github.com/tidwall/gjson" @@ -47,12 +47,12 @@ func (c *ChromiumPassword) Parse(masterKey []byte) error { } if len(pwd) > 0 { if masterKey == nil { - password, err = decrypter.DPApi(pwd) + password, err = decrypter2.DPApi(pwd) if err != nil { fmt.Println(err) } } else { - password, err = decrypter.ChromePass(masterKey, pwd) + password, err = decrypter2.ChromePass(masterKey, pwd) if err != nil { fmt.Println(err) } @@ -84,7 +84,7 @@ func (f *FirefoxPassword) Parse(masterKey []byte) error { if err != nil { return err } - metaPBE, err := decrypter.NewASN1PBE(metaBytes) + metaPBE, err := decrypter2.NewASN1PBE(metaBytes) if err != nil { return err } @@ -97,7 +97,7 @@ func (f *FirefoxPassword) Parse(masterKey []byte) error { if bytes.Contains(k, []byte("password-check")) { m := bytes.Compare(nssA102, keyLin) if m == 0 { - nssPBE, err := decrypter.NewASN1PBE(nssA11) + nssPBE, err := decrypter2.NewASN1PBE(nssA11) if err != nil { return err } @@ -111,11 +111,11 @@ func (f *FirefoxPassword) Parse(masterKey []byte) error { return err } for _, v := range allLogin { - userPBE, err := decrypter.NewASN1PBE(v.encryptUser) + userPBE, err := decrypter2.NewASN1PBE(v.encryptUser) if err != nil { return err } - pwdPBE, err := decrypter.NewASN1PBE(v.encryptPass) + pwdPBE, err := decrypter2.NewASN1PBE(v.encryptPass) if err != nil { return err } @@ -129,8 +129,8 @@ func (f *FirefoxPassword) Parse(masterKey []byte) error { } *f = append(*f, loginData{ LoginUrl: v.LoginUrl, - UserName: string(decrypter.PKCS5UnPadding(user)), - Password: string(decrypter.PKCS5UnPadding(pwd)), + UserName: string(decrypter2.PKCS5UnPadding(user)), + Password: string(decrypter2.PKCS5UnPadding(pwd)), CreateDate: v.CreateDate, }) } diff --git a/pkg/browser/item.go b/internal/browser/item.go similarity index 84% rename from pkg/browser/item.go rename to internal/browser/item.go index 3f7968f..8030a1f 100644 --- a/pkg/browser/item.go +++ b/internal/browser/item.go @@ -1,8 +1,8 @@ package browser import ( - "hack-browser-data/pkg/browser/consts" - "hack-browser-data/pkg/browser/data" + "hack-browser-data/internal/browser/consts" + data2 "hack-browser-data/internal/browser/data" ) type item int @@ -126,40 +126,40 @@ func (i item) FileName() string { } } -func (i item) NewBrowsingData() data.BrowsingData { +func (i item) NewBrowsingData() data2.BrowsingData { switch i { case chromiumKey: return nil case chromiumPassword: - return &data.ChromiumPassword{} + return &data2.ChromiumPassword{} case chromiumCookie: - return &data.ChromiumCookie{} + return &data2.ChromiumCookie{} case chromiumBookmark: - return &data.ChromiumBookmark{} + return &data2.ChromiumBookmark{} case chromiumDownload: - return &data.ChromiumDownload{} + return &data2.ChromiumDownload{} case chromiumLocalStorage: return nil case chromiumCreditCard: - return &data.ChromiumCreditCard{} + return &data2.ChromiumCreditCard{} case chromiumExtension: return nil case chromiumHistory: - return &data.ChromiumHistory{} + return &data2.ChromiumHistory{} case yandexPassword: - return &data.ChromiumPassword{} + return &data2.ChromiumPassword{} case yandexCreditCard: - return &data.ChromiumCreditCard{} + return &data2.ChromiumCreditCard{} case firefoxPassword: - return &data.FirefoxPassword{} + return &data2.FirefoxPassword{} case firefoxCookie: - return &data.FirefoxCookie{} + return &data2.FirefoxCookie{} case firefoxBookmark: - return &data.FirefoxBookmark{} + return &data2.FirefoxBookmark{} case firefoxDownload: - return &data.FirefoxDownload{} + return &data2.FirefoxDownload{} case firefoxHistory: - return &data.FirefoxHistory{} + return &data2.FirefoxHistory{} default: return nil } diff --git a/pkg/browser/outputter/outputter.go b/internal/browser/outputter/outputter.go similarity index 97% rename from pkg/browser/outputter/outputter.go rename to internal/browser/outputter/outputter.go index e330254..355cf08 100644 --- a/pkg/browser/outputter/outputter.go +++ b/internal/browser/outputter/outputter.go @@ -10,7 +10,7 @@ import ( "github.com/gocarina/gocsv" jsoniter "github.com/json-iterator/go" - "hack-browser-data/pkg/browser/data" + "hack-browser-data/internal/browser/data" ) type outPutter struct { diff --git a/pkg/decrypter/decrypt.go b/internal/decrypter/decrypter.go similarity index 100% rename from pkg/decrypter/decrypt.go rename to internal/decrypter/decrypter.go diff --git a/pkg/decrypter/decrypt_darwin.go b/internal/decrypter/decrypter_darwin.go similarity index 100% rename from pkg/decrypter/decrypt_darwin.go rename to internal/decrypter/decrypter_darwin.go diff --git a/pkg/decrypter/decrypt_linux.go b/internal/decrypter/decrypter_linux.go similarity index 100% rename from pkg/decrypter/decrypt_linux.go rename to internal/decrypter/decrypter_linux.go diff --git a/pkg/decrypter/decrypt_windows.go b/internal/decrypter/decrypter_windows.go similarity index 100% rename from pkg/decrypter/decrypt_windows.go rename to internal/decrypter/decrypter_windows.go diff --git a/pkg/log/log.go b/internal/log/log.go similarity index 100% rename from pkg/log/log.go rename to internal/log/log.go diff --git a/utils/utils.go b/internal/utils/utils.go similarity index 98% rename from utils/utils.go rename to internal/utils/utils.go index e67d9c8..9b2e98c 100644 --- a/utils/utils.go +++ b/internal/utils/utils.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "hack-browser-data/pkg/log" + "hack-browser-data/internal/log" ) const Prefix = "[x]: "