Skip to content

Commit d8928fe

Browse files
authored
Merge branch 'v3' into v3
2 parents 0cb98e0 + d61b8f7 commit d8928fe

42 files changed

Lines changed: 1249 additions & 443 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Description
2+
3+
<!--- Describe your changes in detail -->
4+
5+
## Motivation and Context
6+
7+
<!--- Why is this change required? What problem does it solve? -->
8+
<!--- If it fixes an open issue, please link to the issue here. -->
9+
10+
## How Has This Been Tested?
11+
12+
<!--- Please describe in detail how you tested your changes. -->
13+
<!--- Include details of your testing environment, and the tests you ran to -->
14+
<!--- see how your change affects other areas of the code, etc. -->
15+
16+
## Screenshots (if appropriate):
17+
18+
## Types of changes
19+
20+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
21+
22+
- [ ] Chore (a change that does not modify the application functionality)
23+
- [ ] Bug fix (non-breaking change which fixes an issue)
24+
- [ ] New feature (non-breaking change which adds functionality)
25+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
26+
27+
## Checklist:
28+
29+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
30+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
31+
32+
- [ ] Documentation updates are needed, and have been made accordingly.
33+
- [ ] I have added and/or updated tests to cover my changes.
34+
- [ ] All new and existing tests passed.
35+
- [ ] My changes include a database migration.

src/CommonLib/Cache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private Cache()
5050
/// </summary>
5151
/// <param name="key"></param>
5252
/// <param name="value"></param>
53-
internal static void AddSidToDomain(string key, string value)
53+
internal static void AddDomainSidMapping(string key, string value)
5454
{
5555
CacheInstance?.SIDToDomainCache.TryAdd(key, value);
5656
}

src/CommonLib/DomainInfo.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Collections.Concurrent;
2+
using System.Collections.Generic;
3+
using System.DirectoryServices.Protocols;
4+
5+
namespace SharpHoundCommonLib
6+
{
7+
public class DomainInfo
8+
{
9+
public string DomainSID { get; set; }
10+
public string DomainFQDN { get; set; }
11+
public string DomainSearchBase { get; set; }
12+
public string DomainConfigurationPath { get; set; }
13+
public string DomainNetbiosName { get; set; }
14+
15+
public override string ToString()
16+
{
17+
return $"{nameof(DomainSID)}: {DomainSID}, {nameof(DomainFQDN)}: {DomainFQDN}, {nameof(DomainSearchBase)}: {DomainSearchBase}, {nameof(DomainConfigurationPath)}: {DomainConfigurationPath}, {nameof(DomainNetbiosName)}: {DomainNetbiosName}";
18+
}
19+
}
20+
}

src/CommonLib/EdgeNames.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static class EdgeNames
2121
public const string AddKeyCredentialLink = "AddKeyCredentialLink";
2222
public const string SQLAdmin = "SQLAdmin";
2323
public const string WriteAccountRestrictions = "WriteAccountRestrictions";
24+
public const string WriteGPLink = "WriteGPLink";
2425

2526
//CertAbuse edges
2627
public const string WritePKIEnrollmentFlag = "WritePKIEnrollmentFlag";

src/CommonLib/Enums/DataType.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ public static class DataType
1414
public const string NTAuthStores = "ntauthstores";
1515
public const string EnterpriseCAs = "enterprisecas";
1616
public const string CertTemplates = "certtemplates";
17+
public const string IssuancePolicies = "issuancepolicies";
1718
}
18-
}
19+
}

src/CommonLib/Enums/DirectoryPaths.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ public class DirectoryPaths
99
public const string NTAuthStoreLocation = "CN=NTAuthCertificates,CN=Public Key Services,CN=Services,CN=Configuration";
1010
public const string PKILocation = "CN=Public Key Services,CN=Services,CN=Configuration";
1111
public const string ConfigLocation = "CN=Configuration";
12+
public const string OIDContainerLocation = "CN=OID,CN=Public Key Services,CN=Services,CN=Configuration";
1213
}
1314
}

src/CommonLib/Enums/Labels.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public enum Label
1414
Container,
1515
Configuration,
1616
CertTemplate,
17-
CertAuthority,
1817
RootCA,
1918
AIACA,
2019
EnterpriseCA,
21-
NTAuthStore
20+
NTAuthStore,
21+
IssuancePolicy
2222
}
23-
}
23+
}

src/CommonLib/Enums/LdapErrorCodes.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public enum LdapErrorCodes : int
44
{
55
Success = 0,
66
Busy = 51,
7-
ServerDown = 81
7+
ServerDown = 81,
8+
LocalError = 82,
9+
KerberosAuthType = 83
810
}
911
}

src/CommonLib/Enums/TrustAttributes.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public enum TrustAttributes
1515
TrustUsesRc4 = 0x80,
1616
TrustUsesAes = 0x100,
1717
CrossOrganizationNoTGTDelegation = 0x200,
18-
PIMTrust = 0x400
18+
PIMTrust = 0x400,
19+
Unknown = 0x400000,
1920
}
2021
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.DirectoryServices.Protocols;
3+
4+
namespace SharpHoundCommonLib.Exceptions
5+
{
6+
public class LdapAuthenticationException : Exception
7+
{
8+
public LdapAuthenticationException(LdapException exception) : base("Error authenticating to LDAP", exception)
9+
{
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)