← All posts
Ecliptica Labs6 min read

Unit 42: agentic attackers left chain-of-thought comments in their payloads

Unit 42 published an analysis this week of more than 10 campaigns between July and September 2026 in which attackers handed the work to autonomous agents. The targets ranged across government, logistics, hospitality, manufacturing, agriculture, and education. Every campaign started the same way: a web shell on a vulnerable web application.

The techniques were not new. Unit 42 says so directly. What changed is that a human sets the objective and the agent carries it, at a pace no operator can match, and leaves a forensic trail that reads like a transcript of its own reasoning.

The division of labor

The pattern Unit 42 describes has five beats:

  1. A human picks the target and provides initial access, usually a web shell. Sometimes the human runs the first assessment.
  2. The agent takes over for reconnaissance, credential harvesting, privilege escalation, and lateral movement.
  3. The agent reports findings in machine-readable formats and checks in with an orchestration API.
  4. The human reviews and sets the next strategic goal, such as going after the payment system or establishing persistence.
  5. The agent executes with tactical autonomy.

That is a management relationship, not a chatbot session. It also explains why the agents behaved like a competent operator rather than a script: someone was choosing the objectives, and the loop handled everything between them.

Speed is the tell

The numbers are the most quotable part of the report:

  • One intrusion ran 140 minutes across two days, during which the agent executed about 800 unique commands while enumerating the victim’s cloud environment, website, and databases.
  • Another campaign produced more than 8,000 unique commands over 12 days.
  • In the subset where Unit 42 could separate phases, human-led reconnaissance had a median gap of 23.9 seconds between commands. After the operation moved to the agent, it was 1.4 seconds.

A human who types that fast is not reading output. A machine that types that fast is not hiding in it.

What the agents wrote

Three artifacts showed up repeatedly:

  • Section headers such as ===[Title]=== around command output, which help a model parse results. Humans rarely bother.
  • Reasoning comments inside scripts — conversational, step-by-step notes explaining what the code was doing and why. Unit 42 found them in more than half the campaigns.
  • Base64 payload volume. Encoding through a web shell is normal. What is not normal is 40 to 100 unique encoded payloads in a single session, each tailored to that target, with no two identical and none matching a known tool hash.

Adaptation, measured in seconds

The report’s best case studies are about recovery from failure.

In one campaign against a hospitality and gaming company, the agent found an EC2 instance role and went for the metadata service. IMDSv1 was blocked, so it switched to IMDSv2 token acquisition and got in after a few attempts. It then enumerated 20 AWS services across eight regions, and once it spotted S3 bucket names in config files, it went straight for payment and financial paths. Unit 42 assesses the agent was told to prioritize financial assets, and that it was only collecting — it tested write access, deleted its test files, and checked bucket policies and ACLs.

In another intrusion, the agent compromised a Linux server via a PHP web shell, pivoted to a Windows IIS server with stolen SMB credentials, and within two minutes of finding it was deploying ASPX shells over SMB. Over the next 26 minutes it pushed web shells to more than 40 locations across that server, rotating five variants and uploading custom web.config files to enable execution.

Elsewhere, a port sweep produced scan.sh, and 21 seconds later the agent ran scan2.sh with commands tailored to exactly the technologies the first script had found.

The most strategic example: after compromising a victim’s web server, the agent found credentials for the victim’s IT vendor’s self-managed GitLab, pivoted to it, mapped the vendor via WHOIS, and brute-forced access using the real names of marketing staff. It did not exploit GitLab. Separately, the NGINX virtual-host config revealed more than a dozen sister companies on the internal network, which it then probed with stolen credentials, harvested CSRF tokens, and hit with four SQL injection attempts.

They knew what was watching

Agents in several campaigns treated security tooling as part of the environment to be understood, not just avoided:

  • Excluding EDR directories (traps, rapid7, microsoft) from find commands across six endpoints.
  • Enumerating 16 scanners — nmap, nessus, openvas, nikto, masscan, nuclei, lynis, and others — to map the defensive stack.
  • Running strace against Microsoft Defender’s wdavdaemon process to see how it monitors activity.
  • Trying to exfiltrate a security product’s local directory in search of stored credentials.

That is a meaningful escalation. Automated attacks do not debug their blockers.

What wasn’t there

No compiled backdoors. No custom C2 framework, DLL implant, or shellcode loader. Hundreds of payloads, and the arsenal was single-use scripts: PHP web shells, a PowerShell WMI backdoor, Python credential harvesters.

And when a known tool would do, the agent used it first. Unit 42 saw it download the Copy Fail exploit (CVE-2026-31431) from the project’s GitHub and website across three organizations. In another case it tried PwnKit, then CVE-2024-1086, then wrote C on the target, then rewrote the exploit in Python when compilation failed.

Attribution still hangs on human mistakes

Static signatures are close to useless when every payload is purpose-built. Unit 42 points instead at intent, operational slips, and infrastructure:

  • A hard-coded C2 address, 204.194.54.240, appeared in both PowerShell download cradles and cURL probes. That host was also serving a CyberStrikeAI instance, which is the kind of fact behavior alone will not give you. GTIG flagged the same framework in its quarterly tracker, and ReliaQuest tied the same IP to a separate agent-driven intrusion.
  • One operator accidentally pasted a local path into a payload: /home/kali/exploitmasteryai/targets/warranty/shell5.php. That single string is the only direct evidence of the framework’s name across the campaign.
  • Code comments leaked the language the operator used. Two versions of the same WMI backdoor exist, one with Chinese comments and one generated with English-only comments.

What to hunt

  • Inter-command timing. Gaps under a few seconds across reconnaissance and exploitation phases are the clearest non-human marker, and they survive changes in tooling.
  • Output structure. Section headers and delimiters inside shell output are cheap to match and hard for an operator to suppress while staying productive.
  • Narration in payloads. Review scripts for step-by-step natural-language comments. In an incident, those comments reconstruct the agent’s plan for you.
  • Base64 variety. A burst of unique encoded payloads in one session is a different signal from a handful of reusable tools.
  • Security-tool introspection. find commands that exclude vendor directories, scanner enumeration, and strace against an EDR process should all fire on their own.

Ecliptica Replay records the same kind of evidence on your side of the wire: every command an agent runs, its arguments, its output, and the gaps between them, with alerts when the sequence stops matching the task. Unit 42 reconstructed this campaign from logs and script comments. You can have that timeline in real time instead.

Ecliptica Labs

Threat intelligence and AI security software, backed by consulting and managed security services.