The First 30 Minutes on a Fresh Windows VPS: Hardening Checklist

A freshly provisioned Windows VPS is exposed to the public internet from the first boot, with the built-in Administrator account, RDP open, SMBv1 present, and no updates installed. The first half hour is where the attack surface is decided. Below is a concrete, 30-minute order of operations that a single administrator can execute without taking the server offline for long.

Minute 0-5: Create a Second Admin and Retire Built-in Administrator

Built-in Administrator is SID S-1-5-21-...-500, exists on every install, and cannot be locked out except by rename. Create your named account first, then disable the original. Doing it in the other order is how administrators lock themselves out.

  • net user admin2 Str0ng-Passw0rd! /add
  • net localgroup Administrators admin2 /add
  • net user Administrator /active:no
  • wmic useraccount where sid like '%500' get name,sid to confirm.
  • Rename nothing on a domain-joined host until replication is verified.

Log out and confirm the second account can log in before proceeding. On a non-domain host, also set LimitBlankPasswordUse to 1 under HKLM\SYSTEM\CurrentControlSet\Control\Lsa.

Keep the built-in account present but disabled rather than deleting it. Deleting SID 500 is unsupported on domain controllers and unnecessary on member servers; disabled is enough to remove the default credential path. If your runbook requires it renamed, rename it with wmic useraccount where name='Administrator' call rename name='SVCDisabled' and record the new name in your password vault, because recovery tools reference the SID, not the label.

Finally, record the local administrator password hash source. On a non-domain host that is the SAM; on a domain-joined one it is the cached credential of the last interactive logon, which persists until CachedLogonsCount is lowered. Ten cached logons is the default and is more than enough for a single administrative user.

Minute 5-12: Patch Baseline and Reboot

Install the current cumulative update and the servicing stack before exposing the host. Install-WindowsFeature adds roles that pull further updates, so do the role inventory first, then run sconfig or Install-WindowsUpdate from the PSWindowsUpdate module. Reboot once and confirm the version with winver.

Patch Order: Servicing Stack, Rollup, Reboot, Verify

StepCommandWhy
Servicing stackDISM /Online /Cleanup-Image /StartComponentCleanupRemoves superseded payloads before update.
UpdatesGet-WindowsUpdate -Install -AcceptAllApplies all current fixes.
Rebootshutdown /r /t 0Some components only activate post-reboot.
VerifyGet-ComputerInfo | Select OsVersion,OsBuildNumberCatch a failed rollup.

Do not install optional roles before the baseline is applied. Install-WindowsFeature Web-Server on 2016 pulls an older IIS module set that a cumulative update then replaces, doubling the work and leaving module leftovers. Sequence the day as: patch the bare OS, reboot, verify the build number, and only then add IIS, .NET or file services.

Record the build number in your notes and check it against the monthly KB table. A rollup that failed to install often leaves the build on the previous month without any visible error, and the only way to catch it is to compare the number rather than trusting the “installed successfully” toast.

Minute 12-18: Firewall, RDP and Lockout

Set all three firewall profiles to inbound default-deny and expose only the ports you actually need. Then harden the RDP listener. Set-NetFirewallProfile -Profile Domain,Public,Private -DefaultInboundAction Block is the single most effective line you will run all day.

  • Set-NetFirewallRule -DisplayGroup "Remote Desktop" -Enabled False until NLA is confirmed.
  • Enable NLA: UserAuthentication = 1 under WinStations\RDP-Tcp.
  • Set AccountLockoutThreshold to 5, LockoutDuration 30, LockoutObservationWindow 30.
  • Restrict RDP source to a management IP where possible.

Account lockout alone defeats RDP password spraying. Combine it with a non-default port only if your monitoring justifies it; obfuscation is not a control. If the provider offers a management VPN or a bastion host, require it and close RDP to the world entirely. On a VPS with no such option, add an RDP firewall rule restricted to a static egress IP from your office and a second rule for the out-of-band console, then validate both before disconnecting.

Disable the Remote Assistance feature as well with Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance -Name fAllowToGetHelp -Value 0. It is enabled by default on many images and offers a second, less monitored path to an interactive desktop session.

Minute 18-22: Defender ASR and SMBv1

Attack Surface Reduction Rules to Enable First

Attack Surface Reduction rules block the techniques most remote attackers use. Enable the set below with Add-MpPreference -AttackSurfaceReductionRules_Ids and -AttackSurfaceReductionRules_Actions Enabled, beginning with the highest-value GUIDs.

  • D4F940AB-401B-4EFC-AADC-AD5F3C50688A – block Office child processes.
  • 3B576869-A4EC-4529-8536-B80A7769E899 – block Office from creating executable content.
  • 56A863A9-875E-4185-98A7-B882C64B5CE5 – block credential stealing from lsass.
  • 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC – block untrusted executable content from email.

Remove SMBv1 with Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol and reboot. Then check Get-SmbServerConfiguration | Select EnableSMB1Protocol for a false result. Leave SMB client enabled only if you actually map shares.

Add the inbound firewall rule set for SMB as well: even with SMBv1 gone, SMBv2 and v3 remain and expose port 445. Set-NetFirewallRule -DisplayGroup "File and Printer Sharing" -Enabled False on a host that has no file role removes an entire lateral-movement surface at zero cost. Re-enable only on the server that actually hosts the share, and enable SMB signing on it with Set-SmbServerConfiguration -RequireSecuritySignature $true.

Defender itself should get one check here: Get-MpComputerStatus | Select RealTimeProtectionEnabled verifies real-time protection was not left off by an imaged template. If it reports false, re-enable it before anything else.

Minute 22-27: Disable LLMNR and NetBIOS

LLMNR and NetBIOS name resolution leak credential hashes to any attacker on the same broadcast domain. On a VPS this matters less, but disabling them removes an easy fallback path.

  • New-ItemProperty HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -Name EnableMulticast -Value 0
  • Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces\* -Name NetbiosOptions -Value 2
  • Verify LLMNR is off with Get-ItemProperty HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient.

Both settings are per-interface for NetBIOS, so confirm the wildcard applied to every adapter. A rebuilt instance can gain a second NIC, and the new interface inherits the default until the wildcard is re-applied – re-run the command after any hardware change. If the host is domain joined, push LLMNR by GPO under Turn off multicast name resolution so a policy refresh cannot undo it.

Minute 27-30: Log Sizing and a Backup Before Exposure

Default event log sizes (20 MB for Security) overwrite in hours under attack. Set Security to at least 512 MB, System and Application to 256 MB, and forward the logs if available. Finish by taking an image snapshot – before the host is exposed, not after.

Size the logs with wevtutil sl Security /ms:536870912, wevtutil sl System /ms:268435456 and wevtutil sl Application /ms:268435456. Then enable audit failure categories: auditpol /set /subcategory:"Logon" /failure:enable and the same for “Account Lockout”. Without those, a lockout is invisible even when the log has space.

Take the snapshot only after the second administrator account is tested and the firewall policy is saved. A snapshot taken at minute 5 looks like protection but restores the vulnerable state, which is the most common reason a rebuilt host is compromised the same way twice.

The 30-Minute Result

Confirm the snapshot boots by restoring to a throwaway instance and logging in. Only then open the firewall to the internet. Our Windows VPS plans include snapshot tooling, and if the restore test fails, start at the support page rather than rebuilding blind.

Leave a Comment