Skip to content

Add 4 new middlewares based on MS-ADTS research#6

Open
j0hnZ3RA wants to merge 1 commit intoMacmod:mainfrom
j0hnZ3RA:feature/msadts-middlewares
Open

Add 4 new middlewares based on MS-ADTS research#6
j0hnZ3RA wants to merge 1 commit intoMacmod:mainfrom
j0hnZ3RA:feature/msadts-middlewares

Conversation

@j0hnZ3RA
Copy link

Summary

  • P (DNAttributesNoise): Randomly toggle dnAttributes on extensible match filters. AD ignores this field per MS-ADTS 3.1.1.3.1.3.1, adding noise without affecting query results.
  • L (TransitiveEval): Convert equality matches on link attributes (memberOf, member, manager, etc.) to use LDAP_MATCHING_RULE_TRANSITIVE_EVAL (1.2.840.113556.1.4.1941) per MS-ADTS 3.1.1.3.4.4.3.
  • U (GUIDFormat): Replace BaseDN with <GUID=hex> alternative DN form per MS-ADTS 3.1.1.3.1.2.4. Requires -o BDNGuid=hex.
  • I (SIDFormat): Replace BaseDN with <SID=string> alternative DN form per MS-ADTS 3.1.1.3.1.2.4. Requires -o BDNSid=S-1-....

Changes

  • middlewares/filter/obfuscation.go — 2 new filter middleware functions
  • middlewares/basedn/obfuscation.go — 2 new BaseDN middleware functions
  • config.go — Register 4 new middleware codes (P, L, U, I)
  • middlewares/options.go — 3 new options (BDNGuid, BDNSid, FiltDNAttrNoiseProb)

4 files changed, ~75 lines added.

Test plan

  • Build passes (go build .)
  • Tested P (dnAttributes noise) against real AD — extensible match with :dn: returns same results
  • Tested L (TransitiveEval) against real AD — memberOf query via matching rule 1941 returns correct members
  • Tested U (GUID BaseDN) against real AD — <GUID=hex> accepted as BaseDN, correct results
  • Tested I (SID BaseDN) against real AD — <SID=S-1-5-...> accepted as BaseDN, correct results
  • Tested combined: ldapx -f PL -b CU -o BDNGuid=... -F 2 with ldapsearch through proxy — all transformations applied correctly

New filter middlewares:
- P (DNAttributesNoise): Randomly toggle dnAttributes on extensible match
  filters. AD ignores this field per MS-ADTS 3.1.1.3.1.3.1, adding noise
  without affecting results.
- L (TransitiveEval): Convert equality matches on link attributes (memberOf,
  member, manager, etc) to LDAP_MATCHING_RULE_TRANSITIVE_EVAL
  (1.2.840.113556.1.4.1941) per MS-ADTS 3.1.1.3.4.4.3.

New BaseDN middlewares:
- U (GUIDFormat): Replace BaseDN with <GUID=hex> alternative form per
  MS-ADTS 3.1.1.3.1.2.4. Requires -o BDNGuid=hex.
- I (SIDFormat): Replace BaseDN with <SID=string> alternative form per
  MS-ADTS 3.1.1.3.1.2.4. Requires -o BDNSid=S-1-...

Tested against real Active Directory (Windows Server).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant