PVWA - Hardening Script Hangs at "Restart HTTP Service"
Symptom
When installing or upgrading to PVWA version 14.4 or 14.6 on Windows Server 2022, the hardening script hangs indefinitely at the following step: Waiting for Service "Http Service (http)" to stop ...
This issue typically occurs during the execution of the ServerInformationDisclosure step, which is a new addition to the hardening process in recent versions.
Environment
14.4;14.6 Privileged Access Manager (PAM, self-hosted) Password Vault Web Access Password Vault Web Access Installation
Cause
The hardening script now includes a step to mitigate Server Information Disclosure vulnerabilities. This step attempts to remove the X-Powered-By HTTP header, which can reveal web server technology details to potential attackers.
To apply these changes (which involve registry modifications and updates to the IIS applicationhost.config), the script attempts to restart the HTTP Service. In some environments, specifically on Windows Server 2022, the service may fail to stop or restart within the script's expected timeframe, causing the hang.
Resolution
You can bypass the service restart by modifying the hardening configuration file. Disabling the restart does not negatively impact PVWA operations, though you should manually verify your security headers afterward to ensure compliance with internal policies.
-
Locate the hardening configuration XML file used by your script (typically
PVWAHardening.xml). -
Find the section for the
ServerInformationDisclosurestep:<Step Name="ServerInformationDisclosure" DisplayName="Server Information Disclosure" ScriptName="ServerInformationDisclosure.psm1" Enable="Yes"> <Parameters> <Parameter Name="RestartHttpService" Value="True"/> </Parameters> </Step> -
Change the
RestartHttpServicevalue fromTruetoFalse. -
Save the file and re-run the hardening script. The script should now complete without hanging.
Additional Security Context
The X-Powered-By header is considered a security risk because it provides attackers with specific version information that can be used to target known vulnerabilities.
If you set the restart parameter to False, the script will still attempt to perform the following hardening actions, but they may not take effect until a manual reboot or service restart:
-
Registry Modification: Adds
DisableServerHeader(DWORD: 1) toHKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters. -
IIS Configuration: Removes the header via the
applicationhost.configfile.
Recommendation: After completing the installation, manually restart the server or the World Wide Web Publishing Service during a scheduled maintenance window to ensure the information disclosure mitigations are active.