Microsoft Defender XDR • DeviceProcessEvents • PowerShell Investigation

The EncodedCommand Was Buried In Noise

The endpoint looked healthy.

No high-severity alert fired. No ransomware was detected. No incident was created.

But inside thousands of normal process events, one PowerShell EncodedCommand was waiting to be found.

The command was not hidden by encryption. It was hidden by noise.

Agent Foskett investigation into PowerShell EncodedCommand activity buried in Microsoft Defender XDR process telemetry
Briefing summary

A workstation generated thousands of legitimate process events. Agent Foskett reviewed PowerShell activity inside DeviceProcessEvents and found a single EncodedCommand hidden amongst routine administration, software deployment and endpoint management noise.

PowerShell command-line analysis
DeviceProcessEvents hunting
Suspicious activity hidden by volume

What happened

The endpoint looked healthy. The dashboard stayed quiet. The suspicious command was present the whole time.
The endpoint looked healthy The device was reporting normally. Microsoft Defender showed no active incident and no user had reported a problem.
PowerShell was everywhere Management scripts, software deployments, monitoring tools and security automation generated regular PowerShell activity.
Nothing looked urgent The suspicious activity blended into normal operations. No single event stood out until the command lines were reviewed.

The query that started the investigation

Agent Foskett started with PowerShell process activity and followed the command line.
deviceprocessevents-powershell.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "powershell.exe"
| project Timestamp, DeviceName, InitiatingProcessFileName, ProcessCommandLine
| order by Timestamp desc
Hundreds of rows returned The query did not reveal a dramatic alert. It returned normal-looking activity from a busy endpoint environment.
The command line mattered The process name alone was not enough. ProcessCommandLine showed what PowerShell had actually been asked to do.
The noise was the hiding place The suspicious command was not invisible. It was simply surrounded by thousands of ordinary events.

One command looked different

Most commands looked like routine administration. One row did not.
suspicious-command.txt
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
powershell.exe -EncodedCommand SQBFAFgAKABOAGU...
// nearby noise: Install-Module
// nearby noise: Intune Management Extension
// nearby noise: Defender remediation task
// the suspicious command was just another row
The command was encoded EncodedCommand does not automatically prove compromise, but it does make the intent harder to understand at a glance.
The row was easy to miss It appeared between legitimate management actions and could easily have been dismissed as routine scripting.
The investigation changed Once the command was isolated, the question changed from whether PowerShell ran to what PowerShell executed.

Agent Foskett moment

The attacker did not hide the command particularly well. They hid it among everything else.
Encoding was not the only trick The encoded text was visible. The PowerShell process was visible. The execution chain was visible. The telemetry existed the entire time.
Volume created the camouflage Thousands of normal events surrounded the suspicious command. The noise made the unusual behaviour feel ordinary.
The command became evidence Once decoded and placed into the timeline, the command was no longer just text. It became part of the investigation.
What it was not It was not a dramatic ransomware alert, a named malware family or an obvious high-severity incident.
What it might have been It may have been suspicious script execution, staged download behaviour, hands-on-keyboard activity or post-compromise automation.
Why it mattered Modern attacks often succeed because defenders stop at the dashboard instead of following the behaviour hidden in the telemetry.

Following the execution chain

The process name rarely tells the full story. The parent, child and network activity often do.
Review the parent process Determine what launched PowerShell and whether that parent process normally creates scripted child activity.
Decode and inspect intent Extract the encoded content, decode it safely and look for download, execution, credential access or persistence behaviour.
Correlate network activity Check whether network connections, downloads or suspicious remote hosts appeared shortly after the encoded command ran.

What most environments miss

Visibility alone is not enough when legitimate administration creates constant noise.
PowerShell is not automatically bad Many environments rely on PowerShell for management, deployment, security automation and support tasks.
EncodedCommand is not automatically safe Administrative use exists, but attackers also use encoding to slow down human interpretation and hide intent.
Noise is an attacker advantage When analysts are overloaded by normal telemetry, unusual behaviour can hide in plain sight.

How defenders can investigate it

Start with the command line, then rebuild the behaviour around it.
Hunt for encoded commands Search ProcessCommandLine for EncodedCommand, -enc, -e and other PowerShell encoding variations.
Compare against normal activity Separate known management scripts from unusual execution chains, strange parents and unexpected users or devices.
Reconstruct the timeline Place the encoded command beside file, network, logon and process events to understand what happened next.
The attacker didn't hide the command.
They hid it among everything else.
Contact GEMXIT

Final thought

The command was not invisible. It was waiting for someone to care enough to look.
At GEMXIT We help organisations investigate Microsoft Defender XDR telemetry, PowerShell execution, endpoint behaviour, suspicious command lines and hidden activity across Microsoft security environments. If you want to understand how this applies to your environment, see our Cyber Security services.
Agent Foskett mindset Do not only ask whether PowerShell ran. Ask who launched it, what command was passed, whether it was encoded, what happened next and whether the behaviour belongs in that environment.

A single EncodedCommand was buried inside thousands of process events. Explore related investigations including The PowerShell Command Was Base64 Encoded, The Child Process Shouldn't Have Existed, and The Process Tree Told The Real Story.

Develop IT. Protect IT. GEMXIT PTY LTD | GEMXIT UK LTD

PowerShell EncodedCommand Investigation

This Agent Foskett briefing explains how a single PowerShell EncodedCommand can be buried inside high-volume Microsoft Defender XDR process telemetry and why defenders should investigate encoded command-line activity.

DeviceProcessEvents And ProcessCommandLine Analysis

Microsoft Defender XDR DeviceProcessEvents can help defenders review parent processes, child processes, command lines, timestamps and execution chains that reveal suspicious PowerShell behaviour.

Threat Hunting Through Operational Noise

Modern environments generate large volumes of legitimate endpoint telemetry. Attackers can hide suspicious activity inside normal administration, software deployment, management scripts and routine PowerShell execution.