Lesson 2 of 14 · 17m
Services: SCM, svchost, and the Account You Forgot
A service is a registry registration managed by services.exe — the svchost sharing model, virtual accounts and gMSA, sc.exe's petty parser, and why 7045 is free detection.
SCM is the boss, svchost is the hotel
services.exe — the Service Control Manager — is spawned by wininit.exe during boot. Every service is a key under HKLM\SYSTEM\CurrentControlSet\Services\<name>: ImagePath, Type, Start (0 = boot, 1 = system, 2 = automatic, 3 = manual, 4 = disabled), ObjectName for the account, and Parameters\ServiceDLL for hosted services. The SCM reads the tree, starts the processes, and each process calls StartServiceCtrlDispatcher so the SCM can deliver start, stop, and pause control codes. A service isn't the Windows word for daemon — it's a registration the SCM manages.
Most inbox services don't get their own process. svchost.exe -k <group> hosts dozens as DLLs; the groups are enumerated at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost. tasklist /svc shows who lives where, and Get-Process svchost | Select Id, Path separates real instances from malware impersonating the name — a svchost.exe running out of %TEMP% is a finding, not a weird process. Since Windows 10 1703, machines with more than about 3.5 GB of RAM split svchost per-service for isolation — that's why a modern box shows sixty svchost processes where Server 2012 showed a dozen, and why "kill svchost" is never a plan.
The account matters more than the binary
Get-Service shows name and status — nothing else. The object you actually audit is Win32_Service, which carries PathName, StartName, ProcessId, and StartMode:
Get-CimInstance Win32_Service | Select Name, State, StartName, PathNameStartName is where the privilege lives:
LocalSystem— full local admin and presents the machine's AD computer account on the network. Almost nothing needs both halves.NT AUTHORITY\NetworkService— same network identity, trimmed local rights.NT AUTHORITY\LocalService— anonymous on the wire.NT SERVICE\<svcname>— a virtual account: no password, and a per-service SID you can ACL files and registry keys to. The right default for local services.gMSA— group managed service accounts (Server 2012+) for domain services: AD stores the password, rotates it every 30 days via the KDS root key, and no human ever knows it.
Running a service as a domain admin — or worse, as a human — is the classic debt. The password ends up in LSA secrets, config files, and eventually a memory dump on a compromised box.
sc.exe: the sharp tool
sc.exe predates PowerShell and its parser is petty — the space after = is mandatory:
sc.exe config spooler start= demand
sc.exe failure spooler reset= 86400 actions= restart/5000/restart/10000/run/30000
sc.exe sdshow spoolersc sdshow prints the service's DACL in SDDL. A weak service ACL means a non-admin can sc config a new binPath into an elevated process. The sibling classic: an unquoted ImagePath like C:\Program Files\Vendor\app\srv.exe makes Windows try C:\Program.exe first — drop a file there and you inherit the service's account (T1574.009). Find them with Get-CimInstance Win32_Service | Where-Object {$_.PathName -notmatch '^"' -and $_.PathName -match ' '}.
Services also carry triggers — sc triggerinfo shows them — and a demand-start (Manual or Automatic) service wakes on its trigger with nobody pressing start. What they don't do is fire for Disabled: a disabled service refuses every start until the config changes — which is why wuauserv resurrects through WaaSMedicSvc flipping its Start value back, a remediation service rewriting the registry, not a trigger.
Recovery options — the "Recovery" tab, or sc failure — restart the service or run a program on failure, which is a clean place to hide persistence. "Automatic (Delayed Start)" waits about two minutes past the boot rush; it's a real knob for boxes where the boot storm is the problem. And some services you genuinely can't touch: MsMpEng (Defender) and friends run Protected Process Light — the kernel rejects non-PPL handles, which is the point: it keeps even SYSTEM-level tampering out.
The real-world stakes: ransomware playbooks open with net stop and sc.exe config against AV and backup agents — the leaked Conti manual had it verbatim — before touching a single file. And System channel event 7045, "a service was installed," is one of the highest-fidelity detection signals Windows emits for free.
Audit Win32_Service quarterly, move anything bespoke off LocalSystem, fix unquoted paths, alert on 7045.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
BlueHammer: The Unpatched Windows Zero-Day That Weaponizes Microsoft Defender Against Your Own System
BlueHammer is an unpatched, publicly released Windows local privilege escalation exploit that chains Microsoft Defender's update workflow, Volume Shadow Copy, Cloud Files callbacks, and opportunistic locks to reach NT AUTHORITY\SYSTEM from a standard user account.
A Fake GTA 6 ISO Didn’t Install a Game. It Installed a Wiper.
A fake GTA 6 ISO used a believable installer error to cover remote-access malware, browser-data theft, and destructive file wiping. The “License not found” message wasn’t the crack failing. It was there so the victim would stop looking.
Running a Minecraft Network: Four JVMs, One Box, and the Settings That Lie to You
Four servers on one host means four JVMs each sizing its thread pools for a machine it does not own. The measured cost of that, the systemd ordering that guarantees nothing, and the throttle that switches itself back on when your forwarding breaks.
Building a Minecraft Network: Four Servers Pretending to Be One Place
A proxy, a lobby, an SMP and a PvP arena is four JVMs that know nothing about each other. What actually has to be shared, why your permissions don't follow players, and the two LuckPerms defaults that silently share nothing at all.