diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..013007bb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dotnet.preferCSharpExtension": true +} \ No newline at end of file diff --git a/Rubeus/Backup/AssemblyInfo.cs.old b/Rubeus/Backup/AssemblyInfo.cs.old new file mode 100755 index 00000000..bbb9863e --- /dev/null +++ b/Rubeus/Backup/AssemblyInfo.cs.old @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Rubeus")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Rubeus")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("658c8b7f-3664-4a95-9572-a3e5871dfc06")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rubeus/Backup/Rubeus.csproj.old b/Rubeus/Backup/Rubeus.csproj.old new file mode 100755 index 00000000..093e1d39 --- /dev/null +++ b/Rubeus/Backup/Rubeus.csproj.old @@ -0,0 +1,251 @@ + + + + + Debug + AnyCPU + {658C8B7F-3664-4A95-9572-A3E5871DFC06} + Exe + Properties + Rubeus + Rubeus + v4.0 + 512 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + true + + + AnyCPU + none + true + bin\Release\ + TRACE + prompt + 4 + false + false + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 + true + + + + + + + + + + diff --git a/Rubeus/Properties/AssemblyInfo.cs b/Rubeus/Properties/AssemblyInfo.cs index bbb9863e..04b4b2ab 100755 --- a/Rubeus/Properties/AssemblyInfo.cs +++ b/Rubeus/Properties/AssemblyInfo.cs @@ -1,19 +1,8 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Rubeus")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Rubeus")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. @@ -21,16 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("658c8b7f-3664-4a95-9572-a3e5871dfc06")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rubeus/Rubeus.csproj b/Rubeus/Rubeus.csproj index 093e1d39..9db382a3 100755 --- a/Rubeus/Rubeus.csproj +++ b/Rubeus/Rubeus.csproj @@ -1,251 +1,49 @@ - - - - - Debug - AnyCPU - {658C8B7F-3664-4A95-9572-A3E5871DFC06} - Exe - Properties - Rubeus - Rubeus - v4.0 - 512 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - true - - - AnyCPU - none - true - bin\Release\ - TRACE - prompt - 4 - false - false - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 - true - - - - - - - - - - + + + {658C8B7F-3664-4A95-9572-A3E5871DFC06} + Exe + net48;net6.0-windows + win-x86;win-x64 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + Rubeus + Rubeus + Copyright © 2018 + true + bin\$(Configuration)\ + + + full + + + none + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Rubeus/lib/Roast.cs b/Rubeus/lib/Roast.cs index 83ae7a48..2e8c66fd 100755 --- a/Rubeus/lib/Roast.cs +++ b/Rubeus/lib/Roast.cs @@ -716,6 +716,7 @@ public static bool GetTGSRepHash(string spn, string userName = "user", string di domain = domainDN.Replace("DC=", "").Replace(',', '.'); } +#if NETFRAMEWORK try { // the System.IdentityModel.Tokens.KerberosRequestorSecurityToken approach and extraction of the AP-REQ from the @@ -834,10 +835,14 @@ public static bool GetTGSRepHash(string spn, string userName = "user", string di } catch (Exception ex) { - Console.WriteLine("\r\n [X] Error during request for SPN {0} : {1}\r\n", spn, ex.InnerException.Message); + Console.WriteLine("\r\n [X] Error during request for SPN {0} : {1}\r\n", spn, ex.InnerException?.Message ?? ex.Message); return false; } return true; +#else + Console.WriteLine("[X] KerberosRequestorSecurityToken method requires .NET Framework; use a TGT (/ticket) or nopreauth method when targeting .NET Core/5+."); + return false; +#endif } public static bool GetTGSRepHash(KRB_CRED TGT, string spn, string userName = "user", string distinguishedName = "", string outFile = "", bool simpleOutput = false, bool enterprise = false, string domainController = "", Interop.KERB_ETYPE requestEType = Interop.KERB_ETYPE.subkey_keymaterial)