Module 3 · Linux and Windows Administration · Lesson 8 of 75

Windows administration for security

Accounts, UAC, NTFS permissions, the registry, services, Event Viewer IDs every analyst knows, and PowerShell for admins.

In this lesson · about 40 minutes

  • Explain local versus domain accounts and what UAC does
  • Find persistence locations in the registry and services
  • Use the key Windows security event IDs and basic PowerShell

Accounts and UAC

  • Local accounts live on one PC. Domain accounts live in Active Directory and work on every PC in the company.
  • Built-in high-value accounts: the local Administrator, the SYSTEM account (more powerful than Administrator; services often run as it), and in a domain, members of Domain Admins.
  • User Account Control (UAC): even an admin works with a normal-strength token, and a prompt appears before anything needs full rights. It stops silent changes, but is not a security boundary against a determined attacker.
  • Commands: whoami /all (your groups and privileges), net user, net localgroup administrators.

NTFS permissions and shares

Windows uses access control lists (ACLs): each file or folder has a list of who may Read, Write, Modify or have Full control. Network shares have their own share permissions on top; the stricter of the two wins. Check with icacls C:\Finance. "Everyone: Full control" on a share is a classic finding.

The registry

A huge database of settings, organised in hives such as HKEY_LOCAL_MACHINE (HKLM, the whole machine) and HKEY_CURRENT_USER (HKCU, the logged-in user). Persistence keys to check first:

  • HKLM\Software\Microsoft\Windows\CurrentVersion\Run and ...\RunOnce
  • HKCU\Software\Microsoft\Windows\CurrentVersion\Run
  • HKLM\System\CurrentControlSet\Services (every service)

Other persistence spots: the Startup folder, scheduled tasks (schtasks /query /fo LIST /v) and WMI subscriptions. Microsoft's free Autoruns tool lists them all in one window.

Event logs and the IDs to know

Event Viewer (eventvwr.msc) holds the Security, System and Application logs, plus PowerShell and Sysmon logs if enabled.

IDMeaningWhy it matters
4624Successful logonLogon type 2 = at the keyboard, 3 = over the network, 10 = Remote Desktop
4625Failed logonMany in a row = password guessing
4672Special privileges assignedAn admin-level logon
4688New process createdWhat ran, and its parent (enable command-line logging)
4720 / 4732User created / added to a local groupAttackers create accounts and add them to Administrators
4740Account locked outBrute force, or a user with an old password on their phone
7045New service installed (System log)A classic sign of remote-execution tools and malware
1102Security log clearedAlmost always suspicious: someone covering tracks
4104PowerShell script block loggedShows the actual script that ran, even if it was obfuscated

PowerShell

PowerShell is Windows' powerful shell. Commands are Verb-Noun and output objects, not text, so you can filter and sort them:

  • Get-Process | Sort-Object CPU -Descending | Select-Object -First 5
  • Get-Service | Where-Object Status -eq 'Running'
  • Get-LocalUser, Get-LocalGroupMember Administrators
  • Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 20
  • Get-NetTCPConnection -State Listen (the Windows cousin of ss -tuln)

Attackers love PowerShell too ("living off the land"), which is why defenders turn on script-block logging and constrained language mode.

Hands-on lab (simulated terminal)

Lab: check a Windows workstation with PowerShell

A user reports their PC "feels strange". You open an administrator PowerShell window on WS-ACCT-07 in your lab domain. Output is simulated.

Step 1 of 5. Type each command and press Enter. Nothing runs on your computer.

Lab: check a Windows workstation with PowerShell

1. Show who you are and your group memberships.

PS C:\Windows\system32>

Sorting drill

Normal or suspicious?

You are reviewing a Windows machine. Sort each finding.

  • Event 4624 logon type 2 for the user at 9:02 on a Monday
  • Event 1102: the Security log was cleared
  • OneDrive in the Run key
  • Event 7045: service 'xQ7pd' installed from C:\Windows\Temp
  • 300 event 4625 failures for 'administrator' in 5 minutes
  • svchost.exe running from C:\Windows\System32

0 of 6 sorted

Check your understanding0 of 4 correct

Question 1

1.Which event ID records a failed Windows logon?

Question 2

2.A 4624 event with logon type 10 means...

Question 3

3.Which account is more powerful than the local Administrator?

Question 4

4.Which tool lists every autostart location on a Windows machine?

Quiz score: 0 of 4

Tip: answer every quiz question correctly first.

Written by Noviq Academy in its own words. All labs are simulations: no real systems are touched, and every name, address, password and hash is made up. The offensive techniques taught here are for defending systems and for authorised testing only; never scan, access or test a system without the owner's written permission. Tool and product names belong to their owners, and command output may differ slightly from yours. Read-aloud uses your device's built-in voices.