Skip to content

Commit

Permalink
.NET 8 and NTLM parsing fixes
Browse files Browse the repository at this point in the history
Replaced .NET 7 with 8.
NTLM parsing fixes.
  • Loading branch information
Kevin-Robertson committed Aug 6, 2024
1 parent 6b87144 commit ca0f1c6
Show file tree
Hide file tree
Showing 114 changed files with 257 additions and 166 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Restore Dependencies
run: dotnet restore
Expand All @@ -34,29 +34,29 @@ jobs:
run: |
7z a -tzip -mx9 Inveigh-net3.5-dev.zip $PWD/Inveigh/bin/debug/net35/*
7z a -tzip -mx9 Inveigh-net4.6.2-dev.zip $PWD/Inveigh/bin/debug/net462/*
7z a -tzip -mx9 Inveigh-net7.0-dev.zip $PWD/Inveigh/bin/debug/net7.0/* -x!*/
7z a -tzip -mx9 Inveigh-net8.0-dev.zip $PWD/Inveigh/bin/debug/net8.0/* -x!*/
- name: Publish - Trimmed/Single File
run: |
VERSION=${{ github.ref_name }}
dotnet publish --self-contained=true -p:PublishSingleFile=true -p:PublishTrimmed=true -r linux-x64 -f net7.0 -p:AssemblyName=inveigh -c debug
dotnet publish --self-contained=true -p:PublishSingleFile=true -p:PublishTrimmed=true -r osx-x64 -f net7.0 -p:AssemblyName=inveigh -c debug
dotnet publish --self-contained=true -p:PublishSingleFile=true -p:PublishTrimmed=true -r win-x64 -f net7.0 -c debug
dotnet publish -r linux-x64 -f net8.0 -p:PublishOption=TrimmedSingle -p:AssemblyName=inveigh -c debug
dotnet publish -r osx-x64 -f net8.0 -p:PublishOption=TrimmedSingle -p:AssemblyName=inveigh -c debug
dotnet publish -r win-x64 -f net8.0 -p:PublishOption=TrimmedSingle -c debug
- name: Zip - Publish
run: |
tar -czvf Inveigh-net7.0-linux-x64-trimmed-single-dev.tar.gz --directory=$PWD/Inveigh/bin/debug/net7.0/linux-x64/publish/ .
tar -czvf Inveigh-net7.0-osx-x64-trimmed-single-dev.tar.gz --directory=$PWD/Inveigh/bin/debug/net7.0/osx-x64/publish/ .
7z a -tzip -mx9 Inveigh-net7.0-win-x64-trimmed-single-dev.zip $PWD/Inveigh/bin/debug/net7.0/win-x64/publish/*
tar -czvf Inveigh-net8.0-linux-x64-trimmed-single-dev.tar.gz --directory=$PWD/Inveigh/bin/debug/net8.0/linux-x64/publish/ .
tar -czvf Inveigh-net8.0-osx-x64-trimmed-single-dev.tar.gz --directory=$PWD/Inveigh/bin/debug/net8.0/osx-x64/publish/ .
7z a -tzip -mx9 Inveigh-net8.0-win-x64-trimmed-single-dev.zip $PWD/Inveigh/bin/debug/net8.0/win-x64/publish/*
- name: Publish - NativeAOT
run: |
VERSION=${{ github.ref_name }}
dotnet publish -p:Version=${VERSION:1} -r win-x64 -f net7.0 -p:PublishAot=true -c debug
dotnet publish -p:Version=${VERSION:1} -r win-x64 -f net8.0 -p:PublishOption=NativeAOT -c debug
- name: Zip - Publish - NativeAOT
run: |
7z a -tzip -mx9 Inveigh-net7.0-win-x64-nativeaot-${{ github.ref_name }}.zip $PWD/Inveigh/bin/debug/net7.0/win-x64/native/*
7z a -tzip -mx9 Inveigh-net8.0-win-x64-nativeaot-${{ github.ref_name }}.zip $PWD/Inveigh/bin/debug/net8.0/win-x64/native/*
- name: Release .zip
if: "! startsWith(github.event_name, 'pull_request')"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Restore Dependencies
run: dotnet restore
Expand All @@ -33,29 +33,29 @@ jobs:
run: |
7z a -tzip -mx9 Inveigh-net3.5-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net35/*
7z a -tzip -mx9 Inveigh-net4.6.2-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net462/*
7z a -tzip -mx9 Inveigh-net7.0-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net7.0/* -x!*/
7z a -tzip -mx9 Inveigh-net8.0-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net8.0/* -x!*/
- name: Publish - Trimmed/Single File
run: |
VERSION=${{ github.ref_name }}
dotnet publish --self-contained=true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=${VERSION:1} -r linux-x64 -f net7.0 -p:AssemblyName=inveigh -c release
dotnet publish --self-contained=true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=${VERSION:1} -r osx-x64 -f net7.0 -p:AssemblyName=inveigh -c release
dotnet publish --self-contained=true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=${VERSION:1} -r win-x64 -f net7.0 -c release
dotnet publish -p:Version=${VERSION:1} -r linux-x64 -f net8.0 -p:PublishOption=TrimmedSingle -p:AssemblyName=inveigh -c release
dotnet publish -p:Version=${VERSION:1} -r osx-x64 -f net8.0 -p:PublishOption=TrimmedSingle -p:AssemblyName=inveigh -c release
dotnet publish -p:Version=${VERSION:1} -r win-x64 -f net8.0 -p:PublishOption=TrimmedSingle -c release
- name: Zip - Publish
run: |
tar -czvf Inveigh-net7.0-linux-x64-trimmed-single-${{ github.ref_name }}.tar.gz --directory=$PWD/Inveigh/bin/release/net7.0/linux-x64/publish/ .
tar -czvf Inveigh-net7.0-osx-x64-trimmed-single-${{ github.ref_name }}.tar.gz --directory=$PWD/Inveigh/bin/release/net7.0/osx-x64/publish/ .
7z a -tzip -mx9 Inveigh-net7.0-win-x64-trimmed-single-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net7.0/win-x64/publish/*
tar -czvf Inveigh-net8.0-linux-x64-trimmed-single-${{ github.ref_name }}.tar.gz --directory=$PWD/Inveigh/bin/release/net8.0/linux-x64/publish/ .
tar -czvf Inveigh-net8.0-osx-x64-trimmed-single-${{ github.ref_name }}.tar.gz --directory=$PWD/Inveigh/bin/release/net8.0/osx-x64/publish/ .
7z a -tzip -mx9 Inveigh-net8.0-win-x64-trimmed-single-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net8.0/win-x64/publish/*
- name: Publish - NativeAOT
run: |
VERSION=${{ github.ref_name }}
dotnet publish -p:Version=${VERSION:1} -r win-x64 -f net7.0 -p:PublishAot=true -c release
dotnet publish -p:Version=${VERSION:1} -r win-x64 -f net8.0 -p:PublishOption=NativeAOT -c release
- name: Zip - Publish - NativeAOT
run: |
7z a -tzip -mx9 Inveigh-net7.0-win-x64-nativeaot-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net7.0/win-x64/native/Inveigh.exe
7z a -tzip -mx9 Inveigh-net8.0-win-x64-nativeaot-${{ github.ref_name }}.zip $PWD/Inveigh/bin/release/net8.0/win-x64/native/Inveigh.exe
- name: Release .zip
uses: softprops/action-gh-release@v1
Expand Down
20 changes: 13 additions & 7 deletions Inveigh/Inveigh.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net35;net462;net7.0</TargetFrameworks>
<TargetFrameworks>net35;net462;net8.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<DisableFody Condition="'$(PublishAot)' == 'true' Or '$(PublishTrimmed)' == 'true'">true</DisableFody>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
Expand All @@ -12,6 +12,12 @@
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<PublishTrimmed Condition="'$(PublishOption)' == 'TrimmedSingle'">true</PublishTrimmed>
<PublishSingleFile Condition="'$(PublishOption)' == 'TrimmedSingle'">true</PublishSingleFile>
<PublishAot Condition="'$(PublishOption)' == 'NativeAOT'">true</PublishAot>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net35'">
<Reference Include="System.DirectoryServices.Protocols">
Expand All @@ -22,30 +28,30 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="System.DirectoryServices.Protocols">
<Version>7.0.0</Version>
<Version>8.0.0</Version>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="System.DirectoryServices.Protocols">
<Version>7.0.0</Version>
<Version>8.0.0</Version>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="Costura.Fody" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Fody" Version="6.6.4">
<PackageReference Include="Fody" Version="6.8.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Costura.Fody" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Fody" Version="6.6.4">
<PackageReference Include="Fody" Version="6.8.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Inveigh/Listeners/SMBListener.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Inveigh/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Program
public static string netbiosDomain = Environment.UserDomainName;
public static string dnsDomain = "";
public static ulong smb2Session = 5548434740922023936; // todo check
public static string version = "2.0.10";
public static string version = "2.0.11";

static void Main(string[] arguments)
{
Expand Down
2 changes: 1 addition & 1 deletion Inveigh/Protocols/Quiddity/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2022, Kevin Robertson
Copyright (c) 2024, Kevin Robertson
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Inveigh/Protocols/Quiddity/Quiddity/Clients/SMBClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Inveigh/Protocols/Quiddity/Quiddity/Clients/TCPClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
11 changes: 9 additions & 2 deletions Inveigh/Protocols/Quiddity/Quiddity/Listeners/SMBListener.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -38,6 +38,7 @@
using Quiddity.NTLM;
using Quiddity.SMB;
using Quiddity.SMB2;
using Quiddity.Support;

namespace Quiddity
{
Expand Down Expand Up @@ -243,7 +244,13 @@ internal void ReceiveClient(object parameters)
string user = Encoding.Unicode.GetString(ntlmResponse.UserName);
string host = Encoding.Unicode.GetString(ntlmResponse.Workstation);
string response = BitConverter.ToString(ntlmResponse.NtChallengeResponse).Replace("-", "");
string lmResponse = BitConverter.ToString(ntlmResponse.LmChallengeResponse).Replace("-", "");
string lmResponse = "";

if (!Utilities.ArrayIsNullOrEmpty(ntlmResponse.UserName))
{
lmResponse = BitConverter.ToString(ntlmResponse.LmChallengeResponse).Replace("-", "");
}

OutputNTLM("SMB", listenerPort, clientIP, clientPort, user, domain, host, challenge, response, lmResponse);
SMB2Header responseSMB2Header = new SMB2Header();
SMB2SessionSetupResponse smb2SessionSetupResponse = new SMB2SessionSetupResponse();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2022, Kevin Robertson
* Copyright (c) 2024, Kevin Robertson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Loading

0 comments on commit ca0f1c6

Please sign in to comment.