Ensure ‘host headers’ are on all sites

Best practice for systems running IIS, part of Hardening IIS:

Execute the following command to identify sites that are not configured to require host
headers:

%systemroot%\system32\inetsrv\appcmd list sites

Nessus audit file checks

<if>
<condition type:"AND"> 
<custom_item>
 type : AUDIT_POWERSHELL
 description: "IISPS:Check if PS Webadministration is available:IIS8"
 value_type : POLICY_TEXT
 value_data : "Powershell Webadministration is available"
 powershell_args: 'if($(get-module -listavailable Webadministration -Erroraction SilentlyContinue) -eq $Null){write-host "Powershell Webadministration is not available" } else {write-host "Powershell Webadministration is available" }'
</custom_item>
</condition>
<then>
<custom_item>
 type : AUDIT_POWERSHELL
 description: "IIS800014:Require Host Headers on all Sites:IIS8"
 value_type: POLICY_TEXT
 value_data: ""
 powershell_args: 'import-module Webadministration -DisableNameChecking; 
                   get-childitem IIS:\Sites | 
                   select -expandproperty Bindings | 
                   select -expandproperty Collection | 
                   where {$_.protocol -match \\"http\\" -and $_.bindinginformation -match \\":$\\"} ' 
 powershell_option: CAN_BE_NULL
</custom_item>
</then>
<else>
<custom_item>
 type : AUDIT_IIS_APPCMD
 description: "IIS800014:Require Host Headers on all Sites:IIS8"
 value_type : POLICY_TEXT
 appcmd_args: "list sites"
 value_data : '((http|https)\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+:[A-Za-z0-9\._-]+[|,])+'
 check_type : CHECK_REGEX
 </custom_item>
</else>
</if>

References