Skip to content

Commit

Permalink
chore: use sidbytes
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Jul 26, 2024
1 parent 8677440 commit 14407ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/unit/LdapPropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.Threading.Tasks;
using CommonLibTest.Facades;
using SharpHoundCommonLib;
using SharpHoundCommonLib.Enums;
using SharpHoundCommonLib.OutputTypes;
using SharpHoundCommonLib.Processors;
using SharpHoundRPC;
using Xunit;
using Xunit.Abstractions;
using static System.Text.Encoding;
Expand Down Expand Up @@ -953,9 +955,10 @@ public void LDAPPropertyProcessor_ParseAllProperties_CollectionCountOne_ControlC
[WindowsOnlyFact]
public void LDAPPropertyProcessor_ParseAllProperties_CollectionCountOne_SID() {
var creatorSIDExpected = "S-1-5-21-2697957641-2271029196-387917394";
var sidBytes = new SecurityIdentifier(creatorSIDExpected).GetBytes();
var mock = new MockDirectoryObject("CN\u003dNTAUTHCERTIFICATES,CN\u003dPUBLIC KEY SERVICES,CN\u003dSERVICES,CN\u003dCONFIGURATION,DC\u003dDUMPSTER,DC\u003dFIRE",
new Dictionary<string, object>
{{"ms-ds-creatorsid", UTF8.GetBytes(creatorSIDExpected)}}, "", "2F9F3630-F46A-49BF-B186-6629994EBCF9");
{{"ms-ds-creatorsid", sidBytes}}, "", "2F9F3630-F46A-49BF-B186-6629994EBCF9");

var processor = new LdapPropertyProcessor(new MockLdapUtils());
var props = processor.ParseAllProperties(mock);
Expand Down

0 comments on commit 14407ed

Please sign in to comment.