-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from HotCakeX/Harden-Windows-Security-Module-…
…v0.4.5 Harden Windows Security Module v.0.4.5
- Loading branch information
Showing
8 changed files
with
1,628 additions
and
1,587 deletions.
There are no files selected for viewing
2,746 changes: 1,417 additions & 1,329 deletions
2,746
Harden-Windows-Security Module/Main files/Core/Confirm-SystemCompliance.psm1
Large diffs are not rendered by default.
Oops, something went wrong.
396 changes: 144 additions & 252 deletions
396
Harden-Windows-Security Module/Main files/Core/Protect-WindowsSecurity.psm1
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Harden-Windows-Security Module/Main files/Shared/IndividualResultClass.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Imported by Confirm-SystemCompliance cmdlet | ||
namespace HardeningModule | ||
{ | ||
public class IndividualResult | ||
{ | ||
public string FriendlyName { get; set; } | ||
public string Compliant { get; set; } | ||
public string Value { get; set; } | ||
public string Name { get; set; } | ||
public string Category { get; set; } | ||
public string Method { get; set; } | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Harden-Windows-Security Module/Main files/Shared/SystemInfoNativeMethods.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// bootDMAProtection check - checks for Kernel DMA Protection status in System information or msinfo32 | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace SystemInfo | ||
{ | ||
public static class NativeMethods | ||
{ | ||
internal enum SYSTEM_DMA_GUARD_POLICY_INFORMATION : int | ||
{ | ||
SystemDmaGuardPolicyInformation = 202 | ||
} | ||
|
||
[DllImport("ntdll.dll")] | ||
internal static extern Int32 NtQuerySystemInformation( | ||
SYSTEM_DMA_GUARD_POLICY_INFORMATION SystemDmaGuardPolicyInformation, | ||
IntPtr SystemInformation, | ||
Int32 SystemInformationLength, | ||
out Int32 ReturnLength); | ||
|
||
public static byte BootDmaCheck() | ||
{ | ||
Int32 result; | ||
Int32 SystemInformationLength = 1; | ||
IntPtr SystemInformation = Marshal.AllocHGlobal(SystemInformationLength); | ||
Int32 ReturnLength; | ||
|
||
result = NativeMethods.NtQuerySystemInformation( | ||
NativeMethods.SYSTEM_DMA_GUARD_POLICY_INFORMATION.SystemDmaGuardPolicyInformation, | ||
SystemInformation, | ||
SystemInformationLength, | ||
out ReturnLength); | ||
|
||
if (result == 0) | ||
{ | ||
byte info = Marshal.ReadByte(SystemInformation, 0); | ||
Marshal.FreeHGlobal(SystemInformation); // free the allocated memory | ||
return info; | ||
} | ||
|
||
Marshal.FreeHGlobal(SystemInformation); // free the allocated memory | ||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.4 | ||
0.4.5 |