This project is published strictly for educational purposes. The code and concepts shared here are not to be used for malicious intent.
This is an experimental Windows keylogger written in C# using .NET 10.
It demonstrates how to capture global keyboard input on Windows using P/Invoke and native user32.dll functions.
If you want a detailed breakdown of how everything works internally, read the full article:
https://eddymens.com/an-experimental-keylogger-53049e4890216
- .NET 10 SDK
- Windows OS (for testing)
Checking your .NET version: dotnet --version
installing .NET: https://learn.microsoft.com/en-us/dotnet/core/install/windows
dotnet runAll keystrokes are written to:
logFile.txtWhile running in console mode:
-
Press ESC to exit.
-
If running in background mode, use the Windows Task Manager to terminate the process (Search for KeyLogger).
If you want the application to run without opening a console window:
Open KeyLoggerApp.csproj and change:
<OutputType>Exe</OutputType>to:
<OutputType>WinExe</OutputType>Then rebuild:
dotnet buildNow the application will run silently in the background.
You will need Task Manager to terminate it.
To generate a self-contained single binary:
dotnet publish -c Release --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=trueThe executable will be inside:
bin/Release/net10.0/win-x64/publish/