Skip to content

A python tool to parse and describe the contents of a raw ntSecurityDescriptor structure.

Notifications You must be signed in to change notification settings

p0dalirius/pyDescribeNTSecurityDescriptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A python tool to parse and describe the contents of a raw ntSecurityDescriptor structure.
GitHub release (latest by date) YouTube Channel Subscribers

Features

Demonstration

Here is an example of the output of the tool when parsing the ntSecurityDescriptor contained in the file example_value.txt. This file contains a raw ntSecurityDescriptor structure in hex dump format:

0100148cc4090000e0090000140000008c0000000400780002000000075a38002000000003000000be3b0ef3f09fd111b6030000f80367c1a57a96bfe60dd011a28500aa003049e2010100000000000100000000075a380020000000030000
...
02000000000005200000002a02000000121800bd010f0001020000000000052000000020020000010500000000000515000000a3cd06bf0e0fe808c335b8e600020000010500000000000515000000a3cd06bf0e0fe808c335b8e600020000

Using DescribeNTSecurityDescriptor.py, we can open the file and parse its content precisely:

./DescribeNTSecurityDescriptor.py -v ./example_value.txt

example of the output

Usage

$ ./DescribeNTSecurityDescriptor.py -h
DescribeNTSecurityDescriptor.py v1.2 - by Podalirius

usage: DescribeNTSecurityDescriptor.py [-h] [-V] [-v VALUE | -D DISTINGUISHEDNAME] [--use-ldaps] [--summary] [--describe] [--dc-ip ip address] [--kdcHost FQDN KDC] [-d DOMAIN] [-u USER]
                                       [--no-pass | -p PASSWORD | -H [LMHASH:]NTHASH | --aes-key hex key] [-k]

Parse and describe the contents of a raw ntSecurityDescriptor structure

options:
  -h, --help            show this help message and exit
  -V, --verbose         Verbose mode. (default: False)
  -v VALUE, --value VALUE
                        The value to be described by the NTSecurityDescriptor
  -D DISTINGUISHEDNAME, --distinguishedName DISTINGUISHEDNAME
                        The distinguishedName of the object to be described by the NTSecurityDescriptor
  --use-ldaps           Use LDAPS instead of LDAP
  --summary             Generate a human readable summary of the rights.
  --describe            Describe the raw structure.

authentication & connection:
  --dc-ip ip address    IP Address of the domain controller or KDC (Key Distribution Center) for Kerberos. If omitted it will use the domain part (FQDN) specified in the identity parameter
  --kdcHost FQDN KDC    FQDN of KDC for Kerberos.
  -d DOMAIN, --domain DOMAIN
                        (FQDN) domain to authenticate to
  -u USER, --user USER  user to authenticate with

  --no-pass             don"t ask for password (useful for -k)
  -p PASSWORD, --password PASSWORD
                        password to authenticate with
  -H [LMHASH:]NTHASH, --hashes [LMHASH:]NTHASH
                        NT/LM hashes, format is LMhash:NThash
  --aes-key hex key     AES key to use for Kerberos Authentication (128 or 256 bits)
  -k, --kerberos        Use Kerberos authentication. Grabs credentials from .ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the ones
                        specified in the command line

Example

./DescribeNTSecurityDescriptor.py -u Administrator -p 'Admin123!' -d LAB --dc-ip 10.0.0.101 -D "CN=user user,CN=Users,DC=LAB,DC=local" --describe

Contributing

Pull requests are welcome. Feel free to open an issue if you want to add other features.

About

A python tool to parse and describe the contents of a raw ntSecurityDescriptor structure.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages