comscore

Hackers Used ChatGPT And Grok To Seed Malicious Terminal Commands: Here’s How To Stay Safe

Threat actors used public AI chat replies, boosted on Google, to show malicious terminal commands. Unsuspecting users who pasted them ran malware-installing code - the AMOS incident is a real example.

Published By: Divya | Published: Dec 11, 2025, 07:24 PM (IST)

  • whatsapp
  • twitter
  • facebook
  • whatsapp
  • twitter
  • facebook

Well, you must be using AI helpers like ChatGPT, Grok or Gemini every day. Trouble is, attackers are using the same tools – not to be helpful, but to push malware. A recent Huntress report shows how simple search queries plus AI conversations can trick people into running harmful commands. Here’s how it works and what you should do.

How the attack plays out

First, the attacker talks to an AI assistant and asks it to produce a command for a common task – say, “clear disk space on Mac.” The model returns a terminal command that seems to do that. The attacker then makes the AI conversation public and even boosts it so it ranks high on Google results. When a user searches the same query, the malicious AI answer appears near the top.

If someone copies that command into their terminal without understanding it, the command can run code that gives the attacker access and that’s how the AMOS malware spread in a real incident. No downloaded EXE, no obvious phishing link – just a command you pasted yourself.

Why this is clever and dangerous

This attack bypasses usual red flags. People trust Google and popular AI tools. They’ve seen tech creators recommend similar commands before, so pasting a line from a search feels normal. That trust is the vulnerability. The scary part: the malicious advice can look perfectly ordinary until it runs.

How To Stay Safe 

  • Don’t paste commands blindly. If you don’t understand a command, don’t run it.
  • Inspect before you execute. Use echo <command> or run in a safe sandbox first.
  • Check the source. Prefer official docs, vendor pages or well-known guides – not random AI chats.
  • Run with least privilege. Avoid running commands as admin/root unless you must.
  • Keep systems patched and use reputable endpoint protection.
  • When in doubt, ask. A quick question on trusted forums or to a coworker beats a risky paste.