├── .gitignore ├── LICENSE ├── README.md ├── SharpView.sln └── SharpView ├── App.config ├── Arguments ├── Args_Add_DomainGroupMember.cs ├── Args_Add_DomainObjectAcl.cs ├── Args_Add_RemoteConnection.cs ├── Args_ConvertFrom_SID.cs ├── Args_ConvertFrom_UACValue.cs ├── Args_ConvertTo_SID.cs ├── Args_Convert_ADName.cs ├── Args_Export_PowerViewCSV.cs ├── Args_Find_DomainLocalGroupMember.cs ├── Args_Find_DomainObjectPropertyOutlier.cs ├── Args_Find_DomainProcess.cs ├── Args_Find_DomainShare.cs ├── Args_Find_DomainUserEvent.cs ├── Args_Find_DomainUserLocation.cs ├── Args_Find_InterestingDomainAcl.cs ├── Args_Find_InterestingDomainShareFile.cs ├── Args_Find_InterestingFile.cs ├── Args_Find_LocalAdminAccess.cs ├── Args_Get_Domain.cs ├── Args_Get_DomainComputer.cs ├── Args_Get_DomainController.cs ├── Args_Get_DomainDFSShare.cs ├── Args_Get_DomainDNSRecord.cs ├── Args_Get_DomainDNSZone.cs ├── Args_Get_DomainFileServer.cs ├── Args_Get_DomainForeignGroupMember.cs ├── Args_Get_DomainForeignUser.cs ├── Args_Get_DomainGPO.cs ├── Args_Get_DomainGPOComputerLocalGroupMapping.cs ├── Args_Get_DomainGPOLocalGroup.cs ├── Args_Get_DomainGPOUserLocalGroupMapping.cs ├── Args_Get_DomainGUIDMap.cs ├── Args_Get_DomainGroup.cs ├── Args_Get_DomainGroupMember.cs ├── Args_Get_DomainManagedSecurityGroup.cs ├── Args_Get_DomainOU.cs ├── Args_Get_DomainObject.cs ├── Args_Get_DomainObjectAcl.cs ├── Args_Get_DomainPolicyData.cs ├── Args_Get_DomainSID.cs ├── Args_Get_DomainSPNTicket.cs ├── Args_Get_DomainSearcher.cs ├── Args_Get_DomainSite.cs ├── Args_Get_DomainSubnet.cs ├── Args_Get_DomainTrust.cs ├── Args_Get_DomainTrustMapping.cs ├── Args_Get_DomainUser.cs ├── Args_Get_DomainUserEvent.cs ├── Args_Get_Forest.cs ├── Args_Get_ForestDomain.cs ├── Args_Get_ForestGlobalCatalog.cs ├── Args_Get_GptTmpl.cs ├── Args_Get_GroupsXML.cs ├── Args_Get_IniContent.cs ├── Args_Get_NetComputerSiteName.cs ├── Args_Get_NetLocalGroup.cs ├── Args_Get_NetLocalGroupMember.cs ├── Args_Get_NetLoggedon.cs ├── Args_Get_NetRDPSession.cs ├── Args_Get_NetSession.cs ├── Args_Get_NetShare.cs ├── Args_Get_PathAcl.cs ├── Args_Get_PrincipalContext.cs ├── Args_Get_RegLoggedOn.cs ├── Args_Get_WMIProcess.cs ├── Args_Get_WMIRegCachedRDPConnection.cs ├── Args_Get_WMIRegLastLoggedOn.cs ├── Args_Get_WMIRegMountedDrive.cs ├── Args_Get_WMIRegProxy.cs ├── Args_Invoke_Kerberoast.cs ├── Args_Invoke_UserImpersonation.cs ├── Args_New_DomainGroup.cs ├── Args_New_DomainUser.cs ├── Args_Remove_DomainObjectAcl.cs ├── Args_Remove_RemoteConnection.cs ├── Args_Resolve_IPAddress.cs ├── Args_Set_DomainObject.cs ├── Args_Set_DomainUserPassword.cs ├── Args_Test.cs └── Args_Test_AdminAccess.cs ├── Enums ├── ADSNameType.cs ├── ClassType.cs ├── DnsRecordType.cs ├── GroupProperty.cs ├── GroupScope.cs ├── GroupType.cs ├── LocalGroupType.cs ├── LogonType.cs ├── ManagerType.cs ├── MethodType.cs ├── Rights.cs ├── SPNTicketFormat.cs ├── SamAccountType.cs ├── StealthSource.cs ├── TrustAttribute.cs ├── UACEnum.cs └── Version.cs ├── FodyWeavers.xml ├── Interfaces ├── IDomainTrust.cs └── IWinEvent.cs ├── PowerView.cs ├── Program.cs ├── Properties └── AssemblyInfo.cs ├── Returns ├── ACL.cs ├── AdminAccess.cs ├── ApiDomainTrust.cs ├── CachedRDPConnection.cs ├── ComputerIPAddress.cs ├── ComputerSite.cs ├── DFSShare.cs ├── DNSRecord.cs ├── DNSZone.cs ├── DomainPolicyData.cs ├── ExplicitCredentialLogonEvent.cs ├── FileACL.cs ├── Filter.cs ├── ForeignGroupMember.cs ├── ForeignUser.cs ├── ForestEx.cs ├── FoundFile.cs ├── GPO.cs ├── GPOComputerLocalGroupMember.cs ├── GPOGroup.cs ├── GPOLocalGroupMapping.cs ├── GptTmpl.cs ├── GroupMember.cs ├── GroupsXML.cs ├── LDAPProperty.cs ├── LastLoggedOnUser.cs ├── LdapDomainTrust.cs ├── LocalGroupAPI.cs ├── LocalGroupMemberAPI.cs ├── LocalGroupMemberWinNT.cs ├── LocalGroupWinNT.cs ├── LoggedOnUserInfo.cs ├── LogonEvent.cs ├── ManagedSecurityGroup.cs ├── NetDomainTrust.cs ├── PrincipalContextEx.cs ├── PropertyOutlier.cs ├── ProxySettings.cs ├── RDPSessionInfo.cs ├── RegLoggedOnUser.cs ├── RegMountedDrive.cs ├── ResolvedSID.cs ├── SPNTicket.cs ├── SessionInfo.cs ├── ShareInfo.cs ├── UserLocation.cs └── UserProcess.cs ├── SharpView.csproj ├── Utils ├── Logger.cs ├── NativeMethods.cs ├── NetworkCredentialConverter.cs ├── ObjectDumper.cs ├── PathExtension.cs ├── ReflectionExtension.cs ├── RegexMatch.cs ├── ResultPropertyValueCollectionExtension.cs ├── StringArrayConverter.cs ├── StringExtension.cs ├── TestConnection.cs ├── TrustAttributeExtension.cs ├── UACEnumExtension.cs ├── ValidationExtension.cs ├── WildcardMatch.cs └── WmiWrapper.cs └── packages.config /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Tevora-Threat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SharpView 2 | .NET port of [PowerView](https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1) 3 | 4 | #### Usage: 5 | ``` 6 | C:\>SharpView.exe Get-DomainController -Domain test.local -Server dc.test.local -Credential admin@test.local/password 7 | ``` 8 | ``` 9 | C:\>SharpView.exe Get-DomainController -Help 10 | Get-DomainController -Domain -Server -DomainController -LDAP -Credential 11 | ``` 12 | 13 | #### Available methods 14 | ``` 15 | Get-DomainGPOUserLocalGroupMapping 16 | Find-GPOLocation 17 | Get-DomainGPOComputerLocalGroupMapping 18 | Find-GPOComputerAdmin 19 | Get-DomainObjectAcl 20 | Get-ObjectAcl 21 | Add-DomainObjectAcl 22 | Add-ObjectAcl 23 | Remove-DomainObjectAcl 24 | Get-RegLoggedOn 25 | Get-LoggedOnLocal 26 | Get-NetRDPSession 27 | Test-AdminAccess 28 | Invoke-CheckLocalAdminAccess 29 | Get-WMIProcess 30 | Get-NetProcess 31 | Get-WMIRegProxy 32 | Get-Proxy 33 | Get-WMIRegLastLoggedOn 34 | Get-LastLoggedOn 35 | Get-WMIRegCachedRDPConnection 36 | Get-CachedRDPConnection 37 | Get-WMIRegMountedDrive 38 | Get-RegistryMountedDrive 39 | Find-InterestingDomainAcl 40 | Invoke-ACLScanner 41 | Get-NetShare 42 | Get-NetLoggedon 43 | Get-NetLocalGroup 44 | Get-NetLocalGroupMember 45 | Get-NetSession 46 | Get-PathAcl 47 | ConvertFrom-UACValue 48 | Get-PrincipalContext 49 | New-DomainGroup 50 | New-DomainUser 51 | Add-DomainGroupMember 52 | Set-DomainUserPassword 53 | Invoke-Kerberoast 54 | Export-PowerViewCSV 55 | Find-LocalAdminAccess 56 | Find-DomainLocalGroupMember 57 | Find-DomainShare 58 | Find-DomainUserEvent 59 | Find-DomainProcess 60 | Find-DomainUserLocation 61 | Find-InterestingFile 62 | Find-InterestingDomainShareFile 63 | Find-DomainObjectPropertyOutlier 64 | TestMethod 65 | Get-Domain 66 | Get-NetDomain 67 | Get-DomainComputer 68 | Get-NetComputer 69 | Get-DomainController 70 | Get-NetDomainController 71 | Get-DomainFileServer 72 | Get-NetFileServer 73 | Convert-ADName 74 | Get-DomainObject 75 | Get-ADObject 76 | Get-DomainUser 77 | Get-NetUser 78 | Get-DomainGroup 79 | Get-NetGroup 80 | Get-DomainDFSShare 81 | Get-DFSshare 82 | Get-DomainDNSRecord 83 | Get-DNSRecord 84 | Get-DomainDNSZone 85 | Get-DNSZone 86 | Get-DomainForeignGroupMember 87 | Find-ForeignGroup 88 | Get-DomainForeignUser 89 | Find-ForeignUser 90 | ConvertFrom-SID 91 | Convert-SidToName 92 | Get-DomainGroupMember 93 | Get-NetGroupMember 94 | Get-DomainManagedSecurityGroup 95 | Find-ManagedSecurityGroups 96 | Get-DomainOU 97 | Get-NetOU 98 | Get-DomainSID 99 | Get-Forest 100 | Get-NetForest 101 | Get-ForestTrust 102 | Get-NetForestTrust 103 | Get-DomainTrust 104 | Get-NetDomainTrust 105 | Get-ForestDomain 106 | Get-NetForestDomain 107 | Get-DomainSite 108 | Get-NetSite 109 | Get-DomainSubnet 110 | Get-NetSubnet 111 | Get-DomainTrustMapping 112 | Invoke-MapDomainTrust 113 | Get-ForestGlobalCatalog 114 | Get-NetForestCatalog 115 | Get-DomainUserEvent 116 | Get-UserEvent 117 | Get-DomainGUIDMap 118 | Get-GUIDMap 119 | Resolve-IPAddress 120 | Get-IPAddress 121 | ConvertTo-SID 122 | Invoke-UserImpersonation 123 | Invoke-RevertToSelf 124 | Get-DomainSPNTicket 125 | Request-SPNTicket 126 | Get-NetComputerSiteName 127 | Get-SiteName 128 | Get-DomainGPO 129 | Get-NetGPO 130 | Set-DomainObject 131 | Set-ADObject 132 | Add-RemoteConnection 133 | Remove-RemoteConnection 134 | Get-IniContent 135 | Get-GptTmpl 136 | Get-GroupsXML 137 | Get-DomainPolicyData 138 | Get-DomainPolicy 139 | Get-DomainGPOLocalGroup 140 | Get-NetGPOGroup 141 | ``` 142 | 143 | Blog [Here](https://threat.tevora.com/a-sharpview-and-more-aggressor) 144 | Currently compiled for .NET 4.5.2 todo is support 3.0 (4.0 at minimum) 145 | 146 | ##### TODO 147 | * Fix any broken issues 148 | * Support .NET 3.0 (or 4.0 depending on CS execute-assembly) -------------------------------------------------------------------------------- /SharpView.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpView", "SharpView\SharpView.csproj", "{22A156EA-2623-45C7-8E50-E864D9FC44D3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {22A156EA-2623-45C7-8E50-E864D9FC44D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {22A156EA-2623-45C7-8E50-E864D9FC44D3}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {22A156EA-2623-45C7-8E50-E864D9FC44D3}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {22A156EA-2623-45C7-8E50-E864D9FC44D3}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C89051C4-3526-4925-9CC3-9C7E9C2DD633} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SharpView/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Add_DomainGroupMember.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Add_DomainGroupMember 13 | { 14 | public string Identity { get; set; } 15 | public string GroupName { get { return Identity; } set { Identity = value; } } 16 | public string GroupIdentity { get { return Identity; } set { Identity = value; } } 17 | 18 | public string[] Members { get; set; } 19 | public string[] MemberIdentity { get { return Members; } set { Members = value; } } 20 | public string[] Member { get { return Members; } set { Members = value; } } 21 | public string[] DistinguishedName { get { return Members; } set { Members = value; } } 22 | 23 | public string Domain { get; set; } 24 | 25 | public NetworkCredential Credential { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Add_DomainObjectAcl.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Add_DomainObjectAcl 13 | { 14 | public string[] TargetIdentity { get; set; } 15 | public string[] DistinguishedName { get { return TargetIdentity; } set { TargetIdentity = value; } } 16 | public string[] SamAccountName { get { return TargetIdentity; } set { TargetIdentity = value; } } 17 | public string[] Name { get { return TargetIdentity; } set { TargetIdentity = value; } } 18 | 19 | public string TargetDomain { get; set; } 20 | 21 | public string TargetLDAPFilter { get; set; } 22 | public string Filter { get { return TargetLDAPFilter; } set { TargetLDAPFilter = value; } } 23 | 24 | public string TargetSearchBase { get; set; } 25 | 26 | public string[] PrincipalIdentity { get; set; } 27 | 28 | public string PrincipalDomain { get; set; } 29 | 30 | public string Server { get; set; } 31 | public string DomainController { get { return Server; } set { Server = value; } } 32 | 33 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 34 | 35 | private int _ResultPageSize = 200; 36 | public int ResultPageSize 37 | { 38 | get { return _ResultPageSize; } 39 | set 40 | { 41 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 42 | _ResultPageSize = value; 43 | } 44 | } 45 | 46 | private int? _ServerTimeLimit; 47 | public int? ServerTimeLimit 48 | { 49 | get { return _ServerTimeLimit; } 50 | set 51 | { 52 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 53 | _ServerTimeLimit = value; 54 | } 55 | } 56 | 57 | public bool Tombstone { get; set; } 58 | 59 | public NetworkCredential Credential { get; set; } 60 | 61 | public Rights? Rights { get; set; } = Enums.Rights.All; 62 | 63 | public Guid RightsGUID { get; set; } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Add_RemoteConnection.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using SharpView.Utils; 10 | 11 | namespace SharpView.Arguments 12 | { 13 | public class Args_Add_RemoteConnection 14 | { 15 | public string[] ComputerName { get; set; } 16 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 18 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 19 | 20 | private string[] _path; 21 | public string[] Path 22 | { 23 | get 24 | { 25 | return _path; 26 | } 27 | set 28 | { 29 | if (value != null) 30 | { 31 | foreach (var item in value) 32 | { 33 | if (!item.IsRegexMatch(@"\\\\.*\\.*")) 34 | throw new ArgumentException(@"Should be '\\\\.*\\.*' as pattern", nameof(Path)); 35 | } 36 | } 37 | _path = value; 38 | } 39 | } 40 | 41 | public NetworkCredential Credential { get; set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_ConvertFrom_SID.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace SharpView.Arguments 10 | { 11 | public class Args_ConvertFrom_SID 12 | { 13 | public string[] ObjectSID { get; set; } 14 | public string[] SID { get { return ObjectSID; } set { ObjectSID = value; } } 15 | 16 | public string Domain { get; set; } 17 | 18 | public string Server { get; set; } 19 | public string DomainController { get { return Server; } set { Server = value; } } 20 | 21 | public NetworkCredential Credential { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_ConvertFrom_UACValue.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_ConvertFrom_UACValue 13 | { 14 | public int Value { get; set; } 15 | public int UAC { get { return Value; } set { Value = value; } } 16 | public int useraccountcontrol { get { return Value; } set { Value = value; } } 17 | 18 | public bool ShowAll { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_ConvertTo_SID.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_ConvertTo_SID 13 | { 14 | public string[] ObjectName { get; set; } 15 | public string[] Name { get { return ObjectName; } set { ObjectName = value; } } 16 | public string[] Identity { get { return ObjectName; } set { ObjectName = value; } } 17 | 18 | public string Domain { get; set; } 19 | 20 | public string Server { get; set; } 21 | public string DomainController { get { return Server; } set { Server = value; } } 22 | 23 | public NetworkCredential Credential { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Convert_ADName.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace SharpView.Arguments 10 | { 11 | public class Args_Convert_ADName 12 | { 13 | public string[] Identity { get; set; } 14 | public string[] Name { get { return Identity; } set { Identity = value; } } 15 | public string[] ObjectName { get { return Identity; } set { Identity = value; } } 16 | 17 | public ADSNameType? OutputType { get; set; } 18 | 19 | public string Domain { get; set; } 20 | 21 | public string Server { get; set; } 22 | public string DomainController { get { return Server; } set { Server = value; } } 23 | 24 | public NetworkCredential Credential { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Export_PowerViewCSV.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Export_PowerViewCSV 13 | { 14 | public object[] InputObject { get; set; } 15 | 16 | public string Path { get; set; } 17 | 18 | public Char Delimiter { get; set; } = ','; 19 | 20 | public bool Append { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_DomainLocalGroupMember.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_DomainLocalGroupMember 13 | { 14 | public string[] ComputerName { get; set; } 15 | public string[] DNSHostName { get { return ComputerName; } set { ComputerName = value; } } 16 | 17 | public string ComputerDomain { get; set; } 18 | 19 | public string ComputerLDAPFilter { get; set; } 20 | 21 | public string ComputerSearchBase { get; set; } 22 | 23 | public string ComputerOperatingSystem { get; set; } 24 | public string OperatingSystem { get { return ComputerOperatingSystem; } set { ComputerOperatingSystem = value; } } 25 | 26 | public string ComputerServicePack { get; set; } 27 | public string ServicePack { get { return ComputerServicePack; } set { ComputerServicePack = value; } } 28 | 29 | public string ComputerSiteName { get; set; } 30 | public string SiteName { get { return ComputerSiteName; } set { ComputerSiteName = value; } } 31 | 32 | public string GroupName { get; set; } = "Administrators"; 33 | 34 | public MethodType Method { get; set; } = MethodType.API; 35 | 36 | public string Server { get; set; } 37 | public string DomainController { get { return Server; } set { Server = value; } } 38 | 39 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 40 | 41 | private int _ResultPageSize = 200; 42 | public int ResultPageSize 43 | { 44 | get { return _ResultPageSize; } 45 | set 46 | { 47 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 48 | _ResultPageSize = value; 49 | } 50 | } 51 | 52 | private int? _ServerTimeLimit; 53 | public int? ServerTimeLimit 54 | { 55 | get { return _ServerTimeLimit; } 56 | set 57 | { 58 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 59 | _ServerTimeLimit = value; 60 | } 61 | } 62 | 63 | public bool Tombstone { get; set; } 64 | 65 | public NetworkCredential Credential { get; set; } 66 | 67 | private int _Delay = 0; 68 | public int Delay 69 | { 70 | get { return _Delay; } 71 | set 72 | { 73 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("Delay"); 74 | _Delay = value; 75 | } 76 | } 77 | 78 | private double _Jitter = 0.3; 79 | public double Jitter 80 | { 81 | get { return _Jitter; } 82 | set 83 | { 84 | if (value < 0.0 || value > 1.0) throw new ArgumentOutOfRangeException("Jitter"); 85 | _Jitter = value; 86 | } 87 | } 88 | 89 | private int _Threads = 20; 90 | public int Threads 91 | { 92 | get { return _Threads; } 93 | set 94 | { 95 | if (value < 1 || value > 100) throw new ArgumentOutOfRangeException("Threads"); 96 | _Threads = value; 97 | } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_DomainObjectPropertyOutlier.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_DomainObjectPropertyOutlier 13 | { 14 | public ClassType ClassName { get; set; } 15 | public ClassType Class { get { return ClassName; } set { ClassName = value; } } 16 | 17 | public string[] ReferencePropertySet { get; set; } 18 | 19 | public object ReferenceObject { get; set; } 20 | 21 | public string Domain { get; set; } 22 | 23 | public string LDAPFilter { get; set; } 24 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 25 | 26 | public string SearchBase { get; set; } 27 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 28 | 29 | public string Server { get; set; } 30 | public string DomainController { get { return Server; } set { Server = value; } } 31 | 32 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 33 | 34 | private int _ResultPageSize = 200; 35 | public int ResultPageSize 36 | { 37 | get { return _ResultPageSize; } 38 | set 39 | { 40 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 41 | _ResultPageSize = value; 42 | } 43 | } 44 | 45 | private int? _ServerTimeLimit; 46 | public int? ServerTimeLimit 47 | { 48 | get { return _ServerTimeLimit; } 49 | set 50 | { 51 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 52 | _ServerTimeLimit = value; 53 | } 54 | } 55 | 56 | public bool Tombstone { get; set; } 57 | 58 | public NetworkCredential Credential { get; set; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_DomainShare.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_DomainShare 13 | { 14 | public string[] ComputerName { get; set; } 15 | public string[] DNSHostName { get { return ComputerName; } set { ComputerName = value; } } 16 | 17 | public string ComputerDomain { get; set; } 18 | public string Domain { get { return ComputerDomain; } set { ComputerDomain = value; } } 19 | 20 | public string ComputerLDAPFilter { get; set; } 21 | 22 | public string ComputerSearchBase { get; set; } 23 | 24 | public string ComputerOperatingSystem { get; set; } 25 | public string OperatingSystem { get { return ComputerOperatingSystem; } set { ComputerOperatingSystem = value; } } 26 | 27 | public string ComputerServicePack { get; set; } 28 | public string ServicePack { get { return ComputerServicePack; } set { ComputerServicePack = value; } } 29 | 30 | public string ComputerSiteName { get; set; } 31 | public string SiteName { get { return ComputerSiteName; } set { ComputerSiteName = value; } } 32 | 33 | public bool CheckShareAccess { get; set; } 34 | public bool CheckAccess { get { return CheckShareAccess; } set { CheckShareAccess = value; } } 35 | 36 | public string Server { get; set; } 37 | public string DomainController { get { return Server; } set { Server = value; } } 38 | 39 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 40 | 41 | private int _ResultPageSize = 200; 42 | public int ResultPageSize 43 | { 44 | get { return _ResultPageSize; } 45 | set 46 | { 47 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 48 | _ResultPageSize = value; 49 | } 50 | } 51 | 52 | private int? _ServerTimeLimit; 53 | public int? ServerTimeLimit 54 | { 55 | get { return _ServerTimeLimit; } 56 | set 57 | { 58 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 59 | _ServerTimeLimit = value; 60 | } 61 | } 62 | 63 | public bool Tombstone { get; set; } 64 | 65 | public NetworkCredential Credential { get; set; } 66 | 67 | private int _Delay = 0; 68 | public int Delay 69 | { 70 | get { return _Delay; } 71 | set 72 | { 73 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("Delay"); 74 | _Delay = value; 75 | } 76 | } 77 | 78 | private double _Jitter = 0.3; 79 | public double Jitter 80 | { 81 | get { return _Jitter; } 82 | set 83 | { 84 | if (value < 0.0 || value > 1.0) throw new ArgumentOutOfRangeException("Jitter"); 85 | _Jitter = value; 86 | } 87 | } 88 | 89 | private int _Threads = 20; 90 | public int Threads 91 | { 92 | get { return _Threads; } 93 | set 94 | { 95 | if (value < 1 || value > 100) throw new ArgumentOutOfRangeException("Threads"); 96 | _Threads = value; 97 | } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_DomainUserEvent.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_DomainUserEvent 13 | { 14 | public string[] ComputerName { get; set; } 15 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public string Domain { get; set; } 20 | 21 | public Dictionary Filter { get; set; } 22 | 23 | public DateTime StartTime { get; set; } = DateTime.Now.AddDays(-1); 24 | 25 | public DateTime EndTime { get; set; } = DateTime.Now; 26 | 27 | private int _MaxEvents = 200; 28 | public int MaxEvents 29 | { 30 | get { return _MaxEvents; } 31 | set 32 | { 33 | if (value < 1 || value > 1000000) throw new ArgumentOutOfRangeException("MaxEvents"); 34 | _MaxEvents = value; 35 | } 36 | } 37 | 38 | public string[] UserIdentity { get; set; } 39 | 40 | public string UserDomain { get; set; } 41 | 42 | public string UserLDAPFilter { get; set; } 43 | 44 | public string UserSearchBase { get; set; } 45 | 46 | public string[] UserGroupIdentity { get; set; } = { "Domain Admins" }; 47 | public string[] GroupName { get { return UserGroupIdentity; } set { UserGroupIdentity = value; } } 48 | public string[] Group { get { return UserGroupIdentity; } set { UserGroupIdentity = value; } } 49 | 50 | public bool UserAdminCount { get; set; } 51 | public bool AdminCount { get { return UserAdminCount; } set { UserAdminCount = value; } } 52 | 53 | public bool CheckAccess { get; set; } 54 | 55 | public string Server { get; set; } 56 | public string DomainController { get { return Server; } set { Server = value; } } 57 | 58 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 59 | 60 | private int _ResultPageSize = 200; 61 | public int ResultPageSize 62 | { 63 | get { return _ResultPageSize; } 64 | set 65 | { 66 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 67 | _ResultPageSize = value; 68 | } 69 | } 70 | 71 | private int? _ServerTimeLimit; 72 | public int? ServerTimeLimit 73 | { 74 | get { return _ServerTimeLimit; } 75 | set 76 | { 77 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 78 | _ServerTimeLimit = value; 79 | } 80 | } 81 | 82 | public bool Tombstone { get; set; } 83 | 84 | public NetworkCredential Credential { get; set; } 85 | 86 | public bool StopOnSuccess { get; set; } 87 | 88 | private int _Delay = 0; 89 | public int Delay 90 | { 91 | get { return _Delay; } 92 | set 93 | { 94 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("Delay"); 95 | _Delay = value; 96 | } 97 | } 98 | 99 | private double _Jitter = 0.3; 100 | public double Jitter 101 | { 102 | get { return _Jitter; } 103 | set 104 | { 105 | if (value < 0.0 || value > 1.0) throw new ArgumentOutOfRangeException("Jitter"); 106 | _Jitter = value; 107 | } 108 | } 109 | 110 | private int _Threads = 20; 111 | public int Threads 112 | { 113 | get { return _Threads; } 114 | set 115 | { 116 | if (value < 1 || value > 100) throw new ArgumentOutOfRangeException("Threads"); 117 | _Threads = value; 118 | } 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_InterestingDomainAcl.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_InterestingDomainAcl 13 | { 14 | public string Domain { get; set; } 15 | public string DomainName { get { return Domain; } set { Domain = value; } } 16 | public string Name { get { return Domain; } set { Domain = value; } } 17 | 18 | public bool ResolveGUIDs { get; set; } 19 | 20 | public Rights? RightsFilter { get; set; } 21 | 22 | public string LDAPFilter { get; set; } 23 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 24 | 25 | public string SearchBase { get; set; } 26 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 27 | 28 | public string Server { get; set; } 29 | public string DomainController { get { return Server; } set { Server = value; } } 30 | 31 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 32 | 33 | private int _ResultPageSize = 200; 34 | public int ResultPageSize 35 | { 36 | get { return _ResultPageSize; } 37 | set 38 | { 39 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 40 | _ResultPageSize = value; 41 | } 42 | } 43 | 44 | private int? _ServerTimeLimit; 45 | public int? ServerTimeLimit 46 | { 47 | get { return _ServerTimeLimit; } 48 | set 49 | { 50 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 51 | _ServerTimeLimit = value; 52 | } 53 | } 54 | 55 | public bool Tombstone { get; set; } 56 | 57 | public NetworkCredential Credential { get; set; } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_InterestingDomainShareFile.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_InterestingDomainShareFile 13 | { 14 | public string[] ComputerName { get; set; } 15 | public string[] DNSHostName { get { return ComputerName; } set { ComputerName = value; } } 16 | 17 | public string ComputerDomain { get; set; } 18 | 19 | public string ComputerLDAPFilter { get; set; } 20 | 21 | public string ComputerSearchBase { get; set; } 22 | 23 | public string ComputerOperatingSystem { get; set; } 24 | public string OperatingSystem { get { return ComputerOperatingSystem; } set { ComputerOperatingSystem = value; } } 25 | 26 | public string ComputerServicePack { get; set; } 27 | public string ServicePack { get { return ComputerServicePack; } set { ComputerServicePack = value; } } 28 | 29 | public string ComputerSiteName { get; set; } 30 | public string SiteName { get { return ComputerSiteName; } set { ComputerSiteName = value; } } 31 | 32 | public string[] Include { get; set; } = { @"*password*", @"*sensitive*", @"*admin*", @"*login*", @"*secret*", @"unattend*.xml", @"*.vmdk", @"*creds*", @"*credential*", @"*.config" }; 33 | public string[] SearchTerms { get { return Include; } set { Include = value; } } 34 | public string[] Terms { get { return Include; } set { Include = value; } } 35 | 36 | public string[] SharePath { get; set; } 37 | public string[] Share { get { return SharePath; } set { SharePath = value; } } 38 | 39 | public string[] ExcludedShares { get; set; } = { @"C$", @"Admin$", @"Print$", @"IPC$" }; 40 | 41 | public DateTime? LastAccessTime { get; set; } 42 | 43 | public DateTime? LastWriteTime { get; set; } 44 | 45 | public DateTime? CreationTime { get; set; } 46 | 47 | public bool OfficeDocs { get; set; } 48 | 49 | public bool FreshEXEs { get; set; } 50 | 51 | public string Server { get; set; } 52 | public string DomainController { get { return Server; } set { Server = value; } } 53 | 54 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 55 | 56 | private int _ResultPageSize = 200; 57 | public int ResultPageSize 58 | { 59 | get { return _ResultPageSize; } 60 | set 61 | { 62 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 63 | _ResultPageSize = value; 64 | } 65 | } 66 | 67 | private int? _ServerTimeLimit; 68 | public int? ServerTimeLimit 69 | { 70 | get { return _ServerTimeLimit; } 71 | set 72 | { 73 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 74 | _ServerTimeLimit = value; 75 | } 76 | } 77 | 78 | public bool Tombstone { get; set; } 79 | 80 | public NetworkCredential Credential { get; set; } 81 | 82 | public bool StopOnSuccess { get; set; } 83 | 84 | private int _Delay = 0; 85 | public int Delay 86 | { 87 | get { return _Delay; } 88 | set 89 | { 90 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("Delay"); 91 | _Delay = value; 92 | } 93 | } 94 | 95 | private double _Jitter = 0.3; 96 | public double Jitter 97 | { 98 | get { return _Jitter; } 99 | set 100 | { 101 | if (value < 0.0 || value > 1.0) throw new ArgumentOutOfRangeException("Jitter"); 102 | _Jitter = value; 103 | } 104 | } 105 | 106 | private int _Threads = 20; 107 | public int Threads 108 | { 109 | get { return _Threads; } 110 | set 111 | { 112 | if (value < 1 || value > 100) throw new ArgumentOutOfRangeException("Threads"); 113 | _Threads = value; 114 | } 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_InterestingFile.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_InterestingFile 13 | { 14 | public string[] Path { get; set; } = { @".\" }; 15 | 16 | public string[] Include { get; set; } = { @"*password*", @"*sensitive*", @"*admin*", @"*login*", @"*secret*", @"unattend*.xml", @"*.vmdk", @"*creds*", @"*credential*", @"*.config" }; 17 | public string[] SearchTerms { get { return Include; } set { Include = value; } } 18 | public string[] Terms { get { return Include; } set { Include = value; } } 19 | 20 | public DateTime? LastAccessTime { get; set; } 21 | 22 | public DateTime? LastWriteTime { get; set; } 23 | 24 | public DateTime? CreationTime { get; set; } 25 | 26 | public bool OfficeDocs { get; set; } 27 | 28 | public bool FreshEXEs { get; set; } 29 | 30 | public bool ExcludeFolders { get; set; } 31 | 32 | public bool ExcludeHidden { get; set; } 33 | 34 | public bool CheckWriteAccess { get; set; } 35 | 36 | public NetworkCredential Credential { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Find_LocalAdminAccess.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Find_LocalAdminAccess 13 | { 14 | public string[] ComputerName { get; set; } 15 | public string[] DNSHostName { get { return ComputerName; } set { ComputerName = value; } } 16 | 17 | public string ComputerDomain { get; set; } 18 | 19 | public string ComputerLDAPFilter { get; set; } 20 | 21 | public string ComputerSearchBase { get; set; } 22 | 23 | public string ComputerOperatingSystem { get; set; } 24 | public string OperatingSystem { get { return ComputerOperatingSystem; } set { ComputerOperatingSystem = value; } } 25 | 26 | public string ComputerServicePack { get; set; } 27 | public string ServicePack { get { return ComputerServicePack; } set { ComputerServicePack = value; } } 28 | 29 | public string ComputerSiteName { get; set; } 30 | public string SiteName { get { return ComputerSiteName; } set { ComputerSiteName = value; } } 31 | 32 | public bool CheckShareAccess { get; set; } 33 | 34 | public string Server { get; set; } 35 | public string DomainController { get { return Server; } set { Server = value; } } 36 | 37 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 38 | 39 | private int _ResultPageSize = 200; 40 | public int ResultPageSize 41 | { 42 | get { return _ResultPageSize; } 43 | set 44 | { 45 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 46 | _ResultPageSize = value; 47 | } 48 | } 49 | 50 | private int? _ServerTimeLimit; 51 | public int? ServerTimeLimit 52 | { 53 | get { return _ServerTimeLimit; } 54 | set 55 | { 56 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 57 | _ServerTimeLimit = value; 58 | } 59 | } 60 | 61 | public bool Tombstone { get; set; } 62 | 63 | public NetworkCredential Credential { get; set; } 64 | 65 | private int _Delay = 0; 66 | public int Delay 67 | { 68 | get { return _Delay; } 69 | set 70 | { 71 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("Delay"); 72 | _Delay = value; 73 | } 74 | } 75 | 76 | private double _Jitter = 0.3; 77 | public double Jitter 78 | { 79 | get { return _Jitter; } 80 | set 81 | { 82 | if (value < 0.0 || value > 1.0) throw new ArgumentOutOfRangeException("Jitter"); 83 | _Jitter = value; 84 | } 85 | } 86 | 87 | private int _Threads = 20; 88 | public int Threads 89 | { 90 | get { return _Threads; } 91 | set 92 | { 93 | if (value < 1 || value > 100) throw new ArgumentOutOfRangeException("Threads"); 94 | _Threads = value; 95 | } 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_Domain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Arguments 9 | { 10 | public class Args_Get_Domain 11 | { 12 | public string Domain { get; set; } 13 | public NetworkCredential Credential { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainComputer.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainComputer 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 16 | 17 | public bool Unconstrained { get; set; } 18 | 19 | public bool TrustedToAuth { get; set; } 20 | 21 | public bool Printers { get; set; } 22 | 23 | public string SPN { get; set; } 24 | public string ServicePrincipalName { get { return SPN; } set { SPN = value; } } 25 | 26 | public string OperatingSystem { get; set; } 27 | 28 | public string ServicePack { get; set; } 29 | 30 | public string SiteName { get; set; } 31 | 32 | public bool Ping { get; set; } 33 | 34 | public string Domain { get; set; } 35 | 36 | public string LDAPFilter { get; set; } 37 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 38 | 39 | public string[] Properties { get; set; } 40 | 41 | public string SearchBase { get; set; } 42 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 43 | 44 | public string Server { get; set; } 45 | public string DomainController { get { return Server; } set { Server = value; } } 46 | 47 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 48 | 49 | private int _ResultPageSize = 200; 50 | public int ResultPageSize 51 | { 52 | get { return _ResultPageSize; } 53 | set 54 | { 55 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 56 | _ResultPageSize = value; 57 | } 58 | } 59 | 60 | private int? _ServerTimeLimit; 61 | public int? ServerTimeLimit 62 | { 63 | get { return _ServerTimeLimit; } 64 | set 65 | { 66 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 67 | _ServerTimeLimit = value; 68 | } 69 | } 70 | 71 | public SecurityMasks? SecurityMasks { get; set; } 72 | 73 | public bool Tombstone { get; set; } 74 | 75 | public bool FindOne { get; set; } 76 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 77 | 78 | public NetworkCredential Credential { get; set; } 79 | 80 | public bool Raw { get; set; } 81 | 82 | public UACEnum UACFilter { get; set; } 83 | 84 | public Args_Get_DomainComputer() 85 | { 86 | 87 | } 88 | 89 | public Args_Get_DomainComputer(Args_Get_DomainSearcher args) 90 | { 91 | Domain = args.Domain; 92 | LDAPFilter = args.LDAPFilter; 93 | Properties = args.Properties; 94 | SearchBase = args.SearchBase; 95 | Server = args.Server; 96 | SearchScope = args.SearchScope; 97 | ResultPageSize = args.ResultPageSize; 98 | ServerTimeLimit = args.ServerTimeLimit; 99 | SecurityMasks = args.SecurityMasks; 100 | Tombstone = args.Tombstone; 101 | Credential = args.Credential; 102 | } 103 | 104 | public Args_Get_DomainComputer(Args_Get_DomainObject args) 105 | { 106 | Identity = args.Identity; 107 | Domain = args.Domain; 108 | LDAPFilter = args.LDAPFilter; 109 | Properties = args.Properties; 110 | SearchBase = args.SearchBase; 111 | Server = args.Server; 112 | SearchScope = args.SearchScope; 113 | ResultPageSize = args.ResultPageSize; 114 | ServerTimeLimit = args.ServerTimeLimit; 115 | SecurityMasks = args.SecurityMasks; 116 | Tombstone = args.Tombstone; 117 | FindOne = args.FindOne; 118 | Credential = args.Credential; 119 | UACFilter = args.UACFilter; 120 | Raw = args.Raw; 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainController.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainController 13 | { 14 | public string Domain { get; set; } 15 | 16 | public string Server { get; set; } 17 | public string DomainController { get { return Server; } set { Server = value; } } 18 | 19 | public bool LDAP { get; set; } 20 | 21 | public NetworkCredential Credential { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainDFSShare.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainDFSShare 13 | { 14 | public string[] Domain { get; set; } 15 | public string[] DomainName { get { return Domain; } set { Domain = value; } } 16 | public string[] Name { get { return Domain; } set { Domain = value; } } 17 | 18 | public string SearchBase { get; set; } 19 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 20 | 21 | public string Server { get; set; } 22 | public string DomainController { get { return Server; } set { Server = value; } } 23 | 24 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 25 | 26 | private int _ResultPageSize = 200; 27 | public int ResultPageSize 28 | { 29 | get { return _ResultPageSize; } 30 | set 31 | { 32 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 33 | _ResultPageSize = value; 34 | } 35 | } 36 | 37 | private int? _ServerTimeLimit; 38 | public int? ServerTimeLimit 39 | { 40 | get { return _ServerTimeLimit; } 41 | set 42 | { 43 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 44 | _ServerTimeLimit = value; 45 | } 46 | } 47 | 48 | public bool Tombstone { get; set; } 49 | 50 | public NetworkCredential Credential { get; set; } 51 | 52 | public Enums.Version Version { get; set; } = Enums.Version.All; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainDNSRecord.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainDNSRecord 13 | { 14 | public string ZoneName { get; set; } 15 | 16 | public string Domain { get; set; } 17 | 18 | public string Server { get; set; } 19 | public string DomainController { get { return Server; } set { Server = value; } } 20 | 21 | public string[] Properties { get; set; } = new string[] { @"name", @"distinguishedname", @"dnsrecord", @"whencreated", @"whenchanged" }; 22 | 23 | private int _ResultPageSize = 200; 24 | public int ResultPageSize 25 | { 26 | get { return _ResultPageSize; } 27 | set 28 | { 29 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 30 | _ResultPageSize = value; 31 | } 32 | } 33 | 34 | private int? _ServerTimeLimit; 35 | public int? ServerTimeLimit 36 | { 37 | get { return _ServerTimeLimit; } 38 | set 39 | { 40 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 41 | _ServerTimeLimit = value; 42 | } 43 | } 44 | 45 | public bool FindOne { get; set; } 46 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 47 | 48 | public NetworkCredential Credential { get; set; } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainDNSZone.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainDNSZone 13 | { 14 | public string Domain { get; set; } 15 | 16 | public string Server { get; set; } 17 | public string DomainController { get { return Server; } set { Server = value; } } 18 | 19 | public string[] Properties { get; set; } 20 | 21 | private int _ResultPageSize = 200; 22 | public int ResultPageSize 23 | { 24 | get { return _ResultPageSize; } 25 | set 26 | { 27 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 28 | _ResultPageSize = value; 29 | } 30 | } 31 | 32 | private int? _ServerTimeLimit; 33 | public int? ServerTimeLimit 34 | { 35 | get { return _ServerTimeLimit; } 36 | set 37 | { 38 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 39 | _ServerTimeLimit = value; 40 | } 41 | } 42 | 43 | public bool FindOne { get; set; } 44 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 45 | 46 | public NetworkCredential Credential { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainFileServer.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainFileServer 13 | { 14 | public string[] Domain { get; set; } 15 | public string[] DomainName { get { return Domain; } set { Domain = value; } } 16 | public string[] Name { get { return Domain; } set { Domain = value; } } 17 | 18 | public string LDAPFilter { get; set; } 19 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 20 | 21 | public string SearchBase { get; set; } 22 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 23 | 24 | public string Server { get; set; } 25 | public string DomainController { get { return Server; } set { Server = value; } } 26 | 27 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 28 | 29 | private int _ResultPageSize = 200; 30 | public int ResultPageSize 31 | { 32 | get { return _ResultPageSize; } 33 | set 34 | { 35 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 36 | _ResultPageSize = value; 37 | } 38 | } 39 | 40 | private int? _ServerTimeLimit; 41 | public int? ServerTimeLimit 42 | { 43 | get { return _ServerTimeLimit; } 44 | set 45 | { 46 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 47 | _ServerTimeLimit = value; 48 | } 49 | } 50 | 51 | public bool Tombstone { get; set; } 52 | 53 | public NetworkCredential Credential { get; set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainForeignGroupMember.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainForeignGroupMember 13 | { 14 | public string Domain { get; set; } 15 | public string Name { get { return Domain; } set { Domain = value; } } 16 | 17 | public string LDAPFilter { get; set; } 18 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 19 | 20 | public string[] Properties { get; set; } 21 | 22 | public string SearchBase { get; set; } 23 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 24 | 25 | public string Server { get; set; } 26 | public string DomainController { get { return Server; } set { Server = value; } } 27 | 28 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 29 | 30 | private int _ResultPageSize = 200; 31 | public int ResultPageSize 32 | { 33 | get { return _ResultPageSize; } 34 | set 35 | { 36 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 37 | _ResultPageSize = value; 38 | } 39 | } 40 | 41 | private int? _ServerTimeLimit; 42 | public int? ServerTimeLimit 43 | { 44 | get { return _ServerTimeLimit; } 45 | set 46 | { 47 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 48 | _ServerTimeLimit = value; 49 | } 50 | } 51 | 52 | public SecurityMasks? SecurityMasks { get; set; } 53 | 54 | public bool Tombstone { get; set; } 55 | 56 | public NetworkCredential Credential { get; set; } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainForeignUser.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainForeignUser 13 | { 14 | public string Domain { get; set; } 15 | public string Name { get { return Domain; } set { Domain = value; } } 16 | 17 | public string LDAPFilter { get; set; } 18 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 19 | 20 | public string[] Properties { get; set; } 21 | 22 | public string SearchBase { get; set; } 23 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 24 | 25 | public string Server { get; set; } 26 | public string DomainController { get { return Server; } set { Server = value; } } 27 | 28 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 29 | 30 | private int _ResultPageSize = 200; 31 | public int ResultPageSize 32 | { 33 | get { return _ResultPageSize; } 34 | set 35 | { 36 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 37 | _ResultPageSize = value; 38 | } 39 | } 40 | 41 | private int? _ServerTimeLimit; 42 | public int? ServerTimeLimit 43 | { 44 | get { return _ServerTimeLimit; } 45 | set 46 | { 47 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 48 | _ServerTimeLimit = value; 49 | } 50 | } 51 | 52 | public SecurityMasks? SecurityMasks { get; set; } 53 | 54 | public bool Tombstone { get; set; } 55 | 56 | public NetworkCredential Credential { get; set; } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainGPO.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainGPO 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | 19 | public string ComputerIdentity { get; set; } 20 | public string ComputerName { get { return ComputerIdentity; } set { ComputerIdentity = value; } } 21 | 22 | public string UserIdentity { get; set; } 23 | public string UserName { get { return UserIdentity; } set { UserIdentity = value; } } 24 | 25 | public string Domain { get; set; } 26 | 27 | public string LDAPFilter { get; set; } 28 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 29 | 30 | public string[] Properties { get; set; } 31 | 32 | public string SearchBase { get; set; } 33 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 34 | 35 | public string Server { get; set; } 36 | public string DomainController { get { return Server; } set { Server = value; } } 37 | 38 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 39 | 40 | private int _ResultPageSize = 200; 41 | public int ResultPageSize 42 | { 43 | get { return _ResultPageSize; } 44 | set 45 | { 46 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 47 | _ResultPageSize = value; 48 | } 49 | } 50 | 51 | private int? _ServerTimeLimit; 52 | public int? ServerTimeLimit 53 | { 54 | get { return _ServerTimeLimit; } 55 | set 56 | { 57 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 58 | _ServerTimeLimit = value; 59 | } 60 | } 61 | 62 | public SecurityMasks? SecurityMasks { get; set; } 63 | 64 | public bool Tombstone { get; set; } 65 | 66 | public bool FindOne { get; set; } 67 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 68 | 69 | public NetworkCredential Credential { get; set; } 70 | 71 | public bool Raw { get; set; } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainGPOComputerLocalGroupMapping.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainGPOComputerLocalGroupMapping 13 | { 14 | public string ComputerIdentity { get; set; } 15 | public string ComputerName { get { return ComputerIdentity; } set { ComputerIdentity = value; } } 16 | public string Computer { get { return ComputerIdentity; } set { ComputerIdentity = value; } } 17 | public string DistinguishedName { get { return ComputerIdentity; } set { ComputerIdentity = value; } } 18 | public string SamAccountName { get { return ComputerIdentity; } set { ComputerIdentity = value; } } 19 | public string Name { get { return ComputerIdentity; } set { ComputerIdentity = value; } } 20 | 21 | public string OUIdentity { get; set; } 22 | public string OU { get { return OUIdentity; } set { OUIdentity = value; } } 23 | 24 | public LocalGroupType LocalGroup { get; set; } = LocalGroupType.Administrators; 25 | 26 | public string Domain { get; set; } 27 | 28 | public string SearchBase { get; set; } 29 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 30 | 31 | public string Server { get; set; } 32 | public string DomainController { get { return Server; } set { Server = value; } } 33 | 34 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 35 | 36 | private int _ResultPageSize = 200; 37 | public int ResultPageSize 38 | { 39 | get { return _ResultPageSize; } 40 | set 41 | { 42 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 43 | _ResultPageSize = value; 44 | } 45 | } 46 | 47 | private int? _ServerTimeLimit; 48 | public int? ServerTimeLimit 49 | { 50 | get { return _ServerTimeLimit; } 51 | set 52 | { 53 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 54 | _ServerTimeLimit = value; 55 | } 56 | } 57 | 58 | public bool Tombstone { get; set; } 59 | 60 | public NetworkCredential Credential { get; set; } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainGPOLocalGroup.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainGPOLocalGroup 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | 19 | public bool ResolveMembersToSIDs { get; set; } 20 | 21 | public string Domain { get; set; } 22 | 23 | public string LDAPFilter { get; set; } 24 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 25 | 26 | public string SearchBase { get; set; } 27 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 28 | 29 | public string Server { get; set; } 30 | public string DomainController { get { return Server; } set { Server = value; } } 31 | 32 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 33 | 34 | private int _ResultPageSize = 200; 35 | public int ResultPageSize 36 | { 37 | get { return _ResultPageSize; } 38 | set 39 | { 40 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 41 | _ResultPageSize = value; 42 | } 43 | } 44 | 45 | private int? _ServerTimeLimit; 46 | public int? ServerTimeLimit 47 | { 48 | get { return _ServerTimeLimit; } 49 | set 50 | { 51 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 52 | _ServerTimeLimit = value; 53 | } 54 | } 55 | 56 | public bool Tombstone { get; set; } 57 | 58 | public NetworkCredential Credential { get; set; } 59 | 60 | public Args_Get_DomainGPOLocalGroup() 61 | { 62 | 63 | } 64 | 65 | public Args_Get_DomainGPOLocalGroup(Args_Get_DomainObject args) 66 | { 67 | Identity = args.Identity; 68 | Domain = args.Domain; 69 | LDAPFilter = args.LDAPFilter; 70 | SearchBase = args.SearchBase; 71 | Server = args.Server; 72 | SearchScope = args.SearchScope; 73 | ResultPageSize = args.ResultPageSize; 74 | ServerTimeLimit = args.ServerTimeLimit; 75 | Tombstone = args.Tombstone; 76 | Credential = args.Credential; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainGPOUserLocalGroupMapping.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainGPOUserLocalGroupMapping 13 | { 14 | public string Identity { get; set; } 15 | public string DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string Name { get { return Identity; } set { Identity = value; } } 18 | 19 | public LocalGroupType LocalGroup { get; set; } = LocalGroupType.Administrators; 20 | 21 | public string Domain { get; set; } 22 | 23 | public string SearchBase { get; set; } 24 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 25 | 26 | public string Server { get; set; } 27 | public string DomainController { get { return Server; } set { Server = value; } } 28 | 29 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 30 | 31 | private int _ResultPageSize = 200; 32 | public int ResultPageSize 33 | { 34 | get { return _ResultPageSize; } 35 | set 36 | { 37 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 38 | _ResultPageSize = value; 39 | } 40 | } 41 | 42 | private int? _ServerTimeLimit; 43 | public int? ServerTimeLimit 44 | { 45 | get { return _ServerTimeLimit; } 46 | set 47 | { 48 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 49 | _ServerTimeLimit = value; 50 | } 51 | } 52 | 53 | public bool Tombstone { get; set; } 54 | 55 | public NetworkCredential Credential { get; set; } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainGUIDMap.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainGUIDMap 13 | { 14 | public string Domain { get; set; } 15 | 16 | public string LDAPFilter { get; set; } 17 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 18 | 19 | public string Server { get; set; } 20 | public string DomainController { get { return Server; } set { Server = value; } } 21 | 22 | private int _ResultPageSize = 200; 23 | public int ResultPageSize 24 | { 25 | get { return _ResultPageSize; } 26 | set 27 | { 28 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 29 | _ResultPageSize = value; 30 | } 31 | } 32 | 33 | private int? _ServerTimeLimit; 34 | public int? ServerTimeLimit 35 | { 36 | get { return _ServerTimeLimit; } 37 | set 38 | { 39 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 40 | _ServerTimeLimit = value; 41 | } 42 | } 43 | 44 | public NetworkCredential Credential { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainGroup.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainGroup 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | public string[] MemberDistinguishedName { get { return Identity; } set { Identity = value; } } 19 | public string[] MemberName { get { return Identity; } set { Identity = value; } } 20 | 21 | public string[] MemberIdentity { get; set; } 22 | public string[] UserName { get { return Identity; } set { Identity = value; } } 23 | 24 | public bool AdminCount { get; set; } 25 | 26 | public GroupScope? GroupScope { get; set; } 27 | public GroupScope? Scope { get { return GroupScope; } set { GroupScope = value; } } 28 | 29 | public GroupProperty? GroupProperty { get; set; } 30 | 31 | public string Domain { get; set; } 32 | 33 | public string LDAPFilter { get; set; } 34 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 35 | 36 | public string[] Properties { get; set; } 37 | 38 | public string SearchBase { get; set; } 39 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 40 | 41 | public string Server { get; set; } 42 | public string DomainController { get { return Server; } set { Server = value; } } 43 | 44 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 45 | 46 | private int _ResultPageSize = 200; 47 | public int ResultPageSize 48 | { 49 | get { return _ResultPageSize; } 50 | set 51 | { 52 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 53 | _ResultPageSize = value; 54 | } 55 | } 56 | 57 | private int? _ServerTimeLimit; 58 | public int? ServerTimeLimit 59 | { 60 | get { return _ServerTimeLimit; } 61 | set 62 | { 63 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 64 | _ServerTimeLimit = value; 65 | } 66 | } 67 | 68 | public SecurityMasks? SecurityMasks { get; set; } 69 | 70 | public bool Tombstone { get; set; } 71 | 72 | public bool FindOne { get; set; } 73 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 74 | 75 | public NetworkCredential Credential { get; set; } 76 | 77 | public bool Raw { get; set; } 78 | 79 | public Args_Get_DomainGroup() 80 | { 81 | 82 | } 83 | 84 | public Args_Get_DomainGroup(Args_Get_DomainObject args) 85 | { 86 | Identity = args.Identity; 87 | Domain = args.Domain; 88 | LDAPFilter = args.LDAPFilter; 89 | Properties = args.Properties; 90 | SearchBase = args.SearchBase; 91 | Server = args.Server; 92 | SearchScope = args.SearchScope; 93 | ResultPageSize = args.ResultPageSize; 94 | ServerTimeLimit = args.ServerTimeLimit; 95 | SecurityMasks = args.SecurityMasks; 96 | Tombstone = args.Tombstone; 97 | FindOne = args.FindOne; 98 | Credential = args.Credential; 99 | Raw = args.Raw; 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainGroupMember.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainGroupMember 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | public string[] MemberDistinguishedName { get { return Identity; } set { Identity = value; } } 19 | public string[] MemberName { get { return Identity; } set { Identity = value; } } 20 | 21 | public string Domain { get; set; } 22 | 23 | public bool Recurse { get; set; } 24 | 25 | public bool RecurseUsingMatchingRule { get; set; } 26 | 27 | public string LDAPFilter { get; set; } 28 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 29 | 30 | public string SearchBase { get; set; } 31 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 32 | 33 | public string Server { get; set; } 34 | public string DomainController { get { return Server; } set { Server = value; } } 35 | 36 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 37 | 38 | private int _ResultPageSize = 200; 39 | public int ResultPageSize 40 | { 41 | get { return _ResultPageSize; } 42 | set 43 | { 44 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 45 | _ResultPageSize = value; 46 | } 47 | } 48 | 49 | private int? _ServerTimeLimit; 50 | public int? ServerTimeLimit 51 | { 52 | get { return _ServerTimeLimit; } 53 | set 54 | { 55 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 56 | _ServerTimeLimit = value; 57 | } 58 | } 59 | 60 | public SecurityMasks? SecurityMasks { get; set; } 61 | 62 | public bool Tombstone { get; set; } 63 | 64 | public NetworkCredential Credential { get; set; } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainManagedSecurityGroup.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainManagedSecurityGroup 13 | { 14 | public string Domain { get; set; } 15 | public string Name { get { return Domain; } set { Domain = value; } } 16 | 17 | public string SearchBase { get; set; } 18 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 19 | 20 | public string Server { get; set; } 21 | public string DomainController { get { return Server; } set { Server = value; } } 22 | 23 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 24 | 25 | private int _ResultPageSize = 200; 26 | public int ResultPageSize 27 | { 28 | get { return _ResultPageSize; } 29 | set 30 | { 31 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 32 | _ResultPageSize = value; 33 | } 34 | } 35 | 36 | private int? _ServerTimeLimit; 37 | public int? ServerTimeLimit 38 | { 39 | get { return _ServerTimeLimit; } 40 | set 41 | { 42 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 43 | _ServerTimeLimit = value; 44 | } 45 | } 46 | 47 | public bool Tombstone { get; set; } 48 | 49 | public NetworkCredential Credential { get; set; } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainOU.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainOU 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] Name { get { return Identity; } set { Identity = value; } } 16 | 17 | public string GPLink { get; set; } 18 | public string GUID { get { return GPLink; } set { GPLink = value; } } 19 | 20 | public string Domain { get; set; } 21 | 22 | public string LDAPFilter { get; set; } 23 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 24 | 25 | public string[] Properties { get; set; } 26 | 27 | public string SearchBase { get; set; } 28 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 29 | 30 | public string Server { get; set; } 31 | public string DomainController { get { return Server; } set { Server = value; } } 32 | 33 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 34 | 35 | private int _ResultPageSize = 200; 36 | public int ResultPageSize 37 | { 38 | get { return _ResultPageSize; } 39 | set 40 | { 41 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 42 | _ResultPageSize = value; 43 | } 44 | } 45 | 46 | private int? _ServerTimeLimit; 47 | public int? ServerTimeLimit 48 | { 49 | get { return _ServerTimeLimit; } 50 | set 51 | { 52 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 53 | _ServerTimeLimit = value; 54 | } 55 | } 56 | 57 | public SecurityMasks? SecurityMasks { get; set; } 58 | 59 | public bool Tombstone { get; set; } 60 | 61 | public bool FindOne { get; set; } 62 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 63 | 64 | public NetworkCredential Credential { get; set; } 65 | 66 | public bool Raw { get; set; } 67 | 68 | public Args_Get_DomainOU() 69 | { 70 | 71 | } 72 | 73 | public Args_Get_DomainOU(Args_Get_DomainSearcher args) 74 | { 75 | Domain = args.Domain; 76 | LDAPFilter = args.LDAPFilter; 77 | Properties = args.Properties; 78 | SearchBase = args.SearchBase; 79 | Server = args.Server; 80 | SearchScope = args.SearchScope; 81 | ResultPageSize = args.ResultPageSize; 82 | ServerTimeLimit = args.ServerTimeLimit; 83 | SecurityMasks = args.SecurityMasks; 84 | Tombstone = args.Tombstone; 85 | Credential = args.Credential; 86 | } 87 | 88 | public Args_Get_DomainOU(Args_Get_DomainObject args) 89 | { 90 | Identity = args.Identity; 91 | Domain = args.Domain; 92 | LDAPFilter = args.LDAPFilter; 93 | Properties = args.Properties; 94 | SearchBase = args.SearchBase; 95 | Server = args.Server; 96 | SearchScope = args.SearchScope; 97 | ResultPageSize = args.ResultPageSize; 98 | ServerTimeLimit = args.ServerTimeLimit; 99 | SecurityMasks = args.SecurityMasks; 100 | Tombstone = args.Tombstone; 101 | Credential = args.Credential; 102 | Raw = args.Raw; 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainObject.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainObject 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | public string[] MemberDistinguishedName { get { return Identity; } set { Identity = value; } } 19 | public string[] MemberName { get { return Identity; } set { Identity = value; } } 20 | 21 | public string Domain { get; set; } 22 | 23 | public string LDAPFilter { get; set; } 24 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 25 | 26 | public string[] Properties { get; set; } 27 | 28 | public string SearchBase { get; set; } 29 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 30 | 31 | public string Server { get; set; } 32 | public string DomainController { get { return Server; } set { Server = value; } } 33 | 34 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 35 | 36 | private int _ResultPageSize = 200; 37 | public int ResultPageSize 38 | { 39 | get { return _ResultPageSize; } 40 | set 41 | { 42 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 43 | _ResultPageSize = value; 44 | } 45 | } 46 | 47 | private int? _ServerTimeLimit; 48 | public int? ServerTimeLimit 49 | { 50 | get { return _ServerTimeLimit; } 51 | set 52 | { 53 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 54 | _ServerTimeLimit = value; 55 | } 56 | } 57 | 58 | public SecurityMasks? SecurityMasks { get; set; } 59 | 60 | public bool Tombstone { get; set; } 61 | 62 | public bool FindOne { get; set; } 63 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 64 | 65 | public NetworkCredential Credential { get; set; } 66 | 67 | public bool Raw { get; set; } 68 | 69 | public UACEnum UACFilter { get; set; } 70 | 71 | public Args_Get_DomainObject() 72 | { 73 | 74 | } 75 | 76 | public Args_Get_DomainObject(Args_Get_DomainObject args) 77 | { 78 | Identity = args.Identity; 79 | Domain = args.Domain; 80 | LDAPFilter = args.LDAPFilter; 81 | Properties = args.Properties; 82 | SearchBase = args.SearchBase; 83 | Server = args.Server; 84 | SearchScope = args.SearchScope; 85 | ResultPageSize = args.ResultPageSize; 86 | ServerTimeLimit = args.ServerTimeLimit; 87 | SecurityMasks = args.SecurityMasks; 88 | Tombstone = args.Tombstone; 89 | FindOne = args.FindOne; 90 | Credential = args.Credential; 91 | Raw = args.Raw; 92 | UACFilter = args.UACFilter; 93 | } 94 | 95 | public Args_Get_DomainObject(Args_Get_DomainSearcher args) 96 | { 97 | Domain = args.Domain; 98 | LDAPFilter = args.LDAPFilter; 99 | Properties = args.Properties; 100 | SearchBase = args.SearchBase; 101 | Server = args.Server; 102 | SearchScope = args.SearchScope; 103 | ResultPageSize = args.ResultPageSize; 104 | ServerTimeLimit = args.ServerTimeLimit; 105 | SecurityMasks = args.SecurityMasks; 106 | Tombstone = args.Tombstone; 107 | Credential = args.Credential; 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainObjectAcl.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainObjectAcl 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | 19 | public bool Sacl { get; set; } 20 | 21 | public bool ResolveGUIDs { get; set; } 22 | 23 | public Rights? RightsFilter { get; set; } 24 | public Rights? Rights { get { return RightsFilter; } set { RightsFilter = value; } } 25 | 26 | public string Domain { get; set; } 27 | 28 | public string LDAPFilter { get; set; } 29 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 30 | 31 | public string SearchBase { get; set; } 32 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 33 | 34 | public string Server { get; set; } 35 | public string DomainController { get { return Server; } set { Server = value; } } 36 | 37 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 38 | 39 | private int _ResultPageSize = 200; 40 | public int ResultPageSize 41 | { 42 | get { return _ResultPageSize; } 43 | set 44 | { 45 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 46 | _ResultPageSize = value; 47 | } 48 | } 49 | 50 | private int? _ServerTimeLimit; 51 | public int? ServerTimeLimit 52 | { 53 | get { return _ServerTimeLimit; } 54 | set 55 | { 56 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 57 | _ServerTimeLimit = value; 58 | } 59 | } 60 | 61 | public SecurityMasks? SecurityMasks { get; set; } 62 | 63 | public bool Tombstone { get; set; } 64 | 65 | public NetworkCredential Credential { get; set; } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainPolicyData.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainPolicyData 13 | { 14 | public string Policy { get; set; } = @"Domain"; 15 | public string Source { get { return Policy; } set { Policy = value; } } 16 | public string Name { get { return Policy; } set { Policy = value; } } 17 | 18 | public string Domain { get; set; } 19 | 20 | public string Server { get; set; } 21 | public string DomainController { get { return Server; } set { Server = value; } } 22 | 23 | private int? _ServerTimeLimit; 24 | public int? ServerTimeLimit 25 | { 26 | get { return _ServerTimeLimit; } 27 | set 28 | { 29 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 30 | _ServerTimeLimit = value; 31 | } 32 | } 33 | 34 | public NetworkCredential Credential { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainSID.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainSID 13 | { 14 | public string Domain { get; set; } 15 | 16 | public string Server { get; set; } 17 | public string DomainController { get { return Server; } set { Server = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainSPNTicket.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using SharpView.Returns; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.DirectoryServices; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace SharpView.Arguments 12 | { 13 | public class Args_Get_DomainSPNTicket 14 | { 15 | public string[] SPN { get; set; } 16 | public string[] Name { get { return SPN; } set { SPN = value; } } 17 | public string[] ServicePrincipalName { get { return SPN; } set { SPN = value; } } 18 | 19 | public LDAPProperty User { get; set; } 20 | 21 | public SPNTicketFormat OutputFormat { get; set; } 22 | 23 | public NetworkCredential Credential { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainSearcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.DirectoryServices; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace SharpView.Arguments 10 | { 11 | public class Args_Get_DomainSearcher 12 | { 13 | public string Domain { get; set; } 14 | 15 | public string LDAPFilter { get; set; } 16 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 17 | 18 | public string[] Properties { get; set; } 19 | 20 | public string SearchBase { get; set; } 21 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 22 | 23 | public string SearchBasePrefix { get; set; } 24 | 25 | public string Server { get; set; } 26 | public string DomainController { get { return Server; } set { Server = value; } } 27 | 28 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 29 | 30 | private int _ResultPageSize = 200; 31 | public int ResultPageSize { 32 | get { return _ResultPageSize; } 33 | set { 34 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 35 | _ResultPageSize = value; 36 | } 37 | } 38 | 39 | private int? _ServerTimeLimit = 120; 40 | public int? ServerTimeLimit 41 | { 42 | get { return _ServerTimeLimit; } 43 | set 44 | { 45 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 46 | _ServerTimeLimit = value; 47 | } 48 | } 49 | 50 | public SecurityMasks? SecurityMasks { get; set; } 51 | 52 | public bool Tombstone { get; set; } 53 | 54 | public NetworkCredential Credential { get; set; } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainSite.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainSite 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] Name { get { return Identity; } set { Identity = value; } } 16 | 17 | public string GPLink { get; set; } 18 | public string GUID { get { return GPLink; } set { GPLink = value; } } 19 | 20 | public string Domain { get; set; } 21 | 22 | public string LDAPFilter { get; set; } 23 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 24 | 25 | public string[] Properties { get; set; } 26 | 27 | public string SearchBase { get; set; } 28 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 29 | 30 | public string Server { get; set; } 31 | public string DomainController { get { return Server; } set { Server = value; } } 32 | 33 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 34 | 35 | private int _ResultPageSize = 200; 36 | public int ResultPageSize 37 | { 38 | get { return _ResultPageSize; } 39 | set 40 | { 41 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 42 | _ResultPageSize = value; 43 | } 44 | } 45 | 46 | private int? _ServerTimeLimit; 47 | public int? ServerTimeLimit 48 | { 49 | get { return _ServerTimeLimit; } 50 | set 51 | { 52 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 53 | _ServerTimeLimit = value; 54 | } 55 | } 56 | 57 | public SecurityMasks? SecurityMasks { get; set; } 58 | 59 | public bool Tombstone { get; set; } 60 | 61 | public bool FindOne { get; set; } 62 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 63 | 64 | public NetworkCredential Credential { get; set; } 65 | 66 | public bool Raw { get; set; } 67 | 68 | public Args_Get_DomainSite() 69 | { 70 | 71 | } 72 | 73 | public Args_Get_DomainSite(Args_Get_DomainSearcher args) 74 | { 75 | Domain = args.Domain; 76 | LDAPFilter = args.LDAPFilter; 77 | Properties = args.Properties; 78 | SearchBase = args.SearchBase; 79 | Server = args.Server; 80 | SearchScope = args.SearchScope; 81 | ResultPageSize = args.ResultPageSize; 82 | ServerTimeLimit = args.ServerTimeLimit; 83 | SecurityMasks = args.SecurityMasks; 84 | Tombstone = args.Tombstone; 85 | Credential = args.Credential; 86 | } 87 | 88 | public Args_Get_DomainSite(Args_Get_DomainObject args) 89 | { 90 | Identity = args.Identity; 91 | Domain = args.Domain; 92 | LDAPFilter = args.LDAPFilter; 93 | Properties = args.Properties; 94 | SearchBase = args.SearchBase; 95 | Server = args.Server; 96 | SearchScope = args.SearchScope; 97 | ResultPageSize = args.ResultPageSize; 98 | ServerTimeLimit = args.ServerTimeLimit; 99 | SecurityMasks = args.SecurityMasks; 100 | Tombstone = args.Tombstone; 101 | FindOne = args.FindOne; 102 | Credential = args.Credential; 103 | Raw = args.Raw; 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainSubnet.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainSubnet 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] Name { get { return Identity; } set { Identity = value; } } 16 | 17 | public string SiteName { get; set; } 18 | 19 | public string Domain { get; set; } 20 | 21 | public string LDAPFilter { get; set; } 22 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 23 | 24 | public string[] Properties { get; set; } 25 | 26 | public string SearchBase { get; set; } 27 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 28 | 29 | public string Server { get; set; } 30 | public string DomainController { get { return Server; } set { Server = value; } } 31 | 32 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 33 | 34 | private int _ResultPageSize = 200; 35 | public int ResultPageSize 36 | { 37 | get { return _ResultPageSize; } 38 | set 39 | { 40 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 41 | _ResultPageSize = value; 42 | } 43 | } 44 | 45 | private int? _ServerTimeLimit; 46 | public int? ServerTimeLimit 47 | { 48 | get { return _ServerTimeLimit; } 49 | set 50 | { 51 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 52 | _ServerTimeLimit = value; 53 | } 54 | } 55 | 56 | public SecurityMasks? SecurityMasks { get; set; } 57 | 58 | public bool Tombstone { get; set; } 59 | 60 | public bool FindOne { get; set; } 61 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 62 | 63 | public NetworkCredential Credential { get; set; } 64 | 65 | public bool Raw { get; set; } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainTrust.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainTrust 13 | { 14 | public string Domain { get; set; } 15 | public string Name { get { return Domain; } set { Domain = value; } } 16 | 17 | public bool API { get; set; } 18 | 19 | public bool NET { get; set; } 20 | 21 | public string LDAPFilter { get; set; } 22 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 23 | 24 | public string[] Properties { get; set; } 25 | 26 | public string SearchBase { get; set; } 27 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 28 | 29 | public string Server { get; set; } 30 | public string DomainController { get { return Server; } set { Server = value; } } 31 | 32 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 33 | 34 | private int _ResultPageSize = 200; 35 | public int ResultPageSize 36 | { 37 | get { return _ResultPageSize; } 38 | set 39 | { 40 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 41 | _ResultPageSize = value; 42 | } 43 | } 44 | 45 | private int? _ServerTimeLimit; 46 | public int? ServerTimeLimit 47 | { 48 | get { return _ServerTimeLimit; } 49 | set 50 | { 51 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 52 | _ServerTimeLimit = value; 53 | } 54 | } 55 | 56 | public bool Tombstone { get; set; } 57 | 58 | public bool FindOne { get; set; } 59 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 60 | 61 | public NetworkCredential Credential { get; set; } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainTrustMapping.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainTrustMapping 13 | { 14 | public bool API { get; set; } 15 | 16 | public bool NET { get; set; } 17 | 18 | public string Forest { get; set; } 19 | 20 | public string LDAPFilter { get; set; } 21 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 22 | 23 | public string[] Properties { get; set; } 24 | 25 | public string SearchBase { get; set; } 26 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 27 | 28 | public string Server { get; set; } 29 | public string DomainController { get { return Server; } set { Server = value; } } 30 | 31 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 32 | 33 | private int _ResultPageSize = 200; 34 | public int ResultPageSize 35 | { 36 | get { return _ResultPageSize; } 37 | set 38 | { 39 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 40 | _ResultPageSize = value; 41 | } 42 | } 43 | 44 | private int? _ServerTimeLimit; 45 | public int? ServerTimeLimit 46 | { 47 | get { return _ServerTimeLimit; } 48 | set 49 | { 50 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 51 | _ServerTimeLimit = value; 52 | } 53 | } 54 | 55 | public bool Tombstone { get; set; } 56 | 57 | public NetworkCredential Credential { get; set; } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainUser.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainUser 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | public string[] MemberDistinguishedName { get { return Identity; } set { Identity = value; } } 19 | public string[] MemberName { get { return Identity; } set { Identity = value; } } 20 | 21 | public bool SPN { get; set; } 22 | 23 | public bool AdminCount { get; set; } 24 | 25 | public bool AllowDelegation { get; set; } 26 | 27 | public bool DisallowDelegation { get; set; } 28 | 29 | public bool TrustedToAuth { get; set; } 30 | 31 | public bool PreauthNotRequired { get; set; } 32 | public bool KerberosPreauthNotRequired { get { return PreauthNotRequired; } set { PreauthNotRequired = value; } } 33 | public bool NoPreauth { get { return PreauthNotRequired; } set { PreauthNotRequired = value; } } 34 | 35 | public string Domain { get; set; } 36 | 37 | public string LDAPFilter { get; set; } 38 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 39 | 40 | public string[] Properties { get; set; } 41 | 42 | public string SearchBase { get; set; } 43 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 44 | 45 | public string Server { get; set; } 46 | public string DomainController { get { return Server; } set { Server = value; } } 47 | 48 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 49 | 50 | private int _ResultPageSize = 200; 51 | public int ResultPageSize 52 | { 53 | get { return _ResultPageSize; } 54 | set 55 | { 56 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 57 | _ResultPageSize = value; 58 | } 59 | } 60 | 61 | private int? _ServerTimeLimit; 62 | public int? ServerTimeLimit 63 | { 64 | get { return _ServerTimeLimit; } 65 | set 66 | { 67 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 68 | _ServerTimeLimit = value; 69 | } 70 | } 71 | 72 | public SecurityMasks? SecurityMasks { get; set; } 73 | 74 | public bool Tombstone { get; set; } 75 | 76 | public bool FindOne { get; set; } 77 | public bool ReturnOne { get { return FindOne; } set { FindOne = value; } } 78 | 79 | public NetworkCredential Credential { get; set; } 80 | 81 | public bool Raw { get; set; } 82 | 83 | public UACEnum UACFilter { get; set; } 84 | 85 | public Args_Get_DomainUser() 86 | { 87 | 88 | } 89 | 90 | public Args_Get_DomainUser(Args_Get_DomainSearcher args) 91 | { 92 | Domain = args.Domain; 93 | LDAPFilter = args.LDAPFilter; 94 | Properties = args.Properties; 95 | SearchBase = args.SearchBase; 96 | Server = args.Server; 97 | SearchScope = args.SearchScope; 98 | ResultPageSize = args.ResultPageSize; 99 | ServerTimeLimit = args.ServerTimeLimit; 100 | SecurityMasks = args.SecurityMasks; 101 | Tombstone = args.Tombstone; 102 | Credential = args.Credential; 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_DomainUserEvent.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_DomainUserEvent 13 | { 14 | public string[] ComputerName { get; set; } = new[] { Environment.GetEnvironmentVariable("COMPUTERNAME") }; 15 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public DateTime StartTime { get; set; } = DateTime.Now.AddDays(-1); 20 | 21 | public DateTime EndTime { get; set; } = DateTime.Now; 22 | 23 | private int _MaxEvents = 5000; 24 | public int MaxEvents 25 | { 26 | get { return _MaxEvents; } 27 | set 28 | { 29 | if (value < 1 || value > 1000000) throw new ArgumentOutOfRangeException(nameof(MaxEvents)); 30 | _MaxEvents = value; 31 | } 32 | } 33 | 34 | public NetworkCredential Credential { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_Forest.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_Forest 13 | { 14 | public string Forest { get; set; } 15 | public string Name { get { return Forest; } set { Forest = value; } } 16 | 17 | public NetworkCredential Credential { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_ForestDomain.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_ForestDomain 13 | { 14 | public string Forest { get; set; } 15 | 16 | public NetworkCredential Credential { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_ForestGlobalCatalog.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_ForestGlobalCatalog 13 | { 14 | public string Forest { get; set; } 15 | 16 | public NetworkCredential Credential { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_GptTmpl.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_GptTmpl 13 | { 14 | public string GptTmplPath { get; set; } 15 | public string gpcfilesyspath { get { return GptTmplPath; } set { GptTmplPath = value; } } 16 | public string Path { get { return GptTmplPath; } set { GptTmplPath = value; } } 17 | 18 | public NetworkCredential Credential { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_GroupsXML.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_GroupsXML 13 | { 14 | public string GroupsXMLPath { get; set; } 15 | public string Path { get { return GroupsXMLPath; } set { GroupsXMLPath = value; } } 16 | 17 | public NetworkCredential Credential { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_IniContent.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using SharpView.Utils; 10 | 11 | namespace SharpView.Arguments 12 | { 13 | public class Args_Get_IniContent 14 | { 15 | public string[] Path { get; set; } 16 | public string[] FullName { get { return Path; } set { Path = value; } } 17 | public string[] Name { get { return Path; } set { Path = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_NetComputerSiteName.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_NetComputerSiteName 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_NetLocalGroup.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_NetLocalGroup 13 | { 14 | public string[] ComputerName { get; set; } = { Environment.GetEnvironmentVariable("COMPUTERNAME") }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public MethodType Method { get; set; } = MethodType.API; 20 | public MethodType CollectionMethod { get { return Method; } set { Method = value; } } 21 | 22 | public NetworkCredential Credential { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_NetLocalGroupMember.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_NetLocalGroupMember 13 | { 14 | public string[] ComputerName { get; set; } = { Environment.GetEnvironmentVariable("COMPUTERNAME") }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public string GroupName { get; set; } = "Administrators"; 20 | 21 | public MethodType Method { get; set; } = MethodType.API; 22 | public MethodType CollectionMethod { get { return Method; } set { Method = value; } } 23 | 24 | public NetworkCredential Credential { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_NetLoggedon.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_NetLoggedon 13 | { 14 | public string[] ComputerName { get; set; } = { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_NetRDPSession.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_NetRDPSession 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_NetSession.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_NetSession 13 | { 14 | public string[] ComputerName { get; set; } = { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_NetShare.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_NetShare 13 | { 14 | public string[] ComputerName { get; set; } = { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_PathAcl.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_PathAcl 13 | { 14 | public string[] Path { get; set; } 15 | public string[] FullName { get { return Path; } set { Path = value; } } 16 | 17 | public NetworkCredential Credential { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_PrincipalContext.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_PrincipalContext 13 | { 14 | public string Identity { get; set; } 15 | public string GroupName { get { return Identity; } set { Identity = value; } } 16 | public string GroupIdentity { get { return Identity; } set { Identity = value; } } 17 | 18 | public string Domain { get; set; } 19 | 20 | public NetworkCredential Credential { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_RegLoggedOn.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_RegLoggedOn 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_WMIProcess.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_WMIProcess 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_WMIRegCachedRDPConnection.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_WMIRegCachedRDPConnection 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_WMIRegLastLoggedOn.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_WMIRegLastLoggedOn 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_WMIRegMountedDrive.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_WMIRegMountedDrive 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Get_WMIRegProxy.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Get_WMIRegProxy 13 | { 14 | public string[] ComputerName { get; set; } = new[] { Environment.GetEnvironmentVariable("COMPUTERNAME") }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Invoke_Kerberoast.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Invoke_Kerberoast 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | public string[] MemberDistinguishedName { get { return Identity; } set { Identity = value; } } 19 | public string[] MemberName { get { return Identity; } set { Identity = value; } } 20 | 21 | public string Domain { get; set; } 22 | 23 | public string LDAPFilter { get; set; } 24 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 25 | 26 | public string SearchBase { get; set; } 27 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 28 | 29 | public string Server { get; set; } 30 | public string DomainController { get { return Server; } set { Server = value; } } 31 | 32 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 33 | 34 | private int _ResultPageSize = 200; 35 | public int ResultPageSize 36 | { 37 | get { return _ResultPageSize; } 38 | set 39 | { 40 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 41 | _ResultPageSize = value; 42 | } 43 | } 44 | 45 | private int? _ServerTimeLimit; 46 | public int? ServerTimeLimit 47 | { 48 | get { return _ServerTimeLimit; } 49 | set 50 | { 51 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 52 | _ServerTimeLimit = value; 53 | } 54 | } 55 | 56 | public bool Tombstone { get; set; } 57 | 58 | public NetworkCredential Credential { get; set; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Invoke_UserImpersonation.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Invoke_UserImpersonation 13 | { 14 | public NetworkCredential Credential { get; set; } 15 | 16 | public IntPtr TokenHandle { get; set; } 17 | 18 | public bool Quiet { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_New_DomainGroup.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_New_DomainGroup 13 | { 14 | public string SamAccountName { get; set; } 15 | 16 | public string Name { get; set; } 17 | 18 | public string DisplayName { get; set; } 19 | 20 | public string Description { get; set; } 21 | 22 | public string Domain { get; set; } 23 | 24 | public NetworkCredential Credential { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_New_DomainUser.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_New_DomainUser 13 | { 14 | public string SamAccountName { get; set; } 15 | 16 | public System.Security.SecureString AccountPassword { get; set; } 17 | public System.Security.SecureString Password { get { return AccountPassword; } set { AccountPassword = value; } } 18 | 19 | public string Name { get; set; } 20 | 21 | public string DisplayName { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public string Domain { get; set; } 26 | 27 | public NetworkCredential Credential { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Remove_DomainObjectAcl.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Remove_DomainObjectAcl 13 | { 14 | public string[] TargetIdentity { get; set; } 15 | public string[] DistinguishedName { get { return TargetIdentity; } set { TargetIdentity = value; } } 16 | public string[] SamAccountName { get { return TargetIdentity; } set { TargetIdentity = value; } } 17 | public string[] Name { get { return TargetIdentity; } set { TargetIdentity = value; } } 18 | 19 | public string TargetDomain { get; set; } 20 | 21 | public string TargetLDAPFilter { get; set; } 22 | public string Filter { get { return TargetLDAPFilter; } set { TargetLDAPFilter = value; } } 23 | 24 | public string TargetSearchBase { get; set; } 25 | 26 | public string[] PrincipalIdentity { get; set; } 27 | 28 | public string PrincipalDomain { get; set; } 29 | 30 | public string Server { get; set; } 31 | public string DomainController { get { return Server; } set { Server = value; } } 32 | 33 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 34 | 35 | private int _ResultPageSize = 200; 36 | public int ResultPageSize 37 | { 38 | get { return _ResultPageSize; } 39 | set 40 | { 41 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 42 | _ResultPageSize = value; 43 | } 44 | } 45 | 46 | private int? _ServerTimeLimit; 47 | public int? ServerTimeLimit 48 | { 49 | get { return _ServerTimeLimit; } 50 | set 51 | { 52 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 53 | _ServerTimeLimit = value; 54 | } 55 | } 56 | 57 | public bool Tombstone { get; set; } 58 | 59 | public NetworkCredential Credential { get; set; } 60 | 61 | public Rights? Rights { get; set; } = Enums.Rights.All; 62 | 63 | public Guid RightsGUID { get; set; } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Remove_RemoteConnection.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using SharpView.Utils; 10 | 11 | namespace SharpView.Arguments 12 | { 13 | public class Args_Remove_RemoteConnection 14 | { 15 | public string[] ComputerName { get; set; } 16 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 18 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 19 | 20 | public string[] _path; 21 | public string[] Path 22 | { 23 | get 24 | { 25 | return _path; 26 | } 27 | set 28 | { 29 | if (value != null) 30 | { 31 | foreach (var item in value) 32 | { 33 | if (!item.IsRegexMatch(@"\\\\.*\\.*")) 34 | throw new ArgumentException(@"Should be '\\\\.*\\.*' as pattern", nameof(Path)); 35 | } 36 | } 37 | _path = value; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Resolve_IPAddress.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Resolve_IPAddress 13 | { 14 | public string[] ComputerName { get; set; } = new[] { Environment.GetEnvironmentVariable("COMPUTERNAME") }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Set_DomainObject.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Set_DomainObject 13 | { 14 | public string[] Identity { get; set; } 15 | public string[] DistinguishedName { get { return Identity; } set { Identity = value; } } 16 | public string[] SamAccountName { get { return Identity; } set { Identity = value; } } 17 | public string[] Name { get { return Identity; } set { Identity = value; } } 18 | 19 | public Dictionary Set { get; set; } 20 | public Dictionary Replace { get { return Set; } set { Set = value; } } 21 | 22 | public Dictionary XOR { get; set; } 23 | 24 | public string[] Clear { get; set; } 25 | 26 | public string Domain { get; set; } 27 | 28 | public string LDAPFilter { get; set; } 29 | public string Filter { get { return LDAPFilter; } set { LDAPFilter = value; } } 30 | 31 | public string SearchBase { get; set; } 32 | public string ADSPath { get { return SearchBase; } set { SearchBase = value; } } 33 | 34 | public string Server { get; set; } 35 | public string DomainController { get { return Server; } set { Server = value; } } 36 | 37 | public SearchScope SearchScope { get; set; } = SearchScope.Subtree; 38 | 39 | private int _ResultPageSize = 200; 40 | public int ResultPageSize 41 | { 42 | get { return _ResultPageSize; } 43 | set 44 | { 45 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ResultPageSize"); 46 | _ResultPageSize = value; 47 | } 48 | } 49 | 50 | private int? _ServerTimeLimit; 51 | public int? ServerTimeLimit 52 | { 53 | get { return _ServerTimeLimit; } 54 | set 55 | { 56 | if (value < 1 || value > 10000) throw new ArgumentOutOfRangeException("ServerTimeLimit"); 57 | _ServerTimeLimit = value; 58 | } 59 | } 60 | 61 | public bool Tombstone { get; set; } 62 | 63 | public NetworkCredential Credential { get; set; } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Set_DomainUserPassword.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Set_DomainUserPassword 13 | { 14 | public string Identity { get; set; } 15 | public string UserName { get { return Identity; } set { Identity = value; } } 16 | public string UserIdentity { get { return Identity; } set { Identity = value; } } 17 | public string User { get { return Identity; } set { Identity = value; } } 18 | 19 | public System.Security.SecureString AccountPassword { get; set; } 20 | public System.Security.SecureString Password { get { return AccountPassword; } set { AccountPassword = value; } } 21 | 22 | public string Domain { get; set; } 23 | 24 | public NetworkCredential Credential { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Test.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Arguments 9 | { 10 | 11 | public class Args_Test 12 | { 13 | public bool TestBool { get; set; } 14 | public string TestString { get; set; } 15 | public string[] TestStringArray { get; set; } 16 | public GroupType TestIntEnum { get; set; } 17 | public Rights TestEnum { get; set; } 18 | public Rights? TestPointEnum { get; set; } 19 | public System.Net.NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Arguments/Args_Test_AdminAccess.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Arguments 11 | { 12 | public class Args_Test_AdminAccess 13 | { 14 | public string[] ComputerName { get; set; } = new[] { "localhost" }; 15 | public string[] HostName { get { return ComputerName; } set { ComputerName = value; } } 16 | public string[] dnshostname { get { return ComputerName; } set { ComputerName = value; } } 17 | public string[] name { get { return ComputerName; } set { ComputerName = value; } } 18 | 19 | public NetworkCredential Credential { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Enums/ADSNameType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum ADSNameType 10 | { 11 | DN = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_1779, // CN=Phineas Flynn,OU=Engineers,DC=fabrikam,DC=com 12 | Canonical = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_CANONICAL, // fabrikam.com/Engineers/Phineas Flynn 13 | NT4 = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_NT4, // fabrikam\pflynn 14 | Display = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_DISPLAY, // pflynn 15 | DomainSimple = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_DOMAIN_SIMPLE, // pflynn@fabrikam.com 16 | EnterpriseSimple = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_ENTERPRISE_SIMPLE, // pflynn@fabrikam.com 17 | GUID = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_GUID, // {95ee9fff-3436-11d1-b2b0-d15ae3ac8436} 18 | Unknown = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_UNKNOWN, // unknown type - let the server do translation 19 | UPN = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_USER_PRINCIPAL_NAME, // pflynn@fabrikam.com 20 | CanonicalEx = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_CANONICAL_EX, // fabrikam.com/Users/Phineas Flynn 21 | SPN = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_SERVICE_PRINCIPAL_NAME, // HTTP/kairomac.contoso.com 22 | SID = ActiveDs.ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_SID_OR_SID_HISTORY_NAME // S-1-5-21-12986231-600641547-709122288-57999 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SharpView/Enums/ClassType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum ClassType 10 | { 11 | User, 12 | Group, 13 | Computer 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Enums/DnsRecordType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum DnsRecordType 10 | { 11 | A, 12 | NS, 13 | MD, 14 | MF, 15 | CNAME, 16 | SOA, 17 | MB, 18 | MG, 19 | MR, 20 | NULL, 21 | WKS, 22 | PTR, 23 | HINFO, 24 | MINFO, 25 | MX, 26 | TXT, 27 | RP, 28 | AFSDB, 29 | X25, 30 | ISDN, 31 | RT, 32 | NSAP, 33 | NSAPPTR, 34 | SIG, 35 | KEY, 36 | PX, 37 | GPOS, 38 | AAAA, 39 | LOC, 40 | NXT, 41 | EID, 42 | NIMLOC, 43 | SRV, 44 | ATMA, 45 | NAPTR, 46 | KX, 47 | CERT, 48 | A6, 49 | DNAME, 50 | SINK, 51 | OPT, 52 | APL, 53 | DS, 54 | SSHFP, 55 | IPSECKEY, 56 | RRSIG, 57 | NSEC, 58 | DNSKEY, 59 | DHCID, 60 | NSEC3, 61 | NSEC3PARAM, 62 | HIP, 63 | SPF, 64 | UINFO, 65 | UID, 66 | GID, 67 | UNSPEC, 68 | ANY, 69 | TA, 70 | DLV, 71 | UNKNOWN 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /SharpView/Enums/GroupProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum GroupProperty 10 | { 11 | Security, 12 | Distribution, 13 | CreatedBySystem, 14 | NotCreatedBySystem 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SharpView/Enums/GroupScope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum GroupScope 10 | { 11 | DomainLocal, 12 | NotDomainLocal, 13 | Global, 14 | NotGlobal, 15 | Universal, 16 | NotUniversal 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SharpView/Enums/GroupType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | [Flags] 10 | public enum GroupType : Int32 11 | { 12 | CREATED_BY_SYSTEM = 0x00000001, 13 | GLOBAL_SCOPE = ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_GLOBAL_GROUP, 14 | DOMAIN_LOCAL_SCOPE = ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP, 15 | UNIVERSAL_SCOPE = ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_UNIVERSAL_GROUP, 16 | APP_BASIC = 0x00000010, 17 | APP_QUERY = 0x00000020, 18 | SECURITY = ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_SECURITY_ENABLED 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SharpView/Enums/LocalGroupType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Enums 9 | { 10 | public enum LocalGroupType 11 | { 12 | [Description("Administrators")] 13 | Administrators, 14 | [Description("S-1-5-32-544")] 15 | S_1_5_32_544, 16 | [Description("RDP")] 17 | RDP, 18 | [Description("Remote Desktop Users")] 19 | RemoteDesktopUsers, 20 | [Description("S-1-5-32-555")] 21 | S_1_5_32_555 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SharpView/Enums/LogonType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum LogonType 10 | { 11 | /// 12 | /// This logon type is intended for users who will be interactively using the computer, such as a user being logged on 13 | /// by a terminal server, remote shell, or similar process. 14 | /// This logon type has the additional expense of caching logon information for disconnected operations; 15 | /// therefore, it is inappropriate for some client/server applications, 16 | /// such as a mail server. 17 | /// 18 | LOGON32_LOGON_INTERACTIVE = 2, 19 | 20 | /// 21 | /// This logon type is intended for high performance servers to authenticate plaintext passwords. 22 | 23 | /// The LogonUser function does not cache credentials for this logon type. 24 | /// 25 | LOGON32_LOGON_NETWORK = 3, 26 | 27 | /// 28 | /// This logon type is intended for batch servers, where processes may be executing on behalf of a user without 29 | /// their direct intervention. This type is also for higher performance servers that process many plaintext 30 | /// authentication attempts at a time, such as mail or Web servers. 31 | /// The LogonUser function does not cache credentials for this logon type. 32 | /// 33 | LOGON32_LOGON_BATCH = 4, 34 | 35 | /// 36 | /// Indicates a service-type logon. The account provided must have the service privilege enabled. 37 | /// 38 | LOGON32_LOGON_SERVICE = 5, 39 | 40 | /// 41 | /// This logon type is for GINA DLLs that log on users who will be interactively using the computer. 42 | /// This logon type can generate a unique audit record that shows when the workstation was unlocked. 43 | /// 44 | LOGON32_LOGON_UNLOCK = 7, 45 | 46 | /// 47 | /// This logon type preserves the name and password in the authentication package, which allows the server to make 48 | /// connections to other network servers while impersonating the client. A server can accept plaintext credentials 49 | /// from a client, call LogonUser, verify that the user can access the system across the network, and still 50 | /// communicate with other servers. 51 | /// NOTE: Windows NT: This value is not supported. 52 | /// 53 | LOGON32_LOGON_NETWORK_CLEARTEXT = 8, 54 | 55 | /// 56 | /// This logon type allows the caller to clone its current token and specify new credentials for outbound connections. 57 | /// The new logon session has the same local identifier but uses different credentials for other network connections. 58 | /// NOTE: This logon type is supported only by the LOGON32_PROVIDER_WINNT50 logon provider. 59 | /// NOTE: Windows NT: This value is not supported. 60 | /// 61 | LOGON32_LOGON_NEW_CREDENTIALS = 9, 62 | } 63 | 64 | public enum LogonProvider 65 | { 66 | /// 67 | /// Use the standard logon provider for the system. 68 | /// The default security provider is negotiate, unless you pass NULL for the domain name and the user name 69 | /// is not in UPN format. In this case, the default provider is NTLM. 70 | /// NOTE: Windows 2000/NT: The default security provider is NTLM. 71 | /// 72 | LOGON32_PROVIDER_DEFAULT = 0, 73 | LOGON32_PROVIDER_WINNT35 = 1, 74 | LOGON32_PROVIDER_WINNT40 = 2, 75 | LOGON32_PROVIDER_WINNT50 = 3 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /SharpView/Enums/ManagerType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum ManagerType 10 | { 11 | Group, 12 | User 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SharpView/Enums/MethodType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum MethodType 10 | { 11 | API, 12 | WinNT 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SharpView/Enums/Rights.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum Rights 10 | { 11 | All, 12 | ResetPassword, 13 | WriteMembers, 14 | DCSync 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SharpView/Enums/SPNTicketFormat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum SPNTicketFormat 10 | { 11 | John, 12 | Hashcat 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SharpView/Enums/SamAccountType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum SamAccountType : Int32 10 | { 11 | DOMAIN_OBJECT = 0x00000000, 12 | GROUP_OBJECT = 0x10000000, 13 | NON_SECURITY_GROUP_OBJECT = 0x10000001, 14 | ALIAS_OBJECT = 0x20000000, 15 | NON_SECURITY_ALIAS_OBJECT = 0x20000001, 16 | USER_OBJECT = 0x30000000, 17 | MACHINE_ACCOUNT = 0x30000001, 18 | TRUST_ACCOUNT = 0x30000002, 19 | APP_BASIC_GROUP = 0x40000000, 20 | APP_QUERY_GROUP = 0x40000001, 21 | ACCOUNT_TYPE_MAX = 0x7fffffff 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SharpView/Enums/StealthSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum StealthSource 10 | { 11 | DFS, 12 | DC, 13 | File, 14 | All 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SharpView/Enums/TrustAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | [Flags] 10 | public enum TrustAttribute : UInt32 11 | { 12 | NON_TRANSITIVE = 0x00000001, 13 | UPLEVEL_ONLY = 0x00000002, 14 | FILTER_SIDS = 0x00000004, 15 | FOREST_TRANSITIVE = 0x00000008, 16 | CROSS_ORGANIZATION= 0x00000010, 17 | WITHIN_FOREST= 0x00000020, 18 | TREAT_AS_EXTERNAL= 0x00000040, 19 | TRUST_USES_RC4_ENCRYPTION= 0x00000080, 20 | TRUST_USES_AES_KEYS= 0x00000100, 21 | CROSS_ORGANIZATION_NO_TGT_DELEGATION = 0x00000200, 22 | PIM_TRUST= 0x00000400 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SharpView/Enums/UACEnum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | [Flags] 10 | public enum UACEnum : UInt64 11 | { 12 | SCRIPT = 1, 13 | NOT_SCRIPT = SCRIPT * 2, 14 | ACCOUNTDISABLE = NOT_SCRIPT * 2, 15 | NOT_ACCOUNTDISABLE = ACCOUNTDISABLE * 2, 16 | HOMEDIR_REQUIRED = NOT_ACCOUNTDISABLE * 2, 17 | NOT_HOMEDIR_REQUIRED = HOMEDIR_REQUIRED * 2, 18 | LOCKOUT = NOT_HOMEDIR_REQUIRED * 2, 19 | NOT_LOCKOUT = LOCKOUT * 2, 20 | PASSWD_NOTREQD = NOT_LOCKOUT * 2, 21 | NOT_PASSWD_NOTREQD = PASSWD_NOTREQD * 2, 22 | PASSWD_CANT_CHANGE = NOT_PASSWD_NOTREQD * 2, 23 | NOT_PASSWD_CANT_CHANGE = PASSWD_CANT_CHANGE * 2, 24 | ENCRYPTED_TEXT_PWD_ALLOWED = NOT_PASSWD_CANT_CHANGE * 2, 25 | NOT_ENCRYPTED_TEXT_PWD_ALLOWED = ENCRYPTED_TEXT_PWD_ALLOWED * 2, 26 | TEMP_DUPLICATE_ACCOUNT = NOT_ENCRYPTED_TEXT_PWD_ALLOWED * 2, 27 | NOT_TEMP_DUPLICATE_ACCOUNT = TEMP_DUPLICATE_ACCOUNT * 2, 28 | NORMAL_ACCOUNT = NOT_TEMP_DUPLICATE_ACCOUNT * 2, 29 | NOT_NORMAL_ACCOUNT = NORMAL_ACCOUNT * 2, 30 | INTERDOMAIN_TRUST_ACCOUNT = NOT_NORMAL_ACCOUNT * 2, 31 | NOT_INTERDOMAIN_TRUST_ACCOUNT = INTERDOMAIN_TRUST_ACCOUNT * 2, 32 | WORKSTATION_TRUST_ACCOUNT = NOT_INTERDOMAIN_TRUST_ACCOUNT * 2, 33 | NOT_WORKSTATION_TRUST_ACCOUNT = WORKSTATION_TRUST_ACCOUNT * 2, 34 | SERVER_TRUST_ACCOUNT = NOT_WORKSTATION_TRUST_ACCOUNT * 2, 35 | NOT_SERVER_TRUST_ACCOUNT = SERVER_TRUST_ACCOUNT * 2, 36 | DONT_EXPIRE_PASSWORD = NOT_SERVER_TRUST_ACCOUNT * 2, 37 | NOT_DONT_EXPIRE_PASSWORD = DONT_EXPIRE_PASSWORD * 2, 38 | MNS_LOGON_ACCOUNT = NOT_DONT_EXPIRE_PASSWORD * 2, 39 | NOT_MNS_LOGON_ACCOUNT = MNS_LOGON_ACCOUNT * 2, 40 | SMARTCARD_REQUIRED = NOT_MNS_LOGON_ACCOUNT * 2, 41 | NOT_SMARTCARD_REQUIRED = SMARTCARD_REQUIRED * 2, 42 | TRUSTED_FOR_DELEGATION = NOT_SMARTCARD_REQUIRED * 2, 43 | NOT_TRUSTED_FOR_DELEGATION = TRUSTED_FOR_DELEGATION * 2, 44 | NOT_DELEGATED = NOT_TRUSTED_FOR_DELEGATION * 2, 45 | NOT_NOT_DELEGATED = NOT_DELEGATED * 2, 46 | USE_DES_KEY_ONLY = NOT_NOT_DELEGATED * 2, 47 | NOT_USE_DES_KEY_ONLY = USE_DES_KEY_ONLY * 2, 48 | DONT_REQ_PREAUTH = NOT_USE_DES_KEY_ONLY * 2, 49 | NOT_DONT_REQ_PREAUTH = DONT_REQ_PREAUTH * 2, 50 | PASSWORD_EXPIRED = NOT_DONT_REQ_PREAUTH * 2, 51 | NOT_PASSWORD_EXPIRED = PASSWORD_EXPIRED * 2, 52 | TRUSTED_TO_AUTH_FOR_DELEGATION = NOT_PASSWORD_EXPIRED * 2, 53 | NOT_TRUSTED_TO_AUTH_FOR_DELEGATION = TRUSTED_TO_AUTH_FOR_DELEGATION * 2, 54 | PARTIAL_SECRETS_ACCOUNT = NOT_TRUSTED_TO_AUTH_FOR_DELEGATION * 2, 55 | NOT_PARTIAL_SECRETS_ACCOUNT = PARTIAL_SECRETS_ACCOUNT * 2 56 | } 57 | 58 | [Flags] 59 | public enum UACEnumValue : Int32 60 | { 61 | SCRIPT = 1, 62 | ACCOUNTDISABLE = 2, 63 | HOMEDIR_REQUIRED = 8, 64 | LOCKOUT = 16, 65 | PASSWD_NOTREQD = 32, 66 | PASSWD_CANT_CHANGE = 64, 67 | ENCRYPTED_TEXT_PWD_ALLOWED = 128, 68 | TEMP_DUPLICATE_ACCOUNT = 256, 69 | NORMAL_ACCOUNT = 512, 70 | INTERDOMAIN_TRUST_ACCOUNT = 2048, 71 | WORKSTATION_TRUST_ACCOUNT = 4096, 72 | SERVER_TRUST_ACCOUNT = 8192, 73 | DONT_EXPIRE_PASSWORD = 65536, 74 | MNS_LOGON_ACCOUNT = 131072, 75 | SMARTCARD_REQUIRED = 262144, 76 | TRUSTED_FOR_DELEGATION = 524288, 77 | NOT_DELEGATED = 1048576, 78 | USE_DES_KEY_ONLY = 2097152, 79 | DONT_REQ_PREAUTH = 4194304, 80 | PASSWORD_EXPIRED = 8388608, 81 | TRUSTED_TO_AUTH_FOR_DELEGATION = 16777216, 82 | PARTIAL_SECRETS_ACCOUNT = 67108864 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /SharpView/Enums/Version.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Enums 8 | { 9 | public enum Version 10 | { 11 | All, 12 | V1, 13 | V2 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /SharpView/Interfaces/IDomainTrust.cs: -------------------------------------------------------------------------------- 1 | namespace SharpView.Interfaces 2 | { 3 | public interface IDomainTrust 4 | { 5 | string SourceName { get; set; } 6 | string TargetName { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SharpView/Interfaces/IWinEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SharpView.Interfaces 4 | { 5 | public interface IWinEvent 6 | { 7 | string ComputerName { get; set; } 8 | 9 | DateTime? TimeCreated { get; set; } 10 | 11 | int EventId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SharpView/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SharpView")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SharpView")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("22a156ea-2623-45c7-8e50-e864d9fc44d3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SharpView/Returns/ACL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.AccessControl; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class ACL : ResolvedSID 11 | { 12 | public string ObjectDN { get; set; } 13 | 14 | public GenericAce Ace { get; set; } 15 | 16 | public string ObjectSID { get; set; } 17 | 18 | public System.DirectoryServices.ActiveDirectoryRights ActiveDirectoryRights { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SharpView/Returns/AdminAccess.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class AdminAccess 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public bool IsAdmin { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Returns/ApiDomainTrust.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Interfaces; 2 | using SharpView.Utils; 3 | using System; 4 | 5 | namespace SharpView.Returns 6 | { 7 | public class ApiDomainTrust : IDomainTrust 8 | { 9 | public string SourceName { get; set; } 10 | 11 | public string TargetName { get; set; } 12 | 13 | public string TargetNetbiosName { get; set; } 14 | 15 | public uint Flags { get; set; } 16 | 17 | public uint ParentIndex { get; set; } 18 | 19 | public NativeMethods.DS_DOMAIN_TRUST_TYPE TrustType { get; set; } 20 | 21 | public uint TrustAttributes { get; set; } 22 | 23 | public string TargetSid { get; set; } 24 | 25 | public Guid TargetGuid { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SharpView/Returns/CachedRDPConnection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class CachedRDPConnection 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public string UserName { get; set; } 14 | 15 | public string UserSID { get; set; } 16 | 17 | public string TargetServer { get; set; } 18 | 19 | public string UsernameHint { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Returns/ComputerIPAddress.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class ComputerIPAddress 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public string IPAddress { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Returns/ComputerSite.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class ComputerSite 10 | { 11 | public string ComputerName { get; set; } 12 | public string IPAddress { get; set; } 13 | public string SiteName { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Returns/DFSShare.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.AccessControl; 5 | using System.Security.Principal; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace SharpView.Returns 10 | { 11 | public class DFSShare 12 | { 13 | public string Name { get; set; } 14 | 15 | public string RemoteServerName { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SharpView/Returns/DNSRecord.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class DNSRecord 13 | { 14 | public DnsRecordType? RecordType { get; set; } 15 | 16 | public uint? UpdatedAtSerial { get; set; } 17 | 18 | public uint? TTL { get; set; } 19 | 20 | public uint? Age { get; set; } 21 | 22 | public object TimeStamp { get; set; } // DateTime or string ("[static]") 23 | 24 | public string Data { get; set; } 25 | 26 | public string ZoneName { get; set; } 27 | 28 | public string name { get; set; } 29 | 30 | public string distinguishedname { get; set; } 31 | 32 | public object dnsrecord { get; set; } 33 | 34 | public DateTime? whencreated { get; set; } 35 | 36 | public DateTime? whenchanged { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SharpView/Returns/DNSZone.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class DNSZone 13 | { 14 | public string adspath { get; set; } 15 | 16 | public string[] objectsid { get; set; } 17 | 18 | public string[] sidhistory { get; set; } 19 | 20 | public GroupType? grouptype { get; set; } 21 | 22 | public SamAccountType? samaccounttype { get; set; } 23 | 24 | public string objectguid { get; set; } 25 | 26 | public Enums.UACEnumValue? useraccountcontrol { get; set; } 27 | 28 | public SecurityIdentifier Owner { get; set; } 29 | 30 | public SecurityIdentifier Group { get; set; } 31 | 32 | public RawAcl DiscretionaryAcl { get; set; } 33 | 34 | public RawAcl SystemAcl { get; set; } 35 | 36 | public object accountexpires { get; set; } // DateTime or string ("NEVER") 37 | 38 | public DateTime? lastlogon { get; set; } 39 | 40 | public DateTime? lastlogontimestamp { get; set; } 41 | 42 | public DateTime? pwdlastset { get; set; } 43 | 44 | public DateTime? lastlogoff { get; set; } 45 | 46 | public DateTime? badPasswordTime { get; set; } 47 | 48 | public string name { get; set; } 49 | 50 | public string distinguishedname { get; set; } 51 | 52 | public object dnsrecord { get; set; } 53 | 54 | public DateTime? whencreated { get; set; } 55 | 56 | public DateTime? whenchanged { get; set; } 57 | 58 | public string ZoneName { get; set; } 59 | 60 | public string samaccountname { get; set; } 61 | 62 | public string[] member { get; set; } 63 | 64 | public string[] memberof { get; set; } 65 | 66 | public string[] cn { get; set; } 67 | 68 | public string[] objectclass { get; set; } 69 | 70 | public string managedby { get; set; } 71 | 72 | public string siteobject { get; set; } 73 | 74 | public string ServicePrincipalName { get; set; } 75 | 76 | public string dnshostname { get; set; } 77 | 78 | public string gplink { get; set; } 79 | 80 | public Dictionary others { get; set; } = new Dictionary(); 81 | 82 | public DNSZone(LDAPProperty ldapProperty) 83 | { 84 | if (ldapProperty == null) return; 85 | 86 | adspath = ldapProperty.adspath; 87 | objectsid = ldapProperty.objectsid; 88 | sidhistory = ldapProperty.sidhistory; 89 | grouptype = ldapProperty.grouptype; 90 | samaccounttype = ldapProperty.samaccounttype; 91 | objectguid = ldapProperty.objectguid; 92 | useraccountcontrol = ldapProperty.useraccountcontrol; 93 | Owner = ldapProperty.Owner; 94 | Group = ldapProperty.Group; 95 | DiscretionaryAcl = ldapProperty.DiscretionaryAcl; 96 | SystemAcl = ldapProperty.SystemAcl; 97 | accountexpires = ldapProperty.accountexpires; 98 | lastlogon = ldapProperty.lastlogon; 99 | lastlogontimestamp = ldapProperty.lastlogontimestamp; 100 | pwdlastset = ldapProperty.pwdlastset; 101 | lastlogoff = ldapProperty.lastlogoff; 102 | badPasswordTime = ldapProperty.badPasswordTime; 103 | name = ldapProperty.name; 104 | distinguishedname = ldapProperty.distinguishedname; 105 | dnsrecord = ldapProperty.dnsrecord; 106 | whencreated = ldapProperty.whencreated; 107 | whenchanged = ldapProperty.whenchanged; 108 | samaccountname = ldapProperty.samaccountname; 109 | member = ldapProperty.member; 110 | memberof = ldapProperty.memberof; 111 | cn = ldapProperty.cn; 112 | objectclass = ldapProperty.objectclass; 113 | ZoneName = ldapProperty.name; 114 | managedby = ldapProperty.managedby; 115 | siteobject = ldapProperty.siteobject; 116 | ServicePrincipalName = ldapProperty.siteobject; 117 | dnshostname = ldapProperty.dnshostname; 118 | gplink = ldapProperty.gplink; 119 | others = ldapProperty.others; 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /SharpView/Returns/DomainPolicyData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class DomainPolicyData : GptTmpl 10 | { 11 | public string GPOName { get; set; } 12 | 13 | public string GPODisplayName { get; set; } 14 | 15 | public DomainPolicyData() 16 | { 17 | 18 | } 19 | 20 | public DomainPolicyData(Dictionary> obj) : base(obj) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SharpView/Returns/ExplicitCredentialLogonEvent.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class ExplicitCredentialLogonEvent : IWinEvent 11 | { 12 | public string ComputerName { get; set; } 13 | 14 | public DateTime? TimeCreated { get; set; } 15 | 16 | public int EventId { get; set; } 17 | 18 | public string SubjectDomainName { get; set; } 19 | 20 | public string SubjectLogonId { get; set; } 21 | 22 | public string SubjectUserName { get; set; } 23 | 24 | public string SubjectUserSid { get; set; } 25 | 26 | public string TargetDomainName { get; set; } 27 | 28 | public string TargetLogonId { get; set; } 29 | 30 | public string TargetLogonGuid { get; set; } 31 | 32 | public string TargetUserName { get; set; } 33 | 34 | public string TargetUserSid { get; set; } 35 | 36 | public string TargetServerName { get; set; } 37 | 38 | public string LogonGuid { get; set; } 39 | 40 | public string TargetInfo { get; set; } 41 | 42 | public string ProcessId { get; set; } 43 | 44 | public string ProcessName { get; set; } 45 | 46 | public string IpAddress { get; set; } 47 | 48 | public string IpPort { get; set; } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SharpView/Returns/FileACL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.AccessControl; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using static SharpView.Utils.NativeMethods; 8 | 9 | namespace SharpView.Returns 10 | { 11 | public class FileACL 12 | { 13 | public string Path { get; set; } 14 | public string FileSystemRights { get; set; } 15 | public IEnumerable IdentityReference { get; set; } 16 | public string IdentitySID { get; set; } 17 | public AccessControlType AccessControlType { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Returns/Filter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class Filter 10 | { 11 | public string Type { get; set; } 12 | 13 | public string Value { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Returns/ForeignGroupMember.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class ForeignGroupMember 13 | { 14 | public string GroupDomain { get; set; } 15 | 16 | public string GroupName { get; set; } 17 | 18 | public string GroupDistinguishedName { get; set; } 19 | 20 | public string MemberDomain { get; set; } 21 | 22 | public string MemberName { get; set; } 23 | 24 | public string MemberDistinguishedName { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Returns/ForeignUser.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class ForeignUser 13 | { 14 | public string UserDomain { get; set; } 15 | 16 | public string UserName { get; set; } 17 | 18 | public string UserDistinguishedName { get; set; } 19 | 20 | public string GroupDomain { get; set; } 21 | 22 | public string GroupName { get; set; } 23 | 24 | public string GroupDistinguishedName { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Returns/ForestEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class ForestEx 10 | { 11 | public System.DirectoryServices.ActiveDirectory.Forest Forest { get; set; } 12 | public string RootDomainSid { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SharpView/Returns/FoundFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class FoundFile 10 | { 11 | public string Path { get; set; } 12 | public string Owner { get; set; } 13 | public DateTime LastAccessTime { get; set; } 14 | public DateTime LastWriteTime { get; set; } 15 | public DateTime CreationTime { get; set; } 16 | public long Length { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SharpView/Returns/GPO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class GPO : LDAPProperty 10 | { 11 | public string gpcfilesyspath { get; set; } 12 | 13 | public GPO() 14 | { 15 | 16 | } 17 | 18 | public GPO(LDAPProperty property) 19 | :base(property) 20 | { 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SharpView/Returns/GPOComputerLocalGroupMember.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | using SharpView.Enums; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Security.AccessControl; 8 | using System.Security.Principal; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace SharpView.Returns 13 | { 14 | public class GPOComputerLocalGroupMember 15 | { 16 | public IEnumerable ComputerName { get; set; } 17 | 18 | public string ObjectName { get; set; } 19 | 20 | public string ObjectDN { get; set; } 21 | 22 | public string[] ObjectSID { get; set; } 23 | 24 | public bool IsGroup { get; set; } 25 | 26 | public string GPODisplayName { get; set; } 27 | 28 | public string GPOGuid { get; set; } 29 | 30 | public string GPOPath { get; set; } 31 | 32 | public string GPOType { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SharpView/Returns/GPOGroup.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class GPOGroup 13 | { 14 | public string GPODisplayName { get; set; } 15 | 16 | public string GPOName { get; set; } 17 | 18 | public string GPOPath { get; set; } 19 | 20 | public string GPOType { get; set; } 21 | 22 | public IEnumerable Filters { get; set; } 23 | 24 | public string GroupName { get; set; } 25 | 26 | public string GroupSID { get; set; } 27 | 28 | public IEnumerable GroupMemberOf { get; set; } 29 | 30 | public IEnumerable GroupMembers { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SharpView/Returns/GPOLocalGroupMapping.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class GPOLocalGroupMapping 13 | { 14 | public string GPODisplayName { get; set; } 15 | 16 | public string GPOName { get; set; } 17 | 18 | public string GPOPath { get; set; } 19 | 20 | public string GPOType { get; set; } 21 | 22 | public IEnumerable Filters { get; set; } 23 | 24 | public string GroupName { get; set; } 25 | 26 | public string GroupSID { get; set; } 27 | 28 | public IEnumerable GroupMemberOf { get; set; } 29 | 30 | public IEnumerable GroupMembers { get; set; } 31 | 32 | public string ObjectName { get; set; } 33 | 34 | public string ObjectDN { get; set; } 35 | 36 | public string[] ObjectSID { get; set; } 37 | 38 | public string Domain { get; set; } 39 | 40 | public bool IsGroup { get; set; } 41 | 42 | public string GPOGuid { get; set; } 43 | 44 | public string ContainerName { get; set; } 45 | 46 | public IEnumerable ComputerName { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SharpView/Returns/GptTmpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class GptTmpl : Dictionary> 10 | { 11 | public string Path { get; set; } 12 | 13 | public GptTmpl() 14 | { 15 | 16 | } 17 | 18 | public GptTmpl(Dictionary> obj) 19 | { 20 | foreach (var value in obj) 21 | { 22 | Add(value.Key, value.Value); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Returns/GroupMember.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class GroupMember 13 | { 14 | public string GroupDomain { get; set; } 15 | 16 | public string GroupName { get; set; } 17 | 18 | public string GroupDistinguishedName { get; set; } 19 | 20 | public string MemberDomain { get; set; } 21 | 22 | public string MemberName { get; set; } 23 | 24 | public string MemberDistinguishedName { get; set; } 25 | 26 | public string MemberObjectClass { get; set; } 27 | 28 | public string MemberSID { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SharpView/Returns/GroupsXML.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class GroupsXML 10 | { 11 | public string GPOPath { get; set; } 12 | 13 | public IEnumerable Filters { get; set; } 14 | 15 | public string GroupName { get; set; } 16 | 17 | public string GroupSID { get; set; } 18 | 19 | public IEnumerable GroupMemberOf { get; set; } 20 | 21 | public IEnumerable GroupMembers { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SharpView/Returns/LastLoggedOnUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class LastLoggedOnUser 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public string LastLoggedOn { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Returns/LdapDomainTrust.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using SharpView.Interfaces; 3 | using System.DirectoryServices.ActiveDirectory; 4 | 5 | namespace SharpView.Returns 6 | { 7 | public class LdapDomainTrust : IDomainTrust 8 | { 9 | public string SourceName { get; set; } 10 | 11 | public string TargetName { get; set; } 12 | 13 | public TrustType TrustType { get; set; } 14 | 15 | public TrustDirection TrustDirection { get; set; } 16 | 17 | public TrustAttribute TrustAttributes { get; set; } 18 | 19 | public object WhenCreated { get; set; } 20 | 21 | public object WhenChanged { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SharpView/Returns/LocalGroupAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class LocalGroupAPI 11 | { 12 | public string ComputerName { get; set; } 13 | public string GroupName { get; set; } 14 | public string Comment { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SharpView/Returns/LocalGroupMemberAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class LocalGroupMemberAPI 11 | { 12 | public string ComputerName { get; set; } 13 | public string GroupName { get; set; } 14 | public string MemberName { get; set; } 15 | public string SID { get; set; } 16 | public bool IsGroup { get; set; } 17 | public string IsDomain { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Returns/LocalGroupMemberWinNT.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class LocalGroupMemberWinNT 11 | { 12 | public string ComputerName { get; set; } 13 | public string GroupName { get; set; } 14 | public string AccountName { get; set; } 15 | public string SID { get; set; } 16 | public bool IsGroup { get; set; } 17 | public bool IsDomain { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Returns/LocalGroupWinNT.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class LocalGroupWinNT 11 | { 12 | public string ComputerName { get; set; } 13 | public string GroupName { get; set; } 14 | public string SID { get; set; } 15 | public string Comment { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SharpView/Returns/LoggedOnUserInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class LoggedOnUserInfo 11 | { 12 | public string UserName { get; set; } 13 | public string LogonDomain { get; set; } 14 | public string AuthDomains { get; set; } 15 | public string LogonServer { get; set; } 16 | public string ComputerName { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SharpView/Returns/LogonEvent.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Interfaces; 2 | using System; 3 | 4 | namespace SharpView.Returns 5 | { 6 | public class LogonEvent : IWinEvent 7 | { 8 | public string ComputerName { get; set; } 9 | 10 | public DateTime? TimeCreated { get; set; } 11 | 12 | public int EventId { get; set; } 13 | 14 | public string SubjectDomainName { get; set; } 15 | 16 | public string SubjectLogonId { get; set; } 17 | 18 | public string SubjectUserName { get; set; } 19 | 20 | public string SubjectUserSid { get; set; } 21 | 22 | public string TargetDomainName { get; set; } 23 | 24 | public string TargetLogonId { get; set; } 25 | 26 | public string TargetUserName { get; set; } 27 | 28 | public string TargetUserSid { get; set; } 29 | 30 | public string LogonType { get; set; } 31 | 32 | public string LogonProcessName { get; set; } 33 | 34 | public string LogonGuid { get; set; } 35 | 36 | public string AuthenticationPackageName { get; set; } 37 | 38 | public string WorkstationName { get; set; } 39 | 40 | public string TransmittedServices { get; set; } 41 | 42 | public string LmPackageName { get; set; } 43 | 44 | public string KeyLength { get; set; } 45 | 46 | public string ProcessId { get; set; } 47 | 48 | public string ProcessName { get; set; } 49 | 50 | public string IpAddress { get; set; } 51 | 52 | public string IpPort { get; set; } 53 | 54 | public string ImpersonationLevel { get; set; } 55 | 56 | public string RestrictedAdminMode { get; set; } 57 | 58 | public string TargetOutboundUserName { get; set; } 59 | 60 | public string TargetOutboundDomainName { get; set; } 61 | 62 | public string VirtualAccount { get; set; } 63 | 64 | public string TargetLinkedLogonId { get; set; } 65 | 66 | public string ElevatedToken { get; set; } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /SharpView/Returns/ManagedSecurityGroup.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.AccessControl; 6 | using System.Security.Principal; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Returns 11 | { 12 | public class ManagedSecurityGroup 13 | { 14 | public string GroupName { get; set; } 15 | 16 | public string GroupDistinguishedName { get; set; } 17 | 18 | public string ManagerName { get; set; } 19 | 20 | public string ManagerDistinguishedName { get; set; } 21 | 22 | public ManagerType? ManagerType { get; set; } 23 | 24 | public string ManagerCanWrite { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpView/Returns/NetDomainTrust.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Interfaces; 2 | using System.DirectoryServices.ActiveDirectory; 3 | 4 | namespace SharpView.Returns 5 | { 6 | public class NetDomainTrust : IDomainTrust 7 | { 8 | public string SourceName { get; set; } 9 | public string TargetName { get; set; } 10 | public TrustDirection TrustDirection { get; set; } 11 | public TrustType TrustType { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SharpView/Returns/PrincipalContextEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class PrincipalContextEx 11 | { 12 | public System.DirectoryServices.AccountManagement.PrincipalContext Context { get; set; } 13 | 14 | public string Identity { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SharpView/Returns/PropertyOutlier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class PropertyOutlier 10 | { 11 | public string SamAccountName { get; set; } 12 | public string Property { get; set; } 13 | public object Value { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SharpView/Returns/ProxySettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class ProxySettings 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public string ProxyServer { get; set; } 14 | 15 | public string AutoConfigURL { get; set; } 16 | 17 | public string Wpad { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Returns/RDPSessionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class RDPSessionInfo 11 | { 12 | public string ComputerName { get; set; } 13 | 14 | public string SessionName { get; set; } 15 | 16 | public string UserName { get; set; } 17 | 18 | public Int32 ID { get; set; } 19 | 20 | public WTS_CONNECTSTATE_CLASS State { get; set; } 21 | 22 | public string SourceIP { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SharpView/Returns/RegLoggedOnUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class RegLoggedOnUser 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public string UserDomain { get; set; } 14 | 15 | public string UserName { get; set; } 16 | 17 | public string UserSID { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Returns/RegMountedDrive.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class RegMountedDrive 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public string UserName { get; set; } 14 | 15 | public string UserSID { get; set; } 16 | 17 | public string DriveLetter { get; set; } 18 | 19 | public string ProviderName { get; set; } 20 | 21 | public string RemotePath { get; set; } 22 | 23 | public string DriveUserName { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SharpView/Returns/ResolvedSID.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class ResolvedSID 10 | { 11 | public string IdentityReferenceName { get; set; } 12 | 13 | public string IdentityReferenceDomain { get; set; } 14 | 15 | public string IdentityReferenceDN { get; set; } 16 | 17 | public string IdentityReferenceClass { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Returns/SPNTicket.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class SPNTicket 10 | { 11 | public string TicketByteHexStream { get; set; } 12 | 13 | public string Hash { get; set; } 14 | 15 | public string SamAccountName { get; set; } 16 | 17 | public string DistinguishedName { get; set; } 18 | 19 | public string ServicePrincipalName { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Returns/SessionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class SessionInfo 11 | { 12 | public string ComputerName { get; set; } 13 | public string CName { get; set; } 14 | public string UserName { get; set; } 15 | public uint Time { get; set; } 16 | public uint IdleTime { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SharpView/Returns/ShareInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using static SharpView.Utils.NativeMethods; 7 | 8 | namespace SharpView.Returns 9 | { 10 | public class ShareInfo 11 | { 12 | public string Name { get; set; } 13 | public uint Type { get; set; } 14 | public string Remark { get; set; } 15 | public string ComputerName { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SharpView/Returns/UserLocation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class UserLocation 10 | { 11 | public string UserDomain { get; set; } 12 | public string UserName { get; set; } 13 | public string ComputerName { get; set; } 14 | public string IPAddress { get; set; } 15 | public string SessionFrom { get; set; } 16 | public string SessionFromName { get; set; } 17 | public bool LocalAdmin { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SharpView/Returns/UserProcess.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Returns 8 | { 9 | public class UserProcess 10 | { 11 | public string ComputerName { get; set; } 12 | 13 | public string ProcessName { get; set; } 14 | 15 | public string ProcessID { get; set; } 16 | 17 | public string Domain { get; set; } 18 | 19 | public string User { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SharpView/Utils/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Utils 8 | { 9 | public static class Logger 10 | { 11 | public static void Write_Verbose(string log, bool endLine = true) 12 | { 13 | if (endLine) 14 | { 15 | System.Diagnostics.Debug.WriteLine(log); 16 | Console.WriteLine(log); 17 | } 18 | else 19 | { 20 | System.Diagnostics.Debug.Write(log); 21 | Console.Write(log); 22 | } 23 | } 24 | 25 | public static void Write_Warning(string log, bool endLine = true) 26 | { 27 | if (endLine) 28 | { 29 | System.Diagnostics.Debug.WriteLine(log); 30 | Console.WriteLine(log); 31 | } 32 | else 33 | { 34 | System.Diagnostics.Debug.Write(log); 35 | Console.Write(log); 36 | } 37 | } 38 | 39 | public static void Write_Output(string log, bool endLine = true) 40 | { 41 | if (endLine) 42 | { 43 | System.Diagnostics.Debug.WriteLine(log); 44 | Console.WriteLine(log); 45 | } 46 | else 47 | { 48 | System.Diagnostics.Debug.Write(log); 49 | Console.Write(log); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /SharpView/Utils/NetworkCredentialConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace SharpView.Utils 10 | { 11 | public class NetworkCredentialConverter : TypeConverter 12 | { 13 | public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 | { 15 | if (sourceType == typeof(System.Net.NetworkCredential)) 16 | { 17 | return true; 18 | } 19 | 20 | return base.CanConvertFrom(context, sourceType); 21 | } 22 | 23 | public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) 24 | { 25 | string s = value as string; 26 | 27 | if (!string.IsNullOrEmpty(s)) 28 | { 29 | string user = string.Empty, password = string.Empty; 30 | var posPass = s.IndexOf("/"); 31 | if (posPass >= 0) 32 | { 33 | user = s.Substring(0, posPass); 34 | password = s.Substring(posPass + 1); 35 | } 36 | else user = s; 37 | return new System.Net.NetworkCredential(user, password); 38 | } 39 | 40 | return base.ConvertFrom(context, culture, value); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SharpView/Utils/PathExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Utils 9 | { 10 | public static class PathExtension 11 | { 12 | public static bool EndsWith(this IEnumerable patterns, string obj, StringComparison comparisionType) 13 | { 14 | return patterns.Any(x => obj.IsLikeMatch(x)); 15 | } 16 | 17 | public static IEnumerable GetDirectoryFiles(string rootPath, string[] patternMatchs, SearchOption searchOption) 18 | { 19 | var foundFiles = Enumerable.Empty(); 20 | 21 | if (searchOption == SearchOption.AllDirectories) 22 | { 23 | try 24 | { 25 | IEnumerable subDirs = Directory.EnumerateDirectories(rootPath); 26 | foreach (string dir in subDirs) 27 | { 28 | System.Console.WriteLine("Searching Directory: " + dir); 29 | foundFiles = foundFiles.Concat(GetDirectoryFiles(dir, patternMatchs, searchOption)); // Add files in subdirectories recursively to the list 30 | } 31 | } 32 | catch (UnauthorizedAccessException) { } 33 | catch (PathTooLongException) { } 34 | } 35 | 36 | try 37 | { 38 | foundFiles = foundFiles.Concat(Directory.EnumerateFiles(rootPath, "*.*").Where(x => patternMatchs.EndsWith(x, StringComparison.OrdinalIgnoreCase))); // Add files from the current directory 39 | } 40 | catch (UnauthorizedAccessException) { } 41 | 42 | return foundFiles; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /SharpView/Utils/ReflectionExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Utils 8 | { 9 | public static class ReflectionExtension 10 | { 11 | public static T GetPropValue(this object obj, string propName) 12 | { 13 | return (T)obj.GetType().GetProperty(propName)?.GetValue(obj, null); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SharpView/Utils/RegexMatch.cs: -------------------------------------------------------------------------------- 1 | using PCRE; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using System.Threading.Tasks; 9 | 10 | namespace SharpView.Utils 11 | { 12 | public static class RegexMatch 13 | { 14 | #region Public Methods 15 | public static bool IsMatch(string pattern, string text) 16 | { 17 | return new PcreRegex(pattern, PcreOptions.IgnoreCase).Match(text).Success; 18 | } 19 | 20 | public static bool IsRegexMatch(this string text, string pattern) 21 | { 22 | return IsMatch(pattern, text); 23 | } 24 | 25 | public static IEnumerable GetRegexMatches(this string[] texts, string pattern) 26 | { 27 | var matches = new List(); 28 | foreach (string item in texts) 29 | { 30 | if (item.IsRegexMatch(pattern)) 31 | matches.Add(item); 32 | } 33 | return matches; 34 | } 35 | 36 | public static IPcreGroupList GetRegexGroups(this string text, string pattern) 37 | { 38 | return new PcreRegex(pattern, PcreOptions.IgnoreCase).Match(text).Groups; 39 | } 40 | 41 | public static bool RegexContains(this string[] values, string pattern) 42 | { 43 | foreach (string item in values) 44 | { 45 | if (item.IsRegexMatch(pattern)) 46 | return true; 47 | } 48 | return false; 49 | } 50 | 51 | public static bool RegexContains(this ICollection values, string pattern) 52 | { 53 | foreach (string item in values) 54 | { 55 | if (item.IsRegexMatch(pattern)) 56 | return true; 57 | } 58 | return false; 59 | } 60 | 61 | #endregion 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /SharpView/Utils/ResultPropertyValueCollectionExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.DirectoryServices; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Utils 9 | { 10 | public static class ResultPropertyValueCollectionExtension 11 | { 12 | public static IEnumerable GetValues(this ResultPropertyValueCollection collection) 13 | { 14 | var values = new List(); 15 | foreach (T value in collection) 16 | { 17 | values.Add(value); 18 | } 19 | return values; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SharpView/Utils/StringArrayConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace SharpView.Utils 10 | { 11 | public class StringArrayConverter : ArrayConverter 12 | { 13 | public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 | { 15 | if (sourceType == typeof(string)) 16 | { 17 | return true; 18 | } 19 | 20 | return base.CanConvertFrom(context, sourceType); 21 | } 22 | 23 | public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) 24 | { 25 | string s = value as string; 26 | 27 | if (!string.IsNullOrEmpty(s)) 28 | { 29 | return ((string)value).Split(','); 30 | } 31 | 32 | return base.ConvertFrom(context, culture, value); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SharpView/Utils/StringExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Utils 8 | { 9 | public static class StringExtension 10 | { 11 | public static string ShortenString(this string s, int length) 12 | { 13 | string ret; 14 | if (s.Length > length) 15 | { 16 | ret = s.Substring(0, length - 3); 17 | ret = ret.PadRight(length, '.'); 18 | } 19 | else 20 | ret = s; 21 | 22 | ret = ret.PadRight(length, ' '); 23 | return ret; 24 | } 25 | 26 | public static string ToJoinedString(this string[] ss, string separator = ",") 27 | { 28 | return string.Join(separator, ss); 29 | } 30 | 31 | public static bool ContainsNoCase(this string[] ss, string pattern) 32 | { 33 | return ss.Any(x => x.Equals(pattern, StringComparison.OrdinalIgnoreCase)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SharpView/Utils/TestConnection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.NetworkInformation; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Utils 9 | { 10 | public static class TestConnection 11 | { 12 | public static bool Ping(string host, int count = 1) 13 | { 14 | Ping pingSender = new Ping(); 15 | PingOptions options = new PingOptions(); 16 | 17 | options.DontFragment = true; 18 | 19 | byte[] data = { 0x20, 0x20 }; 20 | int timeout = 120; 21 | 22 | for (int i = 0; i < count; i++) 23 | { 24 | try 25 | { 26 | PingReply reply = pingSender.Send(host, timeout, data, options); 27 | if (reply.Status == IPStatus.Success) 28 | { 29 | return true; 30 | } 31 | } 32 | catch 33 | { 34 | } 35 | } 36 | 37 | return false; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SharpView/Utils/TrustAttributeExtension.cs: -------------------------------------------------------------------------------- 1 | using SharpView.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SharpView.Utils 9 | { 10 | public static class TrustAttributeExtension 11 | { 12 | public static IEnumerable ExtractValues(this TrustAttribute attr) 13 | { 14 | var ui32 = (UInt32)attr; 15 | var values = new List(); 16 | for (int i = 0; i < ui32; i++) 17 | { 18 | var val = ui32 & ((UInt64)1 << i); 19 | if (val != 0) 20 | values.Add((TrustAttribute)val); 21 | } 22 | return values; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SharpView/Utils/ValidationExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SharpView.Utils 8 | { 9 | public static class ValidationExtension 10 | { 11 | public static bool IsNullOrWhiteSpace(this string s) 12 | { 13 | return string.IsNullOrWhiteSpace(s); 14 | } 15 | 16 | public static bool IsNotNullOrWhiteSpace(this string s) 17 | { 18 | return !IsNullOrWhiteSpace(s); 19 | } 20 | 21 | public static bool IsNullOrEmpty(this string s) 22 | { 23 | return string.IsNullOrEmpty(s); 24 | } 25 | 26 | public static bool IsNotNullOrEmpty(this string s) 27 | { 28 | return !IsNullOrEmpty(s); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SharpView/Utils/WildcardMatch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using System.Threading.Tasks; 8 | 9 | namespace SharpView.Utils 10 | { 11 | public static class WildcardMatch 12 | { 13 | #region Public Methods 14 | public static bool IsLike(string pattern, string text, bool caseSensitive = false) 15 | { 16 | pattern = pattern.Replace(".", @"\."); 17 | pattern = pattern.Replace("?", "."); 18 | pattern = pattern.Replace("*", ".*?"); 19 | pattern = pattern.Replace(@"\", @"\\"); 20 | pattern = pattern.Replace(" ", @"\s"); 21 | return new Regex(pattern, caseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase).IsMatch(text); 22 | } 23 | 24 | public static bool IsLikeMatch(this string text, string pattern) 25 | { 26 | return IsLike(pattern, text); 27 | } 28 | 29 | public static IEnumerable GetMatches(this ICollection collection, string pattern) 30 | { 31 | var matches = new List(); 32 | foreach (string item in collection) 33 | { 34 | if (item.IsLikeMatch(pattern)) 35 | matches.Add(item); 36 | } 37 | return matches; 38 | } 39 | 40 | public static string GetFirstMatch(this ICollection collection, string pattern) 41 | { 42 | foreach (string item in collection) 43 | { 44 | if (item.IsLikeMatch(pattern)) 45 | return item; 46 | } 47 | return null; 48 | } 49 | #endregion 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SharpView/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | --------------------------------------------------------------------------------