|
1 | | -# DescribeNTSecurityDescriptor |
2 | | -A cross-platforms tool to parse and describe the contents of a raw ntSecurityDescriptor structure. |
| 1 | + |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + A cross-platforms tool to parse and describe the contents of a raw ntSecurityDescriptor structure. |
| 5 | + <br> |
| 6 | + <a href="https://github.com/p0dalirius/DescribeNTSecurityDescriptor/actions/workflows/release.yaml" title="Build"><img alt="Build and Release" src="https://github.com/p0dalirius/DescribeNTSecurityDescriptor/actions/workflows/release.yaml/badge.svg"></a> |
| 7 | + <img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/p0dalirius/DescribeNTSecurityDescriptor"> |
| 8 | + <a href="https://twitter.com/intent/follow?screen_name=podalirius_" title="Follow"><img src="https://img.shields.io/twitter/follow/podalirius_?label=Podalirius&style=social"></a> |
| 9 | + <a href="https://www.youtube.com/c/Podalirius_?sub_confirmation=1" title="Subscribe"><img alt="YouTube Channel Subscribers" src="https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social"></a> |
| 10 | + <br> |
| 11 | +</p> |
| 12 | + |
| 13 | +## Features |
| 14 | + |
| 15 | +- [x] Reads source value from a file containing a raw ntSecurityDescriptor structure, in raw bytes, hex string or base64 string formats. |
| 16 | +- [x] Reads source value from the LDAP. |
| 17 | +- [ ] Outputs a human readable summary of accesses with `--summary` |
| 18 | +- [x] Parsing of Access Control Entries (ACE) of various types: |
| 19 | + - [x] ACE type [`ACCESS_ALLOWED_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/72e7c7ea-bc02-4c74-a619-818a16bf6adb?wt.mc_id=SEC-MVP-5005286) |
| 20 | + - [x] ACE type [`ACCESS_ALLOWED_OBJECT_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/c79a383c-2b3f-4655-abe7-dcbb7ce0cfbe?wt.mc_id=SEC-MVP-5005286) |
| 21 | + - [x] ACE type [`ACCESS_DENIED_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/b1e1321d-5816-4513-be67-b65d8ae52fe8?wt.mc_id=SEC-MVP-5005286) |
| 22 | + - [x] ACE type [`ACCESS_DENIED_OBJECT_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/8720fcf3-865c-4557-97b1-0b3489a6c270?wt.mc_id=SEC-MVP-5005286) |
| 23 | + - [x] ACE type [`ACCESS_ALLOWED_CALLBACK_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/c9579cf4-0f4a-44f1-9444-422dfb10557a?wt.mc_id=SEC-MVP-5005286) |
| 24 | + - [x] ACE type [`ACCESS_DENIED_CALLBACK_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/35adad6b-fda5-4cc1-b1b5-9beda5b07d2e?wt.mc_id=SEC-MVP-5005286) |
| 25 | + - [x] ACE type [`ACCESS_ALLOWED_CALLBACK_OBJECT_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/fe1838ea-ea34-4a5e-b40e-eb870f8322ae?wt.mc_id=SEC-MVP-5005286) |
| 26 | + - [x] ACE type [`ACCESS_DENIED_CALLBACK_OBJECT_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/4652f211-82d5-4b90-bd58-43bf3b0fc48d?wt.mc_id=SEC-MVP-5005286) |
| 27 | + - [x] ACE type [`SYSTEM_AUDIT_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/9431fd0f-5b9a-47f0-b3f0-3015e2d0d4f9?wt.mc_id=SEC-MVP-5005286) |
| 28 | + - [x] ACE type [`SYSTEM_AUDIT_OBJECT_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/c8da72ae-6b54-4a05-85f4-e2594936d3d5?wt.mc_id=SEC-MVP-5005286) |
| 29 | + - [x] ACE type [`SYSTEM_AUDIT_CALLBACK_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/bd6b6fd8-4bef-427e-9a43-b9b46457e934?wt.mc_id=SEC-MVP-5005286) |
| 30 | + - [x] ACE type [`SYSTEM_MANDATORY_LABEL_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/25fa6565-6cb0-46ab-a30a-016b32c4939a?wt.mc_id=SEC-MVP-5005286) |
| 31 | + - [x] ACE type [`SYSTEM_AUDIT_CALLBACK_OBJECT_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/949b02e7-f55d-4c26-969f-52a009597469?wt.mc_id=SEC-MVP-5005286) |
| 32 | + - [x] ACE type [`SYSTEM_RESOURCE_ATTRIBUTE_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/352944c7-4fb6-4988-8036-0a25dcedc730?wt.mc_id=SEC-MVP-5005286) |
| 33 | + - [x] ACE type [`SYSTEM_SCOPED_POLICY_ID_ACE`](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/aa0c0f62-4b4c-44f0-9718-c266a6accd9f?wt.mc_id=SEC-MVP-5005286) |
| 34 | +- [x] Parsing of SID |
| 35 | + - [x] Connect to LDAP to resolve sAMAccountNames of not well known SIDs |
| 36 | + - [x] Resolve names of well known SIDs |
| 37 | +- [ ] Parsing of Access Control Lists (ACL): |
| 38 | + - [ ] Print if ACL is in [canonical form](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/20233ed8-a6c6-4097-aafa-dd545ed24428?wt.mc_id=SEC-MVP-5005286) |
| 39 | + |
| 40 | + |
| 41 | +## Usage |
| 42 | + |
| 43 | +``` |
| 44 | +$ ./DescribeNTSecurityDescriptor -h |
| 45 | +DescribeNTSecurityDescriptor - by Remi GASCOU (Podalirius) - v1.2 |
| 46 | +
|
| 47 | +Usage: DescribeNTSecurityDescriptor [--debug] [--domain <string>] [--username <string>] [--password <string>] [--hashes <string>] [--dc-ip <string>] [--port <tcp port>] [--use-ldaps] [--distinguished-name <string>] [--file-hex <string>] [--file-base64 <string>] [--file-raw <string>] [--value-hex <string>] [--value-base64 <string>] |
| 48 | +
|
| 49 | + -d, --debug Debug mode. (default: false) |
| 50 | +
|
| 51 | + Authentication: |
| 52 | + -d, --domain <string> Active Directory domain to authenticate to. (default: "") |
| 53 | + -u, --username <string> User to authenticate as. (default: "") |
| 54 | + -p, --password <string> Password to authenticate with. (default: "") |
| 55 | + -H, --hashes <string> NT/LM hashes, format is LMhash:NThash. (default: "") |
| 56 | +
|
| 57 | + LDAP Connection Settings: |
| 58 | + -dc, --dc-ip <string> 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. (default: "") |
| 59 | + -P, --port <tcp port> Port number to connect to LDAP server. (default: 389) |
| 60 | + -l, --use-ldaps Use LDAPS instead of LDAP. (default: false) |
| 61 | +
|
| 62 | + Source Values: |
| 63 | + -D, --distinguished-name <string> Distinguished Name. (default: "") |
| 64 | + -fh, --file-hex <string> Path to file containing the hexadecimal string value of NTSecurityDescriptor. (default: "") |
| 65 | + -fb, --file-base64 <string> Path to file containing the base64 encoded value of NTSecurityDescriptor. (default: "") |
| 66 | + -fr, --file-raw <string> Path to file containing the raw binary value of NTSecurityDescriptor. (default: "") |
| 67 | + -vh, --value-hex <string> Raw hexadecimal string value of NTSecurityDescriptor. (default: "") |
| 68 | + -vb, --value-base64 <string> Raw base64 encoded value of NTSecurityDescriptor. (default: "") |
| 69 | +``` |
| 70 | + |
| 71 | +## Demonstration with a `--distinguished-name` |
| 72 | + |
| 73 | +```bash |
| 74 | +./DescribeNTSecurityDescriptor --debug --username "Administrator" --domain "LAB.local" --password "Admin123!" --dc-ip "10.0.0.201" --distinguished-name "CN=Administrator,CN=Users,DC=LAB,DC=local" |
| 75 | +``` |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +## Demonstration with a `--value-hex` |
| 80 | + |
| 81 | +```bash |
| 82 | +./DescribeNTSecurityDescriptor --username "Administrator" --domain "LAB.local" --password "Admin123!" --dc-ip "10.0.0.201" --debug --value-hex "0100149ccc000000e800000014000000a000000004008c00030000000240140020000c00010100000000000100000000075a38002000000003000000be3b0ef3f09fd111b6030000f80367c1a57a96bfe60dd011a28500aa003049e2010100000000000100000000075a38002000000003000000bf3b0ef3f09fd111b6030000f80367c1a57a96bfe60dd011a28500aa003049e201010000000000010000000002002c000100000000002400ff010f0001050000000000051500000028bb82279261b9fe2474aa5d0002000001050000000000051500000028bb82279261b9fe2474aa5d0002000001050000000000051500000028bb82279261b9fe2" |
| 83 | +``` |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +## Contributing |
| 88 | + |
| 89 | +Pull requests are welcome. Feel free to open an issue if you want to add other features. |
0 commit comments