Skip to main content
T1059Executionmedium difficulty

Command and Scripting Interpreter

Because interpreters such as PowerShell, cmd.exe, bash, WMI, and Python ship on every host and are trusted by most controls, adversaries favor them for execution, a pattern defenders call living off the land. The detection value lies in context rather than the binary itself: an interpreter spawned by Office or a browser, Base64-encoded or execution-policy-bypass flags, and script-block logs revealing download cradles or command-and-control callbacks moments after launch.

Practice detecting Command and Scripting Interpreter on realistic XDR, SIEM alerts in SOCSimulator Operations.

XDRSIEM

What is Command and Scripting Interpreter?

Command and Scripting Interpreter is documented as technique T1059 in MITRE ATT&CK® v19.1 under the Execution tactic. Detection requires visibility into XDR, SIEM telemetry.

Detection Strategies

The following detection strategies help SOC analysts identify Command and Scripting Interpreter activity. These methods apply across XDR, SIEM environments and can be implemented as detection rules, correlation queries, or behavioral analytics in your security platform.

  1. 1

    Enable PowerShell script block logging and module logging to capture the full decoded content of executed scripts, including deobfuscated payloads that may not be visible in process command line arguments alone.

  2. 2

    Monitor for command interpreter processes spawned by unusual parent processes such as Microsoft Office applications, web browsers, email clients, or PDF readers, which strongly suggests malicious document-based execution.

  3. 3

    Detect encoded PowerShell commands by alerting on process creation events containing -EncodedCommand, -enc, or -e flags, followed by Base64-encoded strings, which is a common technique for bypassing simple string-based detection.

  4. 4

    Alert on the use of cmd.exe or PowerShell with flags designed to bypass execution policy or disable security features, such as -ExecutionPolicy Bypass, -NonInteractive, -WindowStyle Hidden, or -NoProfile.

  5. 5

    Correlate scripting interpreter activity with network connections initiated shortly after execution to identify scripts performing download-cradle operations or establishing command-and-control communications.

Example Alerts

These realistic alert examples show what Command and Scripting Interpreter looks like in your security tools. Use them to tune detection rules and train analysts to recognize true positives versus false positives in live environments.

HighXDR

Encoded PowerShell Command Execution

PowerShell process launched with -EncodedCommand flag containing Base64-encoded payload that decodes to a download cradle fetching content from pastebin.com. Parent process is winword.exe, indicating macro-based execution. The downloaded script attempts to disable Windows Defender real-time protection before executing the second-stage payload.

HighXDR

cmd.exe Spawned by Browser Process

Windows Command Shell was spawned as a child process of chrome.exe following navigation to a site serving a drive-by download. Command line arguments include net user and whoami reconnaissance commands, followed by a PowerShell download of a remote access tool from a domain registered 3 days ago.

MediumSIEM

Suspicious WMI Script Execution

WMI was used to execute a VBScript payload on 15 systems within the environment over a 10-minute window. The script connects to an external IP address and downloads a DLL file that is loaded into memory using regsvr32.exe. The lateral spread pattern and timing suggest automated execution by a worm or post-exploitation framework.

Frequently Asked Questions

How do SOC analysts detect Command and Scripting Interpreter?
Detection centers on XDR, SIEM telemetry for the execution phase of the attack. Enable PowerShell script block logging and module logging to capture the full decoded content of executed scripts, including deobfuscated payloads that may not be visible in process command line arguments alone. Monitor for command interpreter processes spawned by unusual parent processes such as Microsoft Office applications, web browsers, email clients, or PDF readers, which strongly suggests malicious document-based execution.
What does a Command and Scripting Interpreter alert look like?
A representative XDR detection is "Encoded PowerShell Command Execution" (high severity): PowerShell process launched with -EncodedCommand flag containing Base64-encoded payload that decodes to a download cradle fetching content from pastebin.com. Parent process is winword.exe, indicating macro-based execution. The downloaded script attempts to disable Windows Defender real-time protection before executing the second-stage payload.
Which tools detect Command and Scripting Interpreter, and how can I practice?
Command and Scripting Interpreter (T1059) is best surfaced with XDR, SIEM telemetry, which exposes the execution signals described above. Practice detecting it on those exact consoles in SOCSimulator Operations, free.
Glossary

What is IOC? SOC Glossary

An Indicator of Compromise (IOC) is an observable artifact, such as a file hash, IP address, domain name, URL, registry …

Read more
Glossary

What is EDR? SOC Glossary

Endpoint Detection and Response (EDR) is a security technology that continuously monitors endpoint activity, recording p…

Read more
Glossary

What is Alert Triage? SOC Glossary

Alert triage is the structured process of reviewing, prioritizing, and investigating security alerts to determine their …

Read more
Glossary

What is TTPs? SOC Glossary

Tactics, Techniques, and Procedures (TTPs) describe the behavioral patterns, methods, and operational processes threat a…

Read more
Career Path

SOC Analyst (Tier 2) Career Guide: Salary & Skills

Tier 2 SOC Analysts handle the investigations that Tier 1 escalates. You dig into multi-stage attacks, coordinate contai…

Read more
Career Path

Incident Responder Career Guide: Salary & Skills

Incident Responders lead the technical response when confirmed breaches happen. You coordinate containment, run forensic…

Read more
Tool

XDR Training Console: SOCSimulator

The XDR console in SOCSimulator replicates the investigation workflow of platforms like CrowdStrike Falcon, Microsoft De…

Read more
Tool

SIEM Training Console: SOCSimulator

The SIEM console in SOCSimulator replicates the workflow of enterprise platforms like Splunk Enterprise Security, Micros…

Read more
Comparison

SOCSimulator Vs. Letsdefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Playbook

Lateral Movement Investigation: Investigation Playbook

When alerts indicate unusual internal connections, RDP to servers from workstations, PsExec executions, or SMB access to…

Read more
Playbook

Ransomware Activity Investigation: Investigation Playbook

When indicators suggest ransomware, mass file encryption, suspicious process behavior, ransom notes, or shadow copy dele…

Read more
Playbook

Suspicious Process Execution Investigation: Investigation Playbook

When XDR or EDR alerts on suspicious process execution, unusual parent-child relationships, encoded command lines, or pr…

Read more