Skip to content
Go back

Shipping ClipShield, a Browser Extension That Blocks ClickFix and Clipboard Attacks

Why I built it

I built ClipShield after seeing the same fake verification trick too many times: a web page tells someone to copy a command into PowerShell, Terminal, or the Run dialog.

I wanted the browser to catch that handoff before the command was pasted.

I have seen loved ones, close friends, and more than a few people through work get pulled into the same fake verification flow. A page says there is one more step. It tells them to open PowerShell or Terminal. It hands them a command. From there, things can go sideways very quickly.

That moment between copying and pasting is where ClipShield tries to step in.

The first version came together quickly, and yes, I leaned into vibe coding for parts of it. Anton Ovrutsky’s ClaudeForBlueTeam tweets nudged me to try LLMs for the blue team side of the build. I used them to move through ideas faster, then tested and revised the detection logic myself.

vibing

Me vibing while I push Claude to its limit.

tokenless

A lot of the early iteration was fast, messy, and surprisingly productive.

What ClipShield actually does

ClipShield looks for fake verification flows, ClickFix-style lures, malicious clipboard payloads, and familiar LOLBAS and LOLBIN execution patterns.

When it finds a suspicious command, it tries to clear the clipboard before the user can paste it.

The first layer is straight detection:

function analyzeClipboard(rawText) {
  const text = deobfuscate(rawText.trim());
  const matches = [];

  for (const rule of DETECTION_RULES) {
    if (rule.pattern.test(text)) matches.push(rule.description);
  }

  return { threat: matches.length > 0, detectedItems: matches };
}

That means cleaning up obvious obfuscation first, then checking the clipboard against 240 rules for things like curl | bash, mshta, powershell -enc, iex(iwr ...), LOLBAS-style chains, and known ClickFix patterns gathered from open source reporting and shared community telemetry.

The commands tend to recur with small changes in wording or obfuscation, so deobfuscation comes before the rule checks.

The second layer replaces a flagged clipboard payload with a safe placeholder:

if (message.action === 'clearClipboard') {
  const safeText = '[BLOCKED] Malicious payload intercepted and cleared by ClipShield.';
  navigator.clipboard.writeText(safeText).catch(() => {
    area.value = safeText;
    area.focus();
    area.select();
    document.execCommand('copy');
  });
}

ClipShield monitors copied text and script-driven clipboard writes. When it flags a payload, it replaces the command before it reaches PowerShell, Terminal, or the Run dialog.

That replacement is the part I care about most.

The third layer is DOM scanning, because these pages often expose themselves before the clipboard is even touched:

if (hasClickFixLure) detectedItems.push('ClickFix lure phrase found');
if (hasCommandInstruction) detectedItems.push('Command execution instructions detected');
if (overlayInfo.blocksInteraction) detectedItems.push('Interaction-blocking CSS detected');

ClipShield checks for lure phrases, fake verification prompts, suspicious overlays, and inline clipboard-write scripts that push users toward copying a command.

The DOM checks can flag a page before anyone touches the clipboard.

popup

The extension popup shows what was blocked, where it happened, and why it was flagged.

Zero telemetry means zero telemetry

This part was non-negotiable for me.

Nothing leaves the machine. No analytics. No usage stats. No “anonymous” collection that somehow grows into a product dashboard later. Clipboard content, page signals, settings, and alert history stay local.

The extension watches for clipboard abuse, so collecting browsing data in the background would be a poor trade. I kept the data on the user’s machine.

Open source, on purpose

ClipShield is open source because I want people to inspect it properly. Audit the detections. Check the logic. Tell me if a rule is noisy. Tell me if I missed something. If you want to improve it, send a PR.

Repo: https://github.com/xorjosh/ClipShield Edge: Download

endbanner


Share this post on:

Previous Post
The Chrome Extension Economy, and How Trust Gets Hijacked
Next Post
Inside a Low-Budget Spyware Operation