Code Monkey home page Code Monkey logo

dpapitk's Introduction

DPAPI Toolkit

Test GoDoc License

Introduction

DPAPI Toolkit is a DPAPI(Data Protection API) and DPAPI-NG(Data Protection API Next Generation) decryption toolkit based on Golang, providing APIs for offline data decryption on different operating systems. It supports decryption methods such as password, hash, and domain backup key.

Install

go get github.com/wat4r/dpapitk

Usage and example

Decrypt master key file

package main

import (
    "fmt"
    "github.com/wat4r/dpapitk/utils"
    "github.com/wat4r/dpapitk/masterkey"
)

func main()  {
	data := utils.ReadFile("./ea80d547-868c-4fc3-83cf-07203330d3be")
	masterKeyFile := masterkey.InitMasterKeyFile(data)
	sid := "S-1-5-21-3461634040-4115545689-1944680405-500"
	
	password := "123456"
	masterKeyFile.DecryptWithPassword(sid, password)
	
	// hash := "aa647b916a1fad374df9c30711d58a7a"
	// masterKeyFile.DecryptWithHash(sid, hash)

	// pvkFileData := dpapitk.utils.ReadFile("./domain_backup_key.pvk")
	// masterKeyFile.DecryptWithPvk(pvkFileData)
	
	fmt.Printf("Status: %v, Master key: %x\n", masterKeyFile.Decrypted, masterKeyFile.Key)
}

Decrypt DPAPI data blob

package main

import (
	"fmt"
	"github.com/wat4r/dpapitk/blob"
)

func main()  {
	blobData := []byte{...}
	masterKey := []byte{...}
	entropy := nil
	
	data, err := blob.DecryptWithMasterKey(blobData, masterKey, entropy)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Data: %x\n", data)
}

Decrypt CNG DPAPI data blob

package main

import (
	"fmt"
	"github.com/wat4r/dpapitk/cngblob"
)

func main()  {
	blobData := []byte{...}
	masterKey := []byte{...}
	entropy := nil
	
	data, err := cngblob.DecryptWithMasterKey(blobData, masterKey, entropy)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Data: %x\n", data)
}

TODO

✔️ DPAPI-NG(CNG DPAPI) data blob decrypt

License

This project is licensed under the Apache 2.0 license.

Contact

If you have any issues or feature requests, please contact us. PR is welcomed.

dpapitk's People

Contributors

wat4r avatar dependabot[bot] avatar

Stargazers

⭐ 🐾 avatar Shimmer avatar  avatar Kronos avatar Rachel Walker avatar  avatar Truda avatar

Watchers

 avatar

Forkers

lusunx vaginessa

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.