Back to Enterprise Identity Defense Lab

BLUE TEAM · DETECTION ENGINEERING

PowerShell Remoting Detection Lab

Active Directory + Wazuh SIEM

MITRE ATT&CK T1021.006Event ID 4104Event ID 4624Event ID 4688PowerShell RemotingActive DirectoryWazuhWinRM

Overview

Objective

Simulate PowerShell Remoting from a domain workstation to a Windows Server domain controller, then investigate the activity from a defender’s perspective using Windows event logs and Wazuh.

Environment

dc01
Windows Server · Domain Controller
win10-lab
Domain-joined workstation
Wazuh
SIEM · log analysis platform
LAB.LOCAL
Active Directory domain

Telemetry chain

4104
PowerShell script block activity
4624
Successful logon activity
4688
Process creation activity
Wazuh
Centralized search and review

Evidence

1 · Remote execution

Used Invoke-Command from win10-lab to run whoami, hostname, and ipconfig on dc01.

PowerShell Remoting command and output from the domain controller

2 · Script block event

Confirmed locally that PowerShell logging captured the remote command under Event ID 4104.

Windows Event Viewer showing PowerShell script block Event ID 4104

3 · SIEM investigation

Queried Wazuh for Event ID 4104 from dc01 and reviewed the PowerShell script block in the Threat Hunting view.

Wazuh Threat Hunting results showing PowerShell Event ID 4104 from dc01

Click a screenshot to view it full size.

Lab outcome

Enabled PowerShell Remoting, verified WinRM connectivity with Test-WSMan, executed a remote command, then confirmed its script block in Windows Event Viewer and Wazuh.

Detection Workflow

01 · Prepare

Enabled PowerShell Remoting on the workstation and domain controller; checked connectivity to dc01 with Test-WSMan.

02 · Simulate

Ran Invoke-Command remotely to collect the hostname, user context, and network configuration from the domain controller.

03 · Investigate

Reviewed Event ID 4104 locally, then searched Wazuh using agent.name:dc01 AND data.win.system.eventid:"4104".

Tools: PowerShell Remoting · Windows Event Logging · Wazuh · Active Directory

Conducted in an isolated learning environment. Screenshots show lab-only hostnames and private IP addresses.