Command Zero
Briefing by Agent Zero
Criticalrun-b33377f1-fa30-4b19-bb8f-ac3bd1c0b8d0
Malicious Insider Activity
High confidence
  • insider-threat
  • credential-harvesting
  • data-exfiltration
  • evidence-destruction
  • aws-abuse
  • macos

Insider Used Claude Code AI Agent to Harvest Credentials, Exfiltrate HR Data, and Destroy Evidence Before Departure

Account user_1 on macOS device ws-001 used the Claude Code AI coding assistant to direct a sustained series of commands, all under local interactive sessions, that collectively constitute credential harvesting, sensitive HR data collection via obfuscated remote execution, EC2 infrastructure termination, crontab modification of another user, deletion of personal compensation files, and evidence…

AUTONOMOUS INVESTIGATIONCommand Zero · Agent Zero
7m 39s
INVESTIGATION TIME
Autonomous
43
QUESTIONS ASKED
MICROSOFT 365 DEFENDER, MICROSOFT DEFENDER XDR, MICROSOFT DEFENDER FOR ENDPOINT, MICROSOFT ENTRA
633
RECORDS ANALYZED
Across all data sources
~5 hrs
HUMAN ANALYSIS
Tier-2 equivalent *
~$453
ANALYST COST SAVED
At $85/hr loaded rate *

Time and cost estimates are based on a Tier-2 SOC analyst model and actual investigation telemetry. Individual results vary by analyst experience, tooling, and environment.

Initial Signal

On September 30, 2026, Microsoft Defender for Endpoint triggered an alert on macOS device ws-001 for account user_1: "Suspicious access of sensitive files." The alert captured a grep command, executed through the Claude Code AI coding assistant, searching ~/.zsh_history for credential patterns. The full command observed was: grep -E 'token|secret|password|api_key|aws_key|Bearer' ~/.zsh_history. This is MITRE T1552.003 (Unsecured Credentials: Bash History).

What made this signal worth investigating was not just the single grep command, but the pattern it revealed when correlated with subsequent process creation records. Over the next three days, the same account, operating through Claude Code sessions, executed commands to scan a file named credentials_[REDACTED].md for AWS keys and GitHub tokens (e.g., grep -E 'AWS_|GITHUB_TOKEN|ghp_' ~/credentials_[REDACTED].md), read a secrets file at ~/.claude/.[user_1_file_1]_secrets.txt, send base64-encoded Python scripts via AWS SSM to extract HR employee data from a Docker container (accessing HR_employees.db, HR_role_info.db, and HR_emp_structure.db), terminate EC2 instances using multiple AWS profiles, modify another user's crontab with administrator privileges, delete personal compensation files (user1_compensation_[REDACTED].xlsx, Paystub.pdf, user1_letter_[REDACTED].pdf), and execute cleanup scripts. All commands appeared in MDE process creation records; none were blocked.

The use of Claude Code as an AI agent to orchestrate these actions is operationally significant: the insider directed the AI assistant to perform multi-stage malicious tasking (credential harvesting, data collection, infrastructure destruction, and evidence cleanup), reducing manual effort and increasing the breadth and speed of the operation.

The investigation spanned 7 minutes 39 seconds of autonomous analysis across 43 invocations querying Microsoft Defender XDR, Defender for Endpoint, and Microsoft Entra, correlating 633 records to establish that all logon events were local-only, all commands executed successfully, and the activity pattern was consistent with a departing insider acting with deliberate knowledge of unauthorized intent.

The Questions We Asked

What follows is the path the agent walked to reach its verdict. Pivots and dead ends both made the cut. Routine steps that just ruled out the obvious are grouped together so you can skim past them.

Q1

Did anyone already triage this?

Negative finding
Supporting Evidence
No analyst notes explain this activity as authorized or requiring no further action
High
Conclusion:Not Documented as Benign·Documented as Requiring No Action
Q2

Could this be normal work?

Pivot
What are the details of this Microsoft Defender for Endpoint alert?1 record
Supporting Evidence
The grep command, executed via Claude Code, searches shell history for credentials: grep -E 'token|secret|password|api_key|aws_key|Bearer' ~/.zsh_history. This is credential harvesting behavior (MITRE T1552.003), not normal business operations.
High
Supporting Evidence
Multiple categories of suspicious activity confirmed via Claude Code sessions: deleting personal compensation files (user1_compensation_[REDACTED].xlsx, Paystub.pdf), modifying user_2 crontab entries, and terminating EC2 instances; none of these constitute normal business operations.
High
Supporting Evidence
AWS SSM commands send base64-encoded Python scripts to a remote EC2 instance to access HR data (HR_employees.db, HR_role_info.db, HR_emp_structure.db), employee names, job titles, departments, and org hierarchy accessed outside normal HR systems.
High
Conflicting Evidence Resolved
The commands are executed by Claude Code (AI coding assistant), which could be a legitimate tool used by a developer. The user user_1 appears to be a developer with AWS access.
Low
Conclusion:Deviates from Normal Operations·Aligns with Normal Business Operations
Q3

Does this fall outside the user's role?

Pivot
What processes with this SHA256 were created according to Microsoft Defender for Endpoint?100 records
Supporting Evidence
Multiple activities outside any legitimate role scope, all executed via Claude Code: scanning credentials_[REDACTED].md for secrets (grep -E 'AWS_|GITHUB_TOKEN|ghp_' ~/credentials_[REDACTED].md), searching for salary/compensation files in [user_1_dir_1], modifying user_2 crontab, and running cleanup scripts; these collectively indicate malicious insider activity.
High
Supporting Evidence
Accessing HR employee data via base64-encoded remote execution to extract org charts and QA team structures (HR_employees.db, HR_emp_structure.db) is not within the expected scope of any normal role, even a senior technical role.
High
Conflicting Evidence Resolved
The user has AWS profiles named [user_1_profile_3], [user_1_profile_1], and [user_1_profile_2], suggesting a senior technical role that might legitimately access AWS infrastructure and some organizational data.
Low
Conclusion:Outside Expected Role Scope·Within Expected Role Scope
Q4

Does the data access exceed the role?

Pivot
What Microsoft Defender for Endpoint alerts have been triggered for this Machine ID?2 records
Supporting Evidence
Accessing HR employee data (HR_employees.db, HR_role_info.db, HR_emp_structure.db) via base64-encoded remote execution scripts is not aligned with any core role responsibility; this is HR data that should only be accessed through proper HR systems.
High
Supporting Evidence
The user accessed credentials_[REDACTED].md (scanning it for secrets via Claude Code) and deleted personal compensation files (user1_compensation_[REDACTED].xlsx, Paystub.pdf); these are not core responsibilities of any role and indicate credential collection and evidence destruction.
High
Conflicting Evidence Resolved
The user has senior-level AWS profiles, which could suggest legitimate access to some infrastructure data.
Low
Conclusion:Data Access Exceeds Role·Data Access Aligns with Role
Q5-Q7

Three checks, mostly ruling out benign explanations.

Supporting Evidence
Multiple clear policy violations executed via Claude Code: accessing and scanning credentials_[REDACTED].md and ~/.claude/.[user_1_file_1]_secrets.txt, deleting compensation documents (user1_compensation_[REDACTED].xlsx, Paystub.pdf), modifying another user's crontab with admin privileges, and terminating EC2 instances.
High
Conclusions:Not Explained by Legitimate Operations·Not Benign User Error·Attempted Policy Violation
Q8

Did anything actually stop?

Pivot
What Microsoft Defender for Endpoint alerts have been triggered for this Machine ID?2 records
Supporting Evidence
The primary credential access alert ('Suspicious access of sensitive files') has status 'New'; it has not been resolved or blocked by security controls.
High
Supporting Evidence
No antivirus/antimalware detections on the device, indicating security controls did not detect or block the malicious activity.
Moderate
Supporting Evidence
The malicious commands (EC2 termination, credential file scanning via Claude Code, crontab modification) appear in process creation records, confirming they executed successfully without being blocked.
High
Conflicting Evidence Resolved
The second alert ('Suspicious Python command-line execution') has status 'Resolved', which could suggest security controls addressed it.
Low
Conclusion:Security Controls Did Not Block·Security Controls Blocked Violation
Q9

Do we have enough to call it?

What are the details of this Microsoft Defender for Endpoint alert?1 record
Supporting Evidence
The alert evidence directly shows the credential harvesting command executed via Claude Code (grep -E 'token|secret|password|api_key|aws_key|Bearer' ~/.zsh_history), providing sufficient evidence to make a determination.
High
Supporting Evidence
Multiple independent data points confirm the activity: EC2 termination, credential file scanning (credentials_[REDACTED].md), crontab modification, and personal file deletion (user1_compensation_[REDACTED].xlsx, Paystub.pdf), sufficient evidence to make a determination.
High
Supporting Evidence
The HR data access via base64-encoded remote execution (HR_employees.db, HR_role_info.db, HR_emp_structure.db) provides additional corroborating evidence of the scope and intent of the activity.
High
Conclusion:Sufficient Evidence for Determination·Insufficient Evidence
Q10

Is there malware on the system?

Pivot
What threats were detected by antivirus on this device according to Microsoft Defender for Endpoint?
Supporting Evidence
No antivirus/antimalware detections on the device; no malware, trojans, backdoors, or exploit kits were detected by endpoint protection.
High
Supporting Evidence
The alert has no associated threat family or threat name, indicating this is not a known malware family; the activity involves legitimate tools (zsh, grep, Python, AWS CLI, Claude Code) used maliciously.
High
Conflicting Evidence Resolved
The ssm_exec_[REDACTED].sh script was created in Claude Code's scratchpad, copied to the user's home directory, and executed with administrator privileges via osascript; this could be considered malicious code created and executed on the system.
Low
Conclusion:No Malware or Malicious Software·Malware or Malicious Software Present
Q11

Is the account owner responsible?

Pivot
What machine logon events exist for this device according to Microsoft Defender for Endpoint?17 records
Supporting Evidence
All 17 logon events are successful local interactive logins via loginwindow; this is the legitimate account owner logging into their own Mac, not an external attacker.
High
Supporting Evidence
The user is deleting their own personal compensation files (user1_compensation_[REDACTED].xlsx, Paystub.pdf); this confirms user_1 IS user_1, the legitimate account owner acting with their own credentials.
High
Supporting Evidence
The user directed Claude Code to scan credentials_[REDACTED].md for secrets and to modify another user's crontab with admin privileges; these are actions the user could reasonably be expected to know are unauthorized and malicious.
High
Conflicting Evidence Resolved
No platform intel documents an authorized offboarding process that would explain the credential collection and cleanup activities as legitimate.
Moderate
Conclusion:Authorized User with Legitimate Credentials·Unauthorized Actor or Stolen/Invalid Credentials
Q12

Is there evidence of deliberate malicious intent?

Pivot
What processes with this SHA256 were created according to Microsoft Defender for Endpoint?100 records
Supporting Evidence
All four indicators of malicious intent are present: systematic credential collection (credentials_[REDACTED].md scanned via Claude Code), concealment via cleanup scripts, access outside role (user_2 crontab modification), and evidence destruction (deleting user1_compensation_[REDACTED].xlsx, Paystub.pdf).
High
Supporting Evidence
Accessing HR data via base64-encoded obfuscated remote execution commands (HR_employees.db, HR_role_info.db, HR_emp_structure.db) sent through AWS SSM demonstrates both systematic collection and deception; the obfuscation is a deliberate attempt to conceal the nature of the data access.
High
Conflicting Evidence Resolved
No platform intel documents an authorized offboarding or cleanup process that would explain these activities as legitimate.
Low
Conclusion:Evidence of Malicious Intent·No Evidence of Malicious Intent
Q13

Are sensitive resources involved?

What Microsoft Defender for Endpoint alerts have been triggered for this Machine ID?2 records
Supporting Evidence
HR employee data (HR_employees.db, HR_role_info.db, HR_emp_structure.db) is sensitive HR data containing personal information about all employees including names, job titles, departments, locations, and org hierarchy.
High
Supporting Evidence
The ~/.claude/.[user_1_file_1]_secrets.txt file and credentials_[REDACTED].md are explicitly credential/secrets files; accessing and scanning these for AWS keys, GitHub tokens, and API keys involves highly sensitive credential data.
High
Supporting Evidence
EC2 instances in the production AWS environment are sensitive infrastructure; terminating them can cause service disruption and data loss.
High
Conclusion:Sensitive Data or Systems Involved·Non-Sensitive Data or Systems

Key Pivots

Detection Opportunities

The high-fidelity detection signals from this investigation, sanitized for general use. Each MITRE ID links to the official technique reference.

Suspicious access of sensitive filesSuspicious Python command-line executionSuspicious crontab modificationEC2 instance terminationSensitive file deletion
TechniqueTacticContext
T1552.003
Unsecured Credentials: Bash History
Credential AccessFlag grep, cat, or find commands targeting shell history files (.zsh_history, .bash_history, .history) or credential-related file names (secrets, credentials, tokens, keys). Alert on patterns searching for credential indicators like 'token', 'secret', 'password', 'api_key', 'aws_key', or 'Bearer'. Baseline normal shell history access and alert on deviations, especially when combined with subsequent data exfiltration or cleanup commands. Pay particular attention when these commands are spawned as child processes of AI coding assistants such as Claude Code.
T1059.006
Command and Scripting Interpreter: Python
ExecutionMonitor for Python processes spawned with base64-encoded arguments or scripts, especially when invoked via AWS SSM send-command or similar remote execution mechanisms. Alert on Python scripts that access database files, database connections, or HR/personnel data stores. Flag patterns where Python is used to read sensitive data files and pipe output to encoding utilities (base64, gzip) before transmission. Alert when such processes are initiated by AI coding assistant processes (e.g., Claude Code) rather than interactive terminal sessions.
T1053.006
Scheduled Task/Job: Cron
PersistenceAlert on crontab modifications by users with elevated privileges targeting other users' cron jobs. Flag removal or modification of scheduled tasks, especially those related to logging, monitoring, or security tools. Monitor for crontab edits that occur in conjunction with credential harvesting or file deletion activities. Establish baseline crontab entries and alert on unexpected changes.
T1531
Account Access Removal
ImpactMonitor AWS CloudTrail for ec2:TerminateInstances API calls from unusual accounts or profiles, especially those not typically associated with infrastructure management. Alert on bulk terminations or terminations of instances tagged as production or critical. Correlate with other suspicious activities like credential access or data exfiltration in the same time window.
T1070.004
Indicator Removal: File Deletion
Defense EvasionFlag deletion of files with names matching compensation, payroll, or personal financial patterns (Paystub, salary, bonus, compensation, expense). Alert on bulk file deletions in home directories or shared drives, especially when preceded by credential access or data collection activities. Monitor for use of secure deletion utilities (shred, srm) or rm commands with force flags on sensitive file types.

Verdict Reasoning

The verdict of Malicious Insider Activity at high confidence rests on the following mutually corroborating signals:

1. Credential harvesting confirmed by grep commands targeting shell history and credentials_[REDACTED].md for tokens, secrets, passwords, and API keys, a known attack technique (T1552.003) not consistent with normal development work

2. HR data exfiltration via base64-encoded remote execution scripts sent through AWS SSM to access HR_employees.db, HR_role_info.db, and HR_emp_structure.db, sensitive personal information accessed outside normal HR systems

3. Infrastructure destruction through EC2 instance termination using multiple AWS profiles, combined with crontab modification of another user and deletion of personal compensation files (user1_compensation_[REDACTED].xlsx, Paystub.pdf, user1_letter_[REDACTED].pdf), a multi-category pattern of evidence destruction and sabotage

4. All 17 logon events are local interactive sessions via loginwindow, confirming the legitimate account owner (not an external attacker) performed these actions

5. All commands were executed through Claude Code, the AI coding assistant, which the insider used to delegate and accelerate multi-stage malicious tasking

6. No security control blocked any activity, and all commands appear in process creation records confirming execution. Confidence is High rather than Confirmed because the inference that user_1 directed these commands (rather than, for example, a sophisticated prompt injection attack that caused the Claude Code AI agent to act autonomously) rests on local-only logons and personal file deletion, not direct attestation; additionally, no platform intelligence confirms or denies an authorized offboarding process that could explain some subset of the activity

Lessons

  1. 01
    Legitimate tools in malicious hands require behavioral context. This investigation involved only standard macOS utilities (grep, zsh, Python, AWS CLI) and legitimate cloud services (AWS SSM, EC2), orchestrated through the Claude Code AI coding assistant. No malware was detected. The malicious intent emerged from the pattern of activity (credential harvesting, HR data exfiltration via obfuscation, infrastructure destruction, and evidence cleanup), not from the tools themselves. Detection strategies that rely solely on file reputation or known malware signatures will miss insider threats. Correlate process creation events across multiple categories (credential access, data collection, infrastructure changes, file deletion) to identify the behavioral pattern, not just individual commands.
  2. 02
    AI coding assistants can be directed to perform multi-stage malicious tasking. In this case, the insider used Claude Code, Anthropic's AI coding assistant, to orchestrate credential harvesting, HR data exfiltration, infrastructure destruction, and evidence cleanup across a four-day window. Claude Code is a legitimate, widely-used developer tool; its presence in process creation records is not itself suspicious. What is suspicious is the nature of the commands it spawns: grep against shell history for credential patterns, base64-encoded Python payloads sent via AWS SSM, EC2 termination calls, and crontab modifications targeting other users. When investigating insider threat activity on developer endpoints, enumerate child processes of AI coding assistant binaries (claude, cursor, copilot, etc.) with the same scrutiny you would apply to any other process. The AI assistant reduces the manual effort required to execute multi-stage operations and can increase the breadth and tempo of malicious activity.
  3. 03
    Base64 encoding is a red flag for data exfiltration, not obfuscation. The insider directed Claude Code to send Python scripts via AWS SSM send-command with base64-encoded payloads to access HR employee data stored in database files (HR_employees.db, HR_role_info.db, HR_emp_structure.db). Base64 is not encryption (it's easily decoded), but its presence in command-line arguments is a strong signal of deliberate concealment. When you see base64-encoded data in process creation records, especially in conjunction with cloud API calls or remote execution mechanisms, decode it immediately. In this case, the decoded payloads revealed direct access to database files containing employee names, job titles, and organizational hierarchy.
  4. 04
    Personal file deletion is evidence destruction, not cleanup. The account deleted files named Paystub.pdf, user1_compensation_[REDACTED].xlsx, and user1_letter_[REDACTED].pdf, personal compensation documents. This is not routine file management. When you see deletion of personal financial or HR-related files in the same timeframe as credential harvesting and infrastructure sabotage, treat it as evidence destruction. The combination of credential collection, HR data exfiltration, and personal file deletion is a strong indicator of a departing insider acting with knowledge of unauthorized intent.
  5. 05
    Local-only logons don't rule out malicious intent. All 17 logon events for this account were successful local interactive sessions via loginwindow, no remote access, no credential compromise. This confirmed the legitimate account owner performed the actions, not an external attacker. However, local-only logons do not indicate benign activity. An authorized user with legitimate credentials can still act maliciously. The presence of local-only logons should shift your investigation focus from 'who is this?' to 'why would they do this?' and 'what are they trying to hide?'
  6. 06
    Crontab modification of other users is a privilege escalation red flag. The account modified user_2's crontab with administrator privileges to remove entries from monitor_cleanup_[REDACTED].sh. This is not a normal administrative task; it's targeted tampering with another user's scheduled jobs. When you see one user modifying another user's cron jobs, especially with elevated privileges and in the context of other suspicious activity, treat it as an attempt to disable monitoring, logging, or security controls. Establish baseline crontab entries and alert on unexpected modifications, particularly removals.