Skip to content

Commit

Permalink
driver work
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy-s committed Jul 29, 2022
1 parent 269a21a commit 9997b67
Show file tree
Hide file tree
Showing 88 changed files with 22,642 additions and 5,843 deletions.
44 changes: 44 additions & 0 deletions KSystemInformer/KSystemInformer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KSystemInformer", "KSystemInformer.vcxproj", "{F4853009-C5D2-4A25-BE4D-BB0D9F84E2FF}"
ProjectSection(ProjectDependencies) = postProject
{B385D394-19CC-48BC-827E-AF9ADCE559E0} = {B385D394-19CC-48BC-827E-AF9ADCE559E0}
{B1863396-A667-42DB-97AC-C5E033CEE321} = {B1863396-A667-42DB-97AC-C5E033CEE321}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kphlib", "..\kphlib\kphlib_km.vcxproj", "{B1863396-A667-42DB-97AC-C5E033CEE321}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ksidll", "ksidll.vcxproj", "{B385D394-19CC-48BC-827E-AF9ADCE559E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -33,6 +41,42 @@ Global
{F4853009-C5D2-4A25-BE4D-BB0D9F84E2FF}.Release|x64.ActiveCfg = Release|x64
{F4853009-C5D2-4A25-BE4D-BB0D9F84E2FF}.Release|x64.Build.0 = Release|x64
{F4853009-C5D2-4A25-BE4D-BB0D9F84E2FF}.Release|x64.Deploy.0 = Release|x64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|ARM64.Build.0 = Debug|ARM64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|ARM64.Deploy.0 = Debug|ARM64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|Win32.ActiveCfg = Debug|Win32
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|Win32.Build.0 = Debug|Win32
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|Win32.Deploy.0 = Debug|Win32
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|x64.ActiveCfg = Debug|x64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|x64.Build.0 = Debug|x64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Debug|x64.Deploy.0 = Debug|x64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|ARM64.ActiveCfg = Release|ARM64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|ARM64.Build.0 = Release|ARM64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|ARM64.Deploy.0 = Release|ARM64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|Win32.ActiveCfg = Release|Win32
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|Win32.Build.0 = Release|Win32
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|Win32.Deploy.0 = Release|Win32
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|x64.ActiveCfg = Release|x64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|x64.Build.0 = Release|x64
{B1863396-A667-42DB-97AC-C5E033CEE321}.Release|x64.Deploy.0 = Release|x64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|ARM64.Build.0 = Debug|ARM64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|ARM64.Deploy.0 = Debug|ARM64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|Win32.ActiveCfg = Debug|Win32
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|Win32.Build.0 = Debug|Win32
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|Win32.Deploy.0 = Debug|Win32
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|x64.ActiveCfg = Debug|x64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|x64.Build.0 = Debug|x64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Debug|x64.Deploy.0 = Debug|x64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|ARM64.ActiveCfg = Release|ARM64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|ARM64.Build.0 = Release|ARM64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|ARM64.Deploy.0 = Release|ARM64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|Win32.ActiveCfg = Release|Win32
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|Win32.Build.0 = Release|Win32
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|Win32.Deploy.0 = Release|Win32
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|x64.ActiveCfg = Release|x64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|x64.Build.0 = Release|x64
{B385D394-19CC-48BC-827E-AF9ADCE559E0}.Release|x64.Deploy.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
119 changes: 87 additions & 32 deletions KSystemInformer/KSystemInformer.vcxproj

Large diffs are not rendered by default.

63 changes: 60 additions & 3 deletions KSystemInformer/KSystemInformer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="devctrl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dyndata.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -48,6 +45,51 @@
<ClCompile Include="verify.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="informer_file.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="comms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="informer_image.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="informer_process.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="informer_thread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="informer_debug.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="comms_handlers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sign.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="hash.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="informer_object.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="alloc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cid_table.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="kphobject.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cid_tracking.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="protection.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">
Expand All @@ -64,5 +106,20 @@
<ClInclude Include="include\ntfill.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\comms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\informer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\trace.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\pooltags.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\cid_table.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
46 changes: 46 additions & 0 deletions KSystemInformer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# System Informer Kernel

- optimizes retrieval of information from the system
- enables broader inspection into the system
- informs of system activity in realtime
- assists in removal of malware

## Security

[Security Policies and Procedures](../SECURITY.md)

Because the information exposed through the driver enables, by design, broader
access into the system. Access is strictly limited to verified callers.
Access is restricted based on the state of the calling process. This involves
signing, privilege, and other state checks. If the client does not meet the
state requirements they are denied access.

Any binaries built with the intention of loading into System Informer must
have a `.sig` from the key pair integrated into the build process and driver.
Or be signed by Microsoft or an anti-malware vendor. Loading of unsigned
modules will restrict access to the driver. Third-party plugins are supported,
however when they are loaded access to the driver will be restricted as they
are not signed.

The driver tracks verified clients, restricts access by other actors on the
system, and denies access if the process is tampered with. The intention is to
discourage exploitation of the client when the driver is active. If tampering
or exploitation is detected the client is denied access.

## Development

Developers may generate their own key pair for use in their environment.

1. execute `tools\CustomSignTool\bin\Release64\CustomSignTool.exe createkeypair kph.key public.key`
2. copy `kph.key` into `tools\CustomSignTool\resources`
3. copy the bytes for `public.key` into the `KphpTrustedPublicKey` array in [verify.c](verify.c)

Once these steps are completed builds of System Informer components will
generate a `.sig` file next to the output binaries. And the developer built
driver will use the specified key when doing verification checks. Any plugins
not built through the regular build process must also have their own `.sig`.

Developers may suppress protections and state requirements by changing
`KPH_PROTECTION_SUPPRESSED` to `1` in [kphapi.h](../kphlib/include/kphapi.h).
This is necessary if you intend to use a user mode debugger as the protections
and state requirements will break the debugger.
Loading

0 comments on commit 9997b67

Please sign in to comment.