Git Product home page Git Product logo

gonss3's Introduction

gonss3

Package documentation: https://godoc.org/github.com/rusq/gonss3

Package gonss implements the subset of Mozilla NSS3 library. It implements just enough to decrypt the firefox profile passwords.

I take no credit, implementation is entirely based on this project which is based on Dr Stephen Henson research for "Netscape Key Databases".

Supports only key4.db (sqlite).

This library is created for educational purposes and licenced under LGPL 3.0.

Usage

package main
import "github.com/rusq/gonss3"

func main() {
  profile, err := gonss3.New("/path/to/profile", []byte("masterpass"))
  // handle err

  userCt, passCt := // fetch some data from logins.json

  user,err := profile.DecryptField(userCt)
  // handle err
  pass,err := profile.DecryptField(passCt)
  // handle err

  fmt.Println(user, pass)
}

TODO

[ ] TESTS

Useful links

gonss3's People

Contributors

rusq avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

gonss3's Issues

Tags don't match

Does it work in the current version of Firefox?
I tried:
decrypter, err := gonss3.New(profilePath, []byte{})
It returns:
asn1: structure error: tags don't match (4 vs {class:0 tag:16 length:65 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false}

invalid memory address or nil pointer dereference

import (
	"fmt"
	"github.com/rusq/gonss3"
)

func main() {
	profile, _ := gonss3.New("C:/Users/BitTheByte/AppData/Roaming/Mozilla/Firefox/Profiles/j23gfspm.default-release", []byte(""))
	user, _ := profile.DecryptField("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECIlhB08b+MmSBAhVn30mWDkZOQ==")
	fmt.Println(user)

}
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0x564e9d]

goroutine 1 [running]:
github.com/rusq/gonss3.(*Profile).decrypt(0x0, 0xc000012148, 0x8, 0x8, 0xc000012148, 0x8, 0x8, 0xc000012138, 0x8, 0x8)
        C:/Users/BitTheByte/go/pkg/mod/github.com/rusq/[email protected]/gonss3.go:171 +0x2d
github.com/rusq/gonss3.(*Profile).DecryptField(0x0, 0x69280d, 0x48, 0xa, 0xa, 0x0, 0x6bf180, 0xc000004580)
        C:/Users/BitTheByte/go/pkg/mod/github.com/rusq/[email protected]/gonss3.go:163 +0x154
Typhon/collectors.FireFoxLoginData()
        E:/REMOVED/firefox.go:12 +0xb6
main.main()
        E:/REMOVED/main.go:9 +0x27
exit status 2

asn1: structure error while parsing mozilla profile

I'm trying to decrypt Firefox passwords using the provided example, like this:

p = "C:\Users\REDACTED\AppData\Roaming\Mozilla\Firefox\Profiles\REDACTED.default-esr"
profile, err := gonss3.New(p, []byte(""))

but I receive the following error:

panic: asn1: structure error: tags don't match (4 vs {class:0 tag:16 length:65 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false}  @2

I'm currently using Firefox version 91.10.0esr (64-bit) on Windows 10.

Any idea on how can I get past this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.