VenomousViper Labs
Portfolio Writeups
โ† Back to Writeups

Context and Goals

This case study documents a controlled adversary simulation I performed in my home cyber lab.

I deliberately:

  1. Misconfigured a Windows server to reflect common small-business weaknesses.
  2. Launched targeted attacks from an "attacker" VM.
  3. Monitored how those attacks were captured by Windows logs, Sysmon, Wazuh, and OpenEDR.
  4. Practiced a full SOC-style investigation and remediation workflow.

Lab Highlights

The scenario is inspired by "Investigating Windows" and "Windows Logging for SOC" style labs, but built and executed entirely in my own environment.

Scenario Overview

What I Simulated

I set up SRV-WIN01 to intentionally resemble a poorly secured production server:

Attack Chain Executed

  1. RDP brute force against the Administrator account
  2. Authenticated successfully over RDP using the compromised credentials
  3. Created a new local admin account for persistence
  4. Added that account to Administrators and Remote Desktop Users
  5. Set up a scheduled task to run a PowerShell script on a schedule
  6. Had that script initiate outbound HTTPS connections to a simulated C2 server

My goal was to:

Detection: How the Attack Was Captured

Initial Alerts in Wazuh

Once the brute-force portion of the simulation started, Wazuh began generating alerts based on Windows Security events:

Brute-force Pattern Detected
Multiple 4625 (failed logon) events targeting Administrator. All from the attacker VM IP: 10.10.25.50. Attempts clustered into a short time window.
Successful RDP Logon Following Failures
4624 (successful logon) with:
  • LogonType = 10 (RemoteInteractive โ€“ RDP)
  • TargetUserName = Administrator
  • IpAddress = 10.10.25.50

Detection Validation: I confirmed that my simulated brute-force behavior was correctly detected as "Excessive failed logons followed by a successful RDP logon on a privileged account."

Log Sources Used

To analyze how my own attack showed up, I focused on:

The point of this exercise was to prove that my logging stack (Windows + Sysmon + Wazuh + OpenEDR) captured every step.

Investigation: Replaying My Own Attack as a SOC Analyst

Establishing the Timeline

Starting from the Wazuh alerts, I worked backwards and then forwards:

Brute Force Phase
Numerous 4625 events against Administrator from 10.10.25.50. Clear time clustering showing a scripted or tool-based attack.
Initial Compromise
A 4624 with LogonType = 10 (RDP), same IP, same account. Treated as the pivot event indicating the moment my simulated attack succeeded.

Account and Group Activity

As part of my simulated persistence, I:

As a SOC analyst looking at the logs, I validated that:

4720 โ€“ User Account Created
TargetUserName = svc_backup, SubjectUserName = Administrator. Proved the attacker (me) used Administrator to create the new account.
4728 / 4732 / 4756 โ€“ Group Membership Changes
Showed svc_backup being added to Administrators and Remote Desktop Users.

From the defender perspective: "Attacker created a new local admin account and granted it RDP access."

Scheduled Task and Persistence

As the attacker, I then:

In the logs, I confirmed this showed up as:

This let me verify that a SOC team could detect fake "update" tasks pretending to be legitimate software and see the exact script path and commands my simulated attacker used.

Outbound Network Connections and PowerShell

My script (update.ps1) was coded to:

In logs:

Detection Validation

With Sysmon + PowerShell logging enabled, I can see suspicious outbound PowerShell traffic and reconstruct the script behavior without ever seeing the original file.

Detection Engineering: Rules I Designed from My Own Attack

A big goal of this exercise was to convert what I did as an attacker into concrete detections.

Detection 1: RDP Brute Force Followed by Success

Detection Logic

  • Count failed logons (4625) against a single account from one IP in a short window
  • Raise an alert when a successful logon (4624) with LogonType 10 occurs afterward from the same IP and user
  • Prioritize if account is privileged (Administrator, Domain Admins, etc.)

Purpose: Catch the exact pattern I generated: repeated failures, then success on RDP.

Detection 2: New Local Admin Account Creation

Detection Logic

  • Watch for 4720 (user created) on servers and critical endpoints
  • Correlate with 4728 / 4732 / 4756 (user added to admin/RDP groups)
  • Conditions: Creator is a privileged account; account name matches common "service" naming patterns (svc_*, backup, etc.)

Purpose: This rule is directly based on my svc_backup persistence step.

Detection 3: Suspicious Scheduled Tasks

Detection Logic

  • Identify 4698 events creating scheduled tasks whose command line includes powershell.exe or cmd.exe launching scripts from unusual directories (C:\ProgramData, temp paths)
  • Flag task names that mimic common software (*Update*, *Service*) but point to non-standard script locations

Purpose: This detection was tuned using the exact OneDrive Update Service task I set up.

Detection 4: Outbound PowerShell Beaconing

Detection Logic

  • Use Sysmon Event ID 3 to find: ProcessName = powershell.exe, destination IPs or domains not seen in baseline
  • Alert on repeated outbound connections to the same external host on 443 from PowerShell

Purpose: Built around the HTTPS traffic I generated in update.ps1.

Remediation and Hardening

After finishing the simulated attack and investigation, I switched fully back into blue team mode and remediated my own mess.

Immediate Host-Level Remediation

On SRV-WIN01, I:

Authentication & RDP Hardening

To prevent a replay of my own attack, I:

Logging & Monitoring Improvements

I used lessons learned to tighten logging:

Playbook Creation

I documented the steps I took into a "Windows Host Compromise (RDP)" playbook that includes:

  1. How to recognize this pattern in Wazuh
  2. Which event IDs and Sysmon logs to pivot on
  3. How to identify new accounts, tasks, and outbound connections
  4. The exact remediation sequence: Isolate โ†’ investigate โ†’ remove persistence โ†’ reset credentials โ†’ hunt for spread

Skills Demonstrated

Summary

In this homelab simulation, I intentionally compromised my own Windows server, then:

This is the same cycle I would apply in production: Observe what logs show โ†’ Build detections and playbooks โ†’ Harden the environment against what we just learned.