Skip to content
Write-up Beginner

Threat Analysis Report Suspicious Powershell Script Execution soc153

A standard user account executed a malicious PowerShell script that downloaded a second payload from an external domain and established a connection to a command-and-control server. The script bypassed execution policy and ran in memory to evade file-based detection.

Ian Chow Follow

Published on systemweakness.com

On March 14, 2024, at 5:23 PM, an alert triggered on the host Tony because a suspicious PowerShell script (payload1.ps1) was executed. After looking into the logs, I confirmed that a standard user account ran a script that was downloaded from the internet.

Ian Chow, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the user was tricked into running a malicious script, and the system allowed execution policy bypass and in-memory execution without adequate blocking.

Impact

The attacker could control the compromised host, potentially leading to data exfiltration or lateral movement, as the script ran unhindered and communicated with a C2 server.

What the attacker needed

User runs malicious script; execution policy not enforced; network access to external domain

The fix

The host was isolated from the network to contain the threat, and indicators of compromise were logged for future blocking.

How it was found

  1. The user executed a PowerShell script from the Downloads folder.
  2. The script set the execution policy to Bypass for the process.
  3. The script used Invoke-WebRequest to download a second payload from an external domain.
  4. The downloaded payload was executed in memory using Invoke-Expression.
  5. The script made a DNS query to the malicious domain, resolving to an external IP.
  6. The host established a connection to the command-and-control server.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A user ran a PowerShell script that was not trusted. The script used a trick to download and run more malicious code without saving it to disk, then contacted an attacker's server. This is dangerous because it can let an attacker control the computer remotely.

Similar reports

Same bug class and techniques, clearest first.