Every level, in the open
Windows for Linux people
6 worlds · 52 levels · 6 bosses
SOLUTION HIDDENTeachers see answer keys in the classroom.
Windows admin and security for people who know Linux: processes, services, users, the registry, scheduled tasks, then event logs and AD. Honest note: no real Windows. pwsh is a SIM of PowerShell over a made-up host.
Guided levels show the command first. Alone levels give the goal only. Bosses and exams are timed.
Jump to a world
World 1The Bridge
9 levelsYou know Linux, so cross to Windows: PowerShell, services, the registry, tasks, and how an intruder hides in them.
Level 1: Same machine, other words
Objective: Ask this Windows workstation for its computer name with PowerShell, then tell Kern with kern NAME.
Windows has a shell too: PowerShell. Its commands are cmdlets named Verb-Noun (Get-Process, Stop-Service) and they hand over objects, not text. pwsh -c 'COMMAND' runs one line of it (single quotes keep $ safe from bash); $env:COMPUTERNAME is its way of saying hostname.
Commands taught
pwshwin-linux-mapLevel 2: Objects, not text
Objective: Someone left a notepad open: find the process ID (Id) of the process named notepad and tell Kern.
On Linux, ps prints text and you cut columns; PowerShell's Get-Process returns objects with named properties (Name, Id, CPU...). Get-Process -Name notepad picks by name and Select-Object Name,Id keeps just those columns.
Commands taught
ps-objectsLevel 3: Filter, sort, count
Objective: The workstation is slow: first count the processes that used more than 50 seconds of CPU, then find the single busiest process.
Where-Object { $_.CPU -gt 50 } keeps rows that pass a test ($_ is the current object; -gt is 'greater than', never > which writes a file). Sort-Object CPU -Descending, Select-Object -First 1 and Measure-Object sort, trim and count.
Commands taught
ps-pipelineLevel 4: Services are the daemons
Objective: Harden this workstation: the Print Spooler (service name Spooler) must be stopped now and must not come back at boot.
A Windows service is a systemd unit: Get-Service lists them (Status Running or Stopped), Stop-Service stops one now, and Set-Service -StartupType Disabled keeps it from starting at boot. Stopping is not disabling: just like systemctl stop versus systemctl disable.
Commands taught
ps-servicesLevel 5: C: is just a folder
Objective: Find the one line with ERROR in capitals in the logs under C:\Logs\app and tell Kern the code after it.
Get-ChildItem lists (ls), Get-Content prints (cat), Select-String -Path FILES -Pattern TEXT searches (grep) on paths like C:\Logs\app; it ignores case unless you add -CaseSensitive. In this VM the C: drive is the real folder ~/win/C.
Commands taught
ps-filesLevel 6: Who is an administrator?
Objective: Take the unknown account out of the Administrators group and disable it, without deleting it.
Windows groups work like Linux groups. Get-LocalGroupMember Administrators lists who may do anything (the sudo/wheel crowd), Remove-LocalGroupMember removes one, and Disable-LocalUser turns an account off without deleting it, which keeps evidence.
Commands taught
ps-local-usersLevel 7: The Run key
Objective: One value in the machine-wide Run key points outside C:\Windows and C:\Program Files: tell Kern its name, then remove it.
The registry is Windows' settings database and PowerShell walks it like a drive: Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run lists programs that start at every logon, Remove-ItemProperty deletes one. Malware loves this key to survive reboots.
Commands taught
ps-registrypersistence-huntLevel 8: A task that hides
Objective: One scheduled task runs a hidden encoded PowerShell command: decode it, tell Kern the host it contacts, then disable the task.
Scheduled tasks are Windows cron: Get-ScheduledTask lists them, Disable-ScheduledTask stops one. Attackers hide commands in -EncodedCommand TEXT, Base64 of UTF-16: [Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TEXT')) reads it.
Commands taught
ps-scheduled-tasksps-encoded-commandLevel 9: The sick workstation
Objective: Name the fake system process running from C:\Users\Public, kill it, and remove its service, Run value and scheduled task.
A process that comes back after you kill it has persistence: a service, a Run key, a scheduled task. Kill the process and remove every way it returns, or the job is only half done.
World 2Locks and Rules
10 levelsA file server is only as safe as its locks: folder permissions, shares, the firewall, Defender, patches and the password policy.
Level 10: Two tests, one filter
Objective: Baseline check: count the services set to start Automatically that are Stopped, then count the Disabled ones with Group-Object.
Inside Where-Object { ... } you can join tests: -and (both true), -or (either). Group-Object PROPERTY sorts objects into piles by value and counts each pile, like sort | uniq -c on Linux.
Commands taught
ps-where-groupLevel 11: Who may read it
Objective: Read the permissions on C:\Finance\Payroll: find the identity that should not have Modify, then the account with direct full control.
Every NTFS file and folder has an ACL: a list of rules (ACEs). Each says WHO (IdentityReference), WHAT (FileSystemRights) and whether it came from the parent (IsInherited). Get-Acl reads it as objects; icacls prints it in short letters.
Commands taught
ntfs-aclicaclsLevel 12: Break the inheritance
Objective: Lock C:\Finance\Board to the Board group, then do the same alone for C:\Finance\HR-Reviews and HR.
Folders inherit their parent's rules. icacls PATH /inheritance:d stops that and keeps a copy as the folder's own (:r would drop them, admins too). /remove NAME deletes rules, /grant "NAME:(OI)(CI)M" adds Modify. Quote it in PowerShell.
Commands taught
icaclsLevel 13: Deny beats allow
Objective: marco stays in the Finance group, but HR says he must not read C:\Finance\Salaries. Block him without touching the Finance rule.
An explicit Deny rule wins over an Allow, even an Allow the user gets through a group. icacls PATH /deny "NAME:(OI)(CI)R" blocks reading. Granting (N) does not do it: an allow of nothing adds nothing, the group's Modify still applies.
Commands taught
icaclsLevel 15: The firewall
Objective: Turn the disabled firewall profile back on, then block outbound traffic to two command-and-control addresses.
Windows Firewall has three profiles (Domain, Private, Public), each on or off. Get-NetFirewallProfile shows them, Set-NetFirewallProfile -Profile NAME -Enabled True turns one on, New-NetFirewallRule adds a rule. Linux twin: ufw.
Commands taught
windows-firewallLevel 16: Defender, and who blinded it
Objective: Turn real-time protection back on, remove the attacker's exclusion, then name the threat Defender caught.
Defender is the built-in antivirus. Get-MpComputerStatus: is real-time protection on? Get-MpPreference: settings, incl. ExclusionPath (never scanned). Set-MpPreference changes one, Remove-MpPreference drops an exclusion, Get-MpThreat lists catches.
Commands taught
defenderLevel 17: Patch Tuesday
Objective: Compare this month's required updates (C:\Audit\needed.csv) with what is installed.
Security updates ship monthly, each with a KB number. Get-HotFix lists installed ones (HotFixID, InstalledOn). Import-Csv turns a CSV into objects, one per row. -notin keeps values missing from another list, -in the ones present.
Commands taught
patchingps-where-groupLevel 18: Password and lockout policy
Objective: Read the password policy, then raise the minimum length to 14 and lock accounts after 5 wrong passwords.
net accounts shows and sets the local password policy: minimum length, max age, and the lockout threshold (wrong passwords before an account locks; Never = unlimited guesses). /minpwlen:N and /lockoutthreshold:N change them.
Commands taught
net-accountsLevel 19: File-server audit
Objective: The auditors arrive in 15 minutes: fix the over-shared folder, the open firewall rule, name the missing patch and tighten the password policy.
An audit checks the locks one by one: shares, firewall rules, patches, policy. Find each weak spot, fix it, write it down.
World 3Event Log Hunters
12 levelsEvery logon, new account, service and cleared log leaves an event. Read them like a SOC analyst, live and from saved .evtx files.
Level 20: The diary of a machine
Objective: Read the newest System events, then find out how big the Security log is.
Windows writes events into logs: System (services, drivers), Security (logons, accounts), Application, and many more. Get-WinEvent reads them, newest first. On Linux this is journalctl; the event Id plays the role of the message type.
Commands taught
get-wineventLevel 21: Ask by Id
Objective: Count the failed logons, then the logons of any kind in the last hour.
Each event type has a number: 4624 = successful logon, 4625 = failed logon. -FilterHashtable @{LogName=...; Id=...} asks the log for only those events. Add a list (Id=4624,4625) or a time limit (StartTime=(Get-Date).AddHours(-1)).
Commands taught
get-wineventevent-idsLevel 22: Inside an event
Objective: Read who logged on last, then find the Remote Desktop logon and where it came from.
An event's details live in .Properties, a list in a fixed order per event Id; count from 0. On a 4624: index 5 = TargetUserName, 8 = LogonType (2 at the keyboard, 3 network, 10 Remote Desktop), 18 = IpAddress. $_.Properties[8].Value reads one.
Commands taught
event-propertiesLevel 23: Failed logons
Objective: Find the account with the most failed logons, then the account name that does not even exist.
On a 4625 (failed logon) index 5 is the account tried, 9 the SubStatus (0xc000006a = wrong password, 0xc0000064 = no such user), 19 the source IP. Group-Object { $_.Properties[5].Value } counts failures per account.
Commands taught
event-idsevent-propertiesLevel 24: Brute force or spray?
Objective: Two attacks hit this server: name the IP running the password spray, then the account the brute force targeted.
Brute force: one account, many passwords, usually one source. Password spray: one or two common passwords against many accounts, from one source, slowly, to dodge lockouts. Group the 4625s by source IP (index 19) and by account (index 5) to tell them apart.
Commands taught
spray-vs-bruteLevel 25: An .evtx from another machine
Objective: Open the saved Security log in C:\Evidence, find which machine it came from and which account was created there.
Investigators copy logs as .evtx files (a binary format: a header that starts with ElfFile, then chunks of records). Get-WinEvent -Path FILE reads one; in a hashtable write @{Path="FILE"; Id=...}. The file keeps the original MachineName.
Commands taught
evtx-filesLevel 26: Who made an admin?
Objective: In C:\Evidence\ws07-security.evtx, find the account added to Administrators and the account that did it.
The account-creation chain: 4720 created, 4722 enabled, 4724 password reset, 4732 added to a local group. On a 4732 to a local group the member is given by SID (MemberSid, index 1); match it to the 4720's TargetSid (index 2). SubjectUserName is who did it.
Commands taught
account-eventsLevel 27: Word opened PowerShell
Objective: Someone opened an invoice attachment. Find the PowerShell that Word started and tell Kern the host it downloads from.
4688 = a new process was created (when process auditing with command lines is on). Index 5 = NewProcessName, 8 = CommandLine, 13 = ParentProcessName. Office starting PowerShell is a classic phishing sign: a macro ran.
Commands taught
process-eventsLevel 28: A service at 3 a.m.
Objective: A service appeared overnight: name it, read the script it ran, then stop and disable it.
7045 (System log) = a service was installed: index 0 ServiceName, 1 ImagePath. 4104 (Microsoft-Windows-PowerShell/Operational) = script block logging: the real code that ran, even if it arrived encoded; Level Warning means PowerShell itself found it suspicious.
Commands taught
process-eventsLevel 29: Cover your tracks
Objective: Someone cleared the Security log on this workstation: tell Kern which account did it.
Clearing a log leaves one last event: 1102 in Security ('The audit log was cleared'), 104 in System. Its fields are UserData, not EventData: index 0 SubjectUserSid, 1 SubjectUserName. A cleared log on a server is almost always an incident.
Commands taught
log-clearingLevel 30: Sysmon: one GUID ties it together
Objective: Follow the connection to the CERT's address back to its process, then to the registry value it set.
Sysmon (a free Microsoft tool) logs richer events in Microsoft-Windows-Sysmon/Operational: 1 process create, 3 network connection, 11 file create, 13 registry value set. Each carries a ProcessGuid: the same GUID in two events = the same process.
Commands taught
sysmonLevel 31: Reconstruct the intrusion
Objective: Two evidence files from WS12 (Security and System): find each step of the intrusion, then write the timeline report.
An incident timeline lists what happened, oldest first: initial access, privilege, persistence, cleanup. Read both evidence files, then write the timeline down.
World 4The Domain
10 levelsActive Directory holds every account in the company. Read it, filter it, fix its groups and policies, and spot Kerberos abuse.
Level 32: The directory
Objective: Look up accounts in the corp.local directory: one person's details, then everyone in one OU.
Active Directory (AD) is the company's central list of users, groups and computers; every domain PC asks it who you are. Get-ADUser reads accounts: -Identity for one, -Filter * for all, -Properties for more than the default ten fields.
Commands taught
active-directoryget-aduserLevel 33: Ask the server, not the pipe
Objective: Count the disabled accounts, then the stale ones that are still enabled.
Get-ADUser -Filter {Enabled -eq $false} lets the domain controller do the filtering (fast on 50,000 accounts). Search-ADAccount answers the classic audit questions: -AccountInactive -TimeSpan 90 (no logon in 90 days), -AccountDisabled, -PasswordNeverExpires.
Commands taught
get-adusersearch-adaccountLevel 34: Domain Admins
Objective: Audit Domain Admins: take out the unexpected member, then find the user hiding in a nested group.
Domain Admins can do anything on every machine in the domain. Get-ADGroupMember lists members (users and nested groups); -Recursive opens the nested groups too. Remove-ADGroupMember -Identity GROUP -Members USER -Confirm:$false takes someone out without a prompt.
Commands taught
ad-groupsLevel 35: A new joiner
Objective: Create Sami's account in the Finance OU and give him the Finance group, then do the same alone for Nour in HR.
New-ADUser creates an account: -Name (full name), -SamAccountName (login), -Path (the OU it lives in). Without -AccountPassword it stays disabled. Add-ADGroupMember -Identity GROUP -Members LOGIN gives the access that comes with a group.
Commands taught
ad-lifecycleLevel 36: The leaver
Objective: Process karim.t's departure step by step, then do amel.s alone.
Leavers are disabled, not deleted (mail, files and audits still need the account): Disable-ADAccount, then Move-ADObject to OU=Disabled, then remove the group memberships (Get-ADPrincipalGroupMembership lists them; Domain Users is the primary group and stays).
Commands taught
ad-lifecycleLevel 37: Group Policy
Objective: Find the most recently changed GPO, then the one that switches Defender off.
A Group Policy Object (GPO) is a bundle of settings linked to an OU; every computer or user in that OU applies it (firewall, Defender, drive maps, password rules). Get-GPO -All lists them; Get-GPOReport -Name X -ReportType Xml shows what one sets.
Commands taught
group-policyLevel 38: Domain password policy
Objective: Raise the domain's minimum length and lockout, then fix the weaker admins' policy.
The domain's password rules: Get-ADDefaultDomainPasswordPolicy reads them, Set-ADDefaultDomainPasswordPolicy -Identity corp.local changes them. Fine-grained policies (Get-ADFineGrainedPasswordPolicy) override them for chosen groups, like the admins.
Commands taught
ad-password-policyLevel 39: Service accounts
Objective: Find the service account with an SPN that sits in Domain Admins, then take it out of that group.
Service accounts run applications (SQL, web pools). An account with a ServicePrincipalName (SPN) can be asked for a Kerberos ticket by any domain user, and that ticket can be cracked offline: Kerberoasting. An SPN account in Domain Admins with an old password is a top finding.
Commands taught
spn-kerberoastLevel 40: Kerberos on the DC
Objective: In the domain controller's log C:\Evidence\dc01-security.evtx, name the account roasting tickets, then the IP spraying passwords.
Domain controllers log Kerberos: 4768 TGT requested, 4769 service ticket requested (index 5 TicketEncryptionType: 0x12 AES normal, 0x17 RC4 = the Kerberoasting tell), 4771 pre-authentication failed (index 6 IpAddress: a burst across many accounts = spray).
Commands taught
kerberos-eventsLevel 41: Clean the stale admins
Objective: Clean Domain Admins of stale accounts, disable them, fix the lockout policy and name the GPO that blinds Defender.
Domain Admins should hold a few active people. Stale admin accounts (no logon for months) are disabled and removed; the domain lockout policy must be on; GPOs that weaken defences are found and reported.
World 5The Cloud Directory
7 levelsThe same company, now in Microsoft 365: read sign-in logs, catch MFA fatigue and impossible travel, and close the doors attackers open in mail and apps.
Level 42: Sign-in logs
Objective: Connect to the tenant, read the newest sign-ins, then count the failed ones.
Entra ID (formerly Azure AD) is the cloud directory behind Microsoft 365. Connect-MgGraph opens a session; Get-MgAuditLogSignIn returns sign-ins as objects with nested ones: $_.Status.ErrorCode (0 = success), $_.Location.City.
Commands taught
entra-graphsignin-logsLevel 43: Same story, from a file
Objective: Read the exported sign-ins: find the account using a legacy protocol, then the country that does not belong.
SOC teams often get logs as JSON exports. Get-Content FILE -Raw | ConvertFrom-Json turns the text into objects, nested ones included. Old protocols like IMAP4 and POP3 cannot do MFA: a password alone opens the mailbox.
Commands taught
signin-logsLevel 44: MFA fatigue
Objective: Find the user flooded with MFA prompts, kill their sessions and block the account until they reset.
MFA fatigue: the attacker has the password and triggers push prompts until the tired user taps Approve. In the log: many 500121 (MFA denied or timed out) for one user, then a 0. Revoke-MgUserSignInSession kills their tokens; Update-MgUser -AccountEnabled:$false blocks sign-in.
Commands taught
mfa-fatiguecontain-cloud-accountLevel 45: Impossible travel
Objective: Find the account that signed in from Tunis and another continent within half an hour, then revoke its sessions.
Impossible travel: the same account signs in successfully from two places too far apart for the time between (Tunis, then another continent 24 minutes later). One of them is not the user. RiskLevelDuringSignIn often says high on the second.
Commands taught
signin-logsLevel 46: The forwarding rule
Objective: The CFO's mailbox leaks invoices: find the external forwarding address and remove the rule.
After taking a mailbox, attackers add an inbox rule that forwards invoices outside, often with a name like '.' so nobody notices. Connect-ExchangeOnline, then Get-InboxRule -Mailbox lists the rules (ForwardTo, RedirectTo, DeleteMessage); Remove-InboxRule deletes one.
Commands taught
inbox-rulesLevel 47: Consent and policy
Objective: Remove the app that can read everyone's mail, then switch the MFA policy from report-only to enforced.
An OAuth consent grant lets an app act with a user's or everyone's permissions, no password needed: Get-MgOauth2PermissionGrant lists them. Conditional access policies decide when MFA is required; State enabledForReportingButNotEnforced only watches.
Commands taught
oauth-consentconditional-accessLevel 48: The hijacked mailbox
Objective: One user approved an MFA flood tonight: find them and the attacker's IP, revoke the sessions, remove their forwarding rule and the app they consented to.
Business email compromise, start to finish: MFA fatigue gets the attacker in, a forwarding rule and an app consent keep them there. Find the user and the attacker's IP, kill the sessions, remove the rule and the grant.
World 6Windows on the Job
4 levelsReal Windows admins script and work on many machines at once. Write .ps1 files, run them safely, reach a fleet with Invoke-Command, report in CSV.
Level 49: Your first .ps1
Objective: Write a script that checks one service, run it twice, then write one that lists the local administrators.
A .ps1 file is a PowerShell script. param([string]$Name) at the top declares a parameter, filled with -Name VALUE when you run it. From bash: pwsh -File PATH -Name VALUE; inside PowerShell: & PATH -Name VALUE. Like a bash script with $1, but named.
Commands taught
ps1-scriptsLevel 50: Safe by default
Objective: Preview a risky change with -WhatIf, learn how try/catch really behaves, then write a script that stops a list of services safely.
-WhatIf on a changing cmdlet prints what WOULD happen and changes nothing. try { } catch { } catches errors, but only terminating ones: add -ErrorAction Stop to a cmdlet so its error jumps into catch instead of printing and carrying on.
Commands taught
whatif-trycatchLevel 51: Three hosts at once
Objective: Find the workstation still running the Print Spooler, fix it remotely, then export the fleet's patches to a CSV.
Invoke-Command -ComputerName A,B,C -ScriptBlock { ... } runs the block on every host over WinRM (port 5985) and adds PSComputerName to each result. Think ssh in a loop. Export-Csv PATH writes objects to a CSV file. SIM note: the hosts are simulated.
Commands taught
remotingcsv-reportsLevel 52: First week on the fleet
Objective: Inventory WS01 to WS04 to a CSV, name the unpatched host and the host with a rogue local admin, then remove that admin remotely.
The capstone ticket: inventory the fleet, find the host missing this month's patch and the host with an unexpected local admin, fix it remotely, and leave a CSV behind for the team.
For teachers
Use these levels with a class
SOLUTION HIDDEN Teachers see answer keys in the classroom.