| | 1 | | using System; |
| | 2 | |
|
| | 3 | | namespace SharpHoundCommonLib.OutputTypes |
| | 4 | | { |
| | 5 | | /// <summary> |
| | 6 | | /// Represents a computer object in Active Directory. Contains all the properties BloodHound cares about |
| | 7 | | /// </summary> |
| | 8 | | public class Computer : OutputBase |
| | 9 | | { |
| 0 | 10 | | public string PrimaryGroupSID { get; set; } |
| 0 | 11 | | public TypedPrincipal[] AllowedToDelegate { get; set; } = Array.Empty<TypedPrincipal>(); |
| 0 | 12 | | public TypedPrincipal[] AllowedToAct { get; set; } = Array.Empty<TypedPrincipal>(); |
| 0 | 13 | | public TypedPrincipal[] HasSIDHistory { get; set; } = Array.Empty<TypedPrincipal>(); |
| 0 | 14 | | public TypedPrincipal[] DumpSMSAPassword { get; set; } = Array.Empty<TypedPrincipal>(); |
| 0 | 15 | | public SessionAPIResult Sessions { get; set; } = new(); |
| 0 | 16 | | public SessionAPIResult PrivilegedSessions { get; set; } = new(); |
| 0 | 17 | | public SessionAPIResult RegistrySessions { get; set; } = new(); |
| 0 | 18 | | public LocalGroupAPIResult[] LocalGroups { get; set; } = Array.Empty<LocalGroupAPIResult>(); |
| 0 | 19 | | public UserRightsAssignmentAPIResult[] UserRights { get; set; } = Array.Empty<UserRightsAssignmentAPIResult>(); |
| 0 | 20 | | public DCRegistryData DCRegistryData { get; set; } = new(); |
| 0 | 21 | | public ComputerStatus Status { get; set; } |
| 0 | 22 | | public bool IsDC { get; set; } |
| 0 | 23 | | public bool UnconstrainedDelegation { get; set; } |
| 0 | 24 | | public string DomainSID { get; set; } |
| | 25 | | } |
| | 26 | |
|
| | 27 | | public class DCRegistryData |
| | 28 | | { |
| | 29 | | public IntRegistryAPIResult CertificateMappingMethods { get; set; } |
| | 30 | | public IntRegistryAPIResult StrongCertificateBindingEnforcement { get; set; } |
| | 31 | | } |
| | 32 | |
|
| | 33 | | public class ComputerStatus |
| | 34 | | { |
| | 35 | | public bool Connectable { get; set; } |
| | 36 | | public string Error { get; set; } |
| | 37 | |
|
| | 38 | | public static string NonWindowsOS => "NonWindowsOS"; |
| | 39 | | public static string NotActive => "NotActive"; |
| | 40 | | public static string PortNotOpen => "PortNotOpen"; |
| | 41 | | public static string Success => "Success"; |
| | 42 | |
|
| | 43 | | public CSVComputerStatus GetCSVStatus(string computerName) |
| | 44 | | { |
| | 45 | | return new CSVComputerStatus |
| | 46 | | { |
| | 47 | | Status = Error, |
| | 48 | | Task = "CheckAvailability", |
| | 49 | | ComputerName = computerName |
| | 50 | | }; |
| | 51 | | } |
| | 52 | | } |
| | 53 | | } |