feat: add log

pull/125/head
ᴍᴏᴏɴD4ʀᴋ 3 years ago
parent e0a3fd3ca2
commit 83102c042e
  1. 4
      internal/browingdata/bookmark.go
  2. 3
      internal/browingdata/browsingdata.go
  3. 14
      internal/browingdata/cookie.go
  4. 4
      internal/browingdata/creditcard.go
  5. 3
      internal/browingdata/download.go
  6. 6
      internal/browingdata/history.go
  7. 12
      internal/browingdata/password.go

@ -2,7 +2,6 @@ package browingdata
import (
"database/sql"
"fmt"
"os"
"sort"
"time"
@ -10,6 +9,7 @@ import (
"github.com/tidwall/gjson"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
"hack-browser-data/internal/utils"
"hack-browser-data/internal/utils/fileutil"
@ -107,7 +107,7 @@ func (f *FirefoxBookmark) Parse(masterKey []byte) error {
title, url string
)
if err = bookmarkRows.Scan(&id, &url, &bType, &dateAdded, &title); err != nil {
fmt.Println(err)
log.Warn(err)
}
*f = append(*f, bookmark{
ID: id,

@ -4,6 +4,7 @@ import (
"time"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
)
type Data struct {
@ -28,7 +29,7 @@ func (d *Data) Recovery(masterKey []byte) error {
for _, source := range d.Sources {
if err := source.Parse(masterKey); err != nil {
panic(err)
log.Error(err)
}
}
return nil

@ -2,7 +2,6 @@ package browingdata
import (
"database/sql"
"fmt"
"os"
"sort"
@ -10,6 +9,7 @@ import (
"hack-browser-data/internal/decrypter"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
"hack-browser-data/internal/utils"
)
@ -35,7 +35,7 @@ func (c *ChromiumCookie) Parse(masterKey []byte) error {
value, encryptValue []byte
)
if err = rows.Scan(&key, &encryptValue, &host, &path, &createDate, &expireDate, &isSecure, &isHTTPOnly, &hasExpire, &isPersistent); err != nil {
fmt.Println(err)
log.Warn(err)
}
cookie := cookie{
@ -52,17 +52,13 @@ func (c *ChromiumCookie) Parse(masterKey []byte) error {
}
// TODO: replace DPAPI
if len(encryptValue) > 0 {
var err error
if masterKey == nil {
value, err = decrypter.DPApi(encryptValue)
if err != nil {
fmt.Println(err)
}
} else {
value, err = decrypter.ChromePass(masterKey, encryptValue)
if err != nil {
fmt.Println(err)
}
}
log.Error(err)
}
cookie.Value = string(value)
*c = append(*c, cookie)
@ -98,7 +94,7 @@ func (f *FirefoxCookie) Parse(masterKey []byte) error {
creationTime, expiry int64
)
if err = rows.Scan(&name, &value, &host, &path, &creationTime, &expiry, &isSecure, &isHttpOnly); err != nil {
fmt.Println(err)
log.Warn(err)
}
*f = append(*f, cookie{
KeyName: name,

@ -2,13 +2,13 @@ package browingdata
import (
"database/sql"
"fmt"
"os"
_ "github.com/mattn/go-sqlite3"
"hack-browser-data/internal/decrypter"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
)
type ChromiumCreditCard []card
@ -31,7 +31,7 @@ func (c *ChromiumCreditCard) Parse(masterKey []byte) error {
value, encryptValue []byte
)
if err := rows.Scan(&guid, &name, &month, &year, &encryptValue); err != nil {
fmt.Println(err)
log.Warn(err)
}
creditCardInfo := card{
GUID: guid,

@ -8,6 +8,7 @@ import (
"strings"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
"hack-browser-data/internal/utils"
_ "github.com/mattn/go-sqlite3"
@ -86,7 +87,7 @@ func (f *FirefoxDownload) Parse(masterKey []byte) error {
placeID, dateAdded int64
)
if err = downloadRows.Scan(&placeID, &content, &url, &dateAdded); err != nil {
fmt.Println(err)
log.Warn(err)
}
contentList := strings.Split(content, ",{")
if len(contentList) > 1 {

@ -2,13 +2,13 @@ package browingdata
import (
"database/sql"
"fmt"
"os"
"sort"
_ "github.com/mattn/go-sqlite3"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
"hack-browser-data/internal/utils"
)
@ -34,7 +34,7 @@ func (c *ChromiumHistory) Parse(masterKey []byte) error {
)
// TODO: handle rows error
if err := rows.Scan(&url, &title, &visitCount, &lastVisitTime); err != nil {
fmt.Println(err)
log.Warn(err)
}
data := history{
Url: url,
@ -85,7 +85,7 @@ func (f *FirefoxHistory) Parse(masterKey []byte) error {
visitCount int
)
if err = historyRows.Scan(&id, &url, &visitDate, &title, &visitCount); err != nil {
fmt.Println(err)
log.Warn(err)
}
*f = append(*f, history{
Title: title,

@ -4,7 +4,6 @@ import (
"bytes"
"database/sql"
"encoding/base64"
"fmt"
"io/ioutil"
"os"
"sort"
@ -15,6 +14,7 @@ import (
"hack-browser-data/internal/decrypter"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
"hack-browser-data/internal/utils"
)
@ -40,7 +40,7 @@ func (c *ChromiumPassword) Parse(masterKey []byte) error {
create int64
)
if err := rows.Scan(&url, &username, &pwd, &create); err != nil {
fmt.Println(err)
log.Warn(err)
}
login := loginData{
UserName: username,
@ -48,17 +48,13 @@ func (c *ChromiumPassword) Parse(masterKey []byte) error {
LoginUrl: url,
}
if len(pwd) > 0 {
var err error
if masterKey == nil {
password, err = decrypter.DPApi(pwd)
if err != nil {
fmt.Println(err)
}
} else {
password, err = decrypter.ChromePass(masterKey, pwd)
if err != nil {
fmt.Println(err)
}
}
log.Error(err)
}
if create > time.Now().Unix() {
login.CreateDate = utils.TimeEpochFormat(create)

Loading…
Cancel
Save