MSSQLDecryptor

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 14 Imported by: 0

README

MSSQLDecryptor

small and simple decryptor for encrypted objects in Microsoft SQL Server


Usage instructions:

  • Find the DAC port in your server (usually 1434).
  • If connecting from a remote machine enable remote DAC connections with: sp_configure 'remote admin connections', 1
  • Download the latest release or build it yourself.
  • Run the program and give it the object name as an argument

you can run the program with -help flag to get more information about the flags

Usage examples:

# to decrypt dbo.EncryptionTest from 172.20.0.2:1434 and login with dbadmin
./MSSQLDecryptor -host 172.20.0.2 -username dbadmin -dacport 1434 -database Playground dbo.EncryptionTest
# for SQL Server 2008
./MSSQLDecryptor -host 172.20.0.2 -username dbadmin -dacport 1434 -database Playground -disable-encryption dbo.EncryptionTest

How it works:

First it tries to get the encrypted object data from sys.sysobjvalues (we need a DAC connection to access this). The objects are encrypted using the RC4 algorithm and the encryption key is derived from SHA1 hash of database family guid + object id + sub object id and the decrypted source code is stored as UTF16LE.

Build instructions:

Prerequisites:

Build commands:

git clone https://github.com/er-azh/MSSQLDecryptor
cd MSSQLDecryptor
go mod tidy
go build .

you can also install it from source code with go install github.com/er-azh/MSSQLDecryptor@latest.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL