
A lightweight tool designed to stop clickfix attacks by using clipboard formatting with execution surface checks
Real-time detection of ClickFix clipboard injection attacks on Windows.
ClipGuard monitors clipboard activity and intercepts suspicious paste operations before they can execute — specifically targeting the ClickFix technique where fake verification pages trick users into pasting malicious commands.
ClickFix attacks work like this:
The key insight: when JavaScript writes to the clipboard via navigator.clipboard.writeText(), the clipboard contains CF_UNICODETEXT only —When a user manually selects and copies text from a webpage, the browser places both CF_UNICODETEXT and CF_HTML on the clipboard. ClipGuard uses this format difference as one of its primary detection signal.
ClipGuard runs in the system tray and layers multiple detection mechanisms:
Clipboard Provenance Tracking — Listens for WM_CLIPBOARDUPDATE messages and records the source process, clipboard formats present (CF_HTML vs CF_UNICODETEXT), content length, and a preview of the content for every clipboard change.
Execution Surface Detection — Identifies when the foreground window is a command execution surface: the Run dialog (Win+R), cmd.exe, powershell.exe, pwsh.exe, or Windows Terminal.
Keyboard Hook (Ctrl+V Interception) — A low-level keyboard hook (WH_KEYBOARD_LL) intercepts Ctrl+V keystrokes. When a paste is attempted into an execution surface with browser-sourced clipboard content, ClipGuard evaluates the threat.
Format-Based Verdict — If the clipboard content came from a browser and contains text only (no CF_HTML), it flags as suspicious — indicating a likely JavaScript clipboard write rather than user-initiated copy( no HTML indicator). The paste is blocked and the user sees an alert with the clipboard contents before deciding to allow or block.
Clipboard updated by browser?
-- YES: User pastes (Ctrl+V) into execution surface?
-- YES: Clipboard has CF_UNICODETEXT only (no CF_HTML)?
-- YES: BLOCK — Suspected ClickFix (JS clipboard write)
-- NO: Strict Mode on?
-- YES: WARN — User copy, but going to exec surface
-- NO: ALLOW
Edge, Chrome, Firefox, Brave, Opera, Vivaldi, Chromium, Arc
Prerequisites:
Build from source:
git clone https://github.com/CertainlyP/ClipGuard.git
cd ClipGuard
dotnet build -c Release
Or download the compiled binary from the Releases page.
When a suspicious paste is detected, ClipGuard shows an alert with the clipboard content preview, source process and PID, clipboard format analysis, and the option to block or allow the paste.
Logs are written to %APPDATA%\ClipGuard\shield.log
This tool is based on original research into ClickFix attack mechanics:
MIT