├── .gitattributes ├── BuildReview.psd1 ├── BuildReview.psm1 ├── Collection_Functions ├── Compare-Values.ps1 ├── FileBase64.ps1 ├── Get-AuditPolicy.ps1 ├── Get-InstalledSoftware.ps1 ├── Get-JavaVersions.ps1 ├── Get-MissingUpdates.ps1 ├── Get-ServiceUnquoted.ps1 ├── Invoke-BuildReview.tpl ├── Invoke-Check.ps1 ├── Read-LocalSecurity.ps1 └── Test-IsNull.ps1 ├── Functions ├── Export-AsHTML.ps1 ├── Get-CheckResult.ps1 ├── New-BuildReviewCollector.ps1 ├── New-HTML.ps1 ├── Out-FileFromBase64.ps1 └── Test-IsNull.ps1 ├── LICENSE ├── Policy ├── Test-XMLFiles.ps1 ├── definitions.xml └── policy.xml ├── README.md └── old scripts ├── Firewall-Enabled.ps1 ├── Get-FirewallRules.ps1 ├── Get-ServicePermission.ps1 ├── Read-AdvancedAuditPolicy.ps1 └── Read-SecPolicy.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /BuildReview.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneLogicalMyth/BuildReview-Windows/5906397d56365aab232bf65f083474e02411c4e6/BuildReview.psd1 -------------------------------------------------------------------------------- /BuildReview.psm1: -------------------------------------------------------------------------------- 1 | $global:BuildReviewRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition 2 | "$(Split-Path -Path $MyInvocation.MyCommand.Path)\Functions\*.ps1" | Resolve-Path | % { . $_.ProviderPath } 3 | -------------------------------------------------------------------------------- /Collection_Functions/Compare-Values.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Accepted Comparison Operators: 3 | eq Equal 4 | ne Not equal 5 | ge Greater than or equal 6 | gt Greater than 7 | lt Less than 8 | le Less than or equal 9 | like Wildcard comparison (use * for wildcard) 10 | notlike Wildcard comparison (use * for wildcard) 11 | between Greater than or equal to value and less than or equal than value2 12 | list compares to arrays and checks for differences if a difference is observed then a failure is returned 13 | #> 14 | Function Compare-Values { 15 | param($ObtainedValue=0,$Value=0,$Value2=0,$Comparison='eq') 16 | 17 | if($Comparison -eq 'list') 18 | { 19 | # split if string, split using the same char as the policy 20 | # as the char used for split should always match the expecting obtained value 21 | if($ObtainedValue -is [string]) 22 | { 23 | $ObtainedValue = $ObtainedValue.Split($Value2) 24 | } 25 | 26 | if((Test-IsNull -objectToCheck $Value) -and (Test-IsNull -objectToCheck $ObtainedValue)) 27 | { 28 | 'Pass' 29 | }elseif((Test-IsNull -objectToCheck $Value) -eq $false -and (Test-IsNull -objectToCheck $ObtainedValue) -eq $true){ 30 | 'Fail' 31 | }else{ 32 | 33 | $comres = Compare-Object -ReferenceObject @($Value.Split($Value2)) -DifferenceObject @($ObtainedValue) 34 | if($comres) 35 | { 36 | 'Fail' 37 | }else{ 38 | 'Pass' 39 | } 40 | } 41 | }elseif($Comparison -eq 'between') 42 | { 43 | if($ObtainedValue -ge $Value -and $ObtainedValue -le $Value2) 44 | { 45 | 'Pass' 46 | }else{ 47 | 'Fail' 48 | } 49 | }elseif($Comparison -like 'foreach-*'){ 50 | $Comparison = $Comparison.split('-')[1] 51 | $Passed = 'Pass' 52 | foreach($V in $Value) 53 | { 54 | if(-not (Invoke-Expression ('$ObtainedValue -' + $Comparison + ' $Value'))) 55 | { 56 | return 'Fail' 57 | } 58 | } 59 | $Passed 60 | }else{ 61 | if((Invoke-Expression ('$ObtainedValue -' + $Comparison + ' $Value'))) 62 | { 63 | 'Pass' 64 | }else{ 65 | 'Fail' 66 | } 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /Collection_Functions/FileBase64.ps1: -------------------------------------------------------------------------------- 1 | Function Read-FileToBase64 { 2 | param($FileName) 3 | [System.Convert]::ToBase64String(([System.IO.File]::ReadAllBytes($FileName))) 4 | } -------------------------------------------------------------------------------- /Collection_Functions/Get-AuditPolicy.ps1: -------------------------------------------------------------------------------- 1 | Function Get-AuditPolicy { 2 | 3 | $CurrentSettings = auditpol /get /category:* /r | ConvertFrom-Csv 4 | 5 | # Functions to create a new security object 6 | function Get-AuditType { 7 | param($RawValue) 8 | switch($RawValue) 9 | { 10 | "No Auditing"{0} 11 | "Success"{1} 12 | "Failure"{2} 13 | "Success and Failure"{3} 14 | } 15 | } 16 | Function New-AuditObj { 17 | Param($Category,$SubCategory,$Value) 18 | 19 | $Out = '' | Select-Object Category, SubCategory, RawValue, ConfiguredValue, RequiredValue, CheckResult, check_type 20 | $Out.Category = $Category 21 | $Out.SubCategory = $SubCategory 22 | $Out.RawValue = Get-AuditType $Value 23 | $Out.ConfiguredValue = $Value 24 | $Out.RequiredValue = $null 25 | $Out.CheckResult = $false 26 | $Out.check_type = 'AuditPol' 27 | $Out 28 | 29 | } 30 | 31 | $Categories = @{ 32 | # System category 33 | 'Security System Extension'='System' 34 | 'System Integrity'='System' 35 | 'IPsec Driver'='System' 36 | 'Other System Events'='System' 37 | 'Security State Change'='System' 38 | 39 | # Logon/Logoff category 40 | 'Logon'='Logon/Logoff' 41 | 'Logoff'='Logon/Logoff' 42 | 'Account Lockout'='Logon/Logoff' 43 | 'IPsec Main Mode'='Logon/Logoff' 44 | 'IPsec Quick Mode'='Logon/Logoff' 45 | 'IPsec Extended Mode'='Logon/Logoff' 46 | 'Special Logon'='Logon/Logoff' 47 | 'Other Logon/Logoff Events'='Logon/Logoff' 48 | 'Network Policy Server'='Logon/Logoff' 49 | 'User / Device Claims'='Logon/Logoff' 50 | 51 | # Object Access category 52 | 'File System'='Object Access' 53 | 'Registry'='Object Access' 54 | 'Kernel Object'='Object Access' 55 | 'SAM'='Object Access' 56 | 'Certification Services'='Object Access' 57 | 'Application Generated'='Object Access' 58 | 'Handle Manipulation'='Object Access' 59 | 'File Share'='Object Access' 60 | 'Filtering Platform Packet Drop'='Object Access' 61 | 'Filtering Platform Connection'='Object Access' 62 | 'Other Object Access Events'='Object Access' 63 | 'Detailed File Share'='Object Access' 64 | 'Removable Storage'='Object Access' 65 | 'Central Policy Staging'='Object Access' 66 | 67 | # Privilege Use category 68 | 'Sensitive Privilege Use'='Privilege Use' 69 | 'Non Sensitive Privilege Use'='Privilege Use' 70 | 'Other Privilege Use Events'='Privilege Use' 71 | 72 | # Detailed Tracking category 73 | 'Process Termination'='Detailed Tracking' 74 | 'DPAPI Activity'='Detailed Tracking' 75 | 'RPC Events'='Detailed Tracking' 76 | 'Process Creation'='Detailed Tracking' 77 | 'PNP Activity'='Detailed Tracking' 78 | 79 | # Policy Change category 80 | 'Audit Policy Change'='Policy Change' 81 | 'Authentication Policy Change'='Policy Change' 82 | 'Authorization Policy Change'='Policy Change' 83 | 'MPSSVC Rule-Level Policy Change'='Policy Change' 84 | 'Filtering Platform Policy Change'='Policy Change' 85 | 'Other Policy Change Events'='Policy Change' 86 | 87 | # Account Management category 88 | 'User Account Management'='Account Management' 89 | 'Computer Account Management'='Account Management' 90 | 'Security Group Management'='Account Management' 91 | 'Distribution Group Management'='Account Management' 92 | 'Application Group Management'='Account Management' 93 | 'Other Account Management Events'='Account Management' 94 | 95 | # DS Access category 96 | 'Directory Service Changes'='DS Access' 97 | 'Directory Service Replication'='DS Access' 98 | 'Detailed Directory Service Replication'='DS Access' 99 | 'Directory Service Access'='DS Access' 100 | 101 | # Account Logon category 102 | 'Kerberos Service Ticket Operations'='Account Logon' 103 | 'Other Account Logon Events'='Account Logon' 104 | 'Kerberos Authentication Service'='Account Logon' 105 | 'Credential Validation'='Account Logon' 106 | } 107 | 108 | $CurrentSettings | ?{ $_.Subcategory -ne $null } | Foreach{ 109 | 110 | if($Categories.keys -contains $_.SubCategory){ 111 | New-AuditObj -Category $Categories.$($_.SubCategory) -SubCategory $_.SubCategory -Value $_.'Inclusion Setting' 112 | }else{ 113 | 114 | New-AuditObj -Category 'Unknown' -SubCategory $_.SubCategory -Value $_.'Inclusion Setting' 115 | } 116 | 117 | 118 | } 119 | 120 | }#end -------------------------------------------------------------------------------- /Collection_Functions/Get-InstalledSoftware.ps1: -------------------------------------------------------------------------------- 1 | Function Get-InstalledSoftware { 2 | 3 | function Sort-InstallDate { 4 | param([string]$StringDate) 5 | 6 | $Y = $StringDate.Substring(0,4) 7 | $M = $StringDate.Substring(4,2) 8 | $D = $StringDate.Substring(6,2) 9 | [datetime]"$Y-$M-$D" 10 | 11 | } 12 | 13 | if((Test-Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall')){ 14 | [string[]]$RootKeys = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' 15 | }else{ 16 | [string[]]$RootKeys = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' 17 | } 18 | 19 | Get-ItemProperty -Path $RootKeys | Where-Object { 20 | ($_.DisplayName -notlike 'Security Update for Windows*' -AND 21 | $_.DisplayName -notlike 'Hotfix for Windows*' -AND 22 | $_.DisplayName -notlike 'Update for Windows*' -AND 23 | $_.DisplayName -notlike 'Update for Microsoft*' -AND 24 | $_.DisplayName -notlike 'Security Update for Microsoft*' -AND 25 | $_.DisplayName -notlike 'Hotfix for Microsoft*' -AND 26 | $_.PSChildName -notlike '*}.KB') } | Where-Object { $_.DisplayName -ne $null -AND $_.DisplayName -ne '' } | 27 | Select-Object Publisher, DisplayName, DisplayVersion, @{n='InstallDate';e={Sort-InstallDate $_.InstallDate}}, InstallLocation, @{n='EstimatedSizeMB';e={[math]::Round($_.EstimatedSize / 1024,2)}} 28 | 29 | 30 | } -------------------------------------------------------------------------------- /Collection_Functions/Get-JavaVersions.ps1: -------------------------------------------------------------------------------- 1 | Function Get-JavaVersions { 2 | begin 3 | { 4 | $LocalDisks = Get-PSDrive -PSProvider FileSystem | Select-Object -ExpandProperty Root 5 | } 6 | process 7 | { 8 | $JavaFiles = foreach($DriveRoot in $LocalDisks){ Get-ChildItem -Path $DriveRoot -Recurse -Name java.exe | foreach{ Join-Path $DriveRoot $_ } } 9 | foreach($JavaFile in $JavaFiles) 10 | { 11 | (Get-Item $JavaFile).VersionInfo | Select-Object FileName, FileVersion, ProductVersion, ProductName 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Collection_Functions/Get-MissingUpdates.ps1: -------------------------------------------------------------------------------- 1 | Function Get-MissingUpdates { 2 | param($Timeout=10) 3 | 4 | $StartTime = Get-Date 5 | $EndTime = (Get-Date).AddMinutes($Timeout) 6 | 7 | $Job = Start-Job -ScriptBlock { 8 | $CabFile = Join-Path $env:SystemDrive 'wsusscn2.cab' 9 | 10 | if(-not (Test-Path $CabFile)) 11 | { 12 | # try to download the cab file 13 | # more info at https://msdn.microsoft.com/en-us/library/windows/desktop/aa387290%28v=vs.85%29.aspx 14 | $url = 'http://download.windowsupdate.com/microsoftupdate/v6/wsusscan/wsusscn2.cab' 15 | (New-Object System.Net.webclient).DownloadFile($url,$CabFile) 16 | } 17 | 18 | $Session = New-Object -ComObject Microsoft.Update.Session 19 | $UServiceManager = New-Object -ComObject Microsoft.Update.ServiceManager 20 | 21 | # Remove old offline sync services 22 | $UServiceManager.Services | Where-Object { $_.Name -eq 'Offline Sync Service' } | Foreach{ $UServiceManager.RemoveService($_.ServiceID) } 23 | 24 | $UService = $UServiceManager.AddScanPackageService("Offline Sync Service", $CabFile) 25 | $Searcher = $Session.CreateUpdateSearcher() 26 | $Searcher.ServerSelection = 3 27 | 28 | $Services = $UServiceManager.Services | Where-Object { $_.OffersWindowsUpdates -eq $true } 29 | $Criteria = "IsInstalled=0" # Important updates that are not installed 30 | 31 | foreach($Service in $Services) 32 | { 33 | try 34 | { 35 | $Searcher.ServiceID = $Service.ServiceID 36 | $SearchResult = $Searcher.Search($Criteria) 37 | $SearchResult.Updates | Sort-Object MsrcSeverity | foreach{ 38 | $Out = '' | Select-Object Title, Severity, KB, SecurityBulletin, CVE, DateReleased 39 | $Out.Title = $_.Title 40 | $Out.Severity = $_.MsrcSeverity 41 | $Out.KB = "KB$($_.KBArticleIDs -join ',KB')" 42 | $Out.SecurityBulletin = $_.SecurityBulletinIDs -join ',' 43 | $Out.CVE = $_.CveIDs -join ',' 44 | $Out.DateReleased = $_.LastDeploymentChangeTime 45 | $OptionalUpdate = if($_.BrowseOnly){'Yes'}else{'No'} 46 | 47 | "" 48 | 49 | } 50 | } 51 | catch 52 | { 53 | Write-Warning "Unable to communicate with '$($Service.Name)' skipping this update service. This is perfectly fine." 54 | } 55 | } 56 | } 57 | 58 | while('Completed','Stopped' -notcontains $Job.State) 59 | { 60 | $Job = Get-Job $Job.Id 61 | 62 | Write-Host "$((get-Date).ToString('dd-MM-yyyy HH:mm:ss')) - Windows Update is processing please wait, run time is $([math]::Round(((Get-Date) - $StartTime).totalminutes)) minutes" 63 | 64 | if((Get-Date) -gt $EndTime) 65 | { 66 | Write-Host "$((get-Date).ToString('dd-MM-yyyy HH:mm:ss')) - Windows Update stopping due to timeout, run time was $([math]::Round(((Get-Date) - $StartTime).totalminutes)) minutes" -Foregroundcolor yellow 67 | $Job | Stop-Job 68 | } 69 | elseif($Job.State -eq 'Running') 70 | { 71 | Start-Sleep -Seconds 60 72 | } 73 | } 74 | 75 | $Job | Receive-Job 76 | $Job | Remove-Job 77 | 78 | }#end -------------------------------------------------------------------------------- /Collection_Functions/Get-ServiceUnquoted.ps1: -------------------------------------------------------------------------------- 1 | function Get-ServiceUnquoted { 2 | 3 | # find all paths to service .exe's that have a space in the path and aren't quoted 4 | $VulnServices = Get-WmiObject -Class win32_service | 5 | Where-Object {$_} | 6 | Where-Object {($_.pathname -ne $null) -and ($_.pathname.trim() -ne "")} | 7 | Where-Object {-not $_.pathname.StartsWith("`"")} | 8 | Where-Object {-not $_.pathname.StartsWith("'")} | 9 | Where-Object {($_.pathname.Substring(0, $_.pathname.IndexOf(".exe") + 4)) -match ".* .*"} 10 | 11 | if ($VulnServices) { 12 | ForEach ($Service in $VulnServices){ 13 | $Out = New-Object PSObject 14 | $Out | Add-Member Noteproperty 'ServiceName' $Service.name 15 | $Out | Add-Member Noteproperty 'Path' $Service.pathname 16 | $Out | Add-Member Noteproperty 'StartName' $Service.startname 17 | $Out 18 | } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /Collection_Functions/Invoke-BuildReview.tpl: -------------------------------------------------------------------------------- 1 | #region Start Build Review 2 | #load windows forms for output 3 | [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null 4 | 5 | # Check for admin rights 6 | $IsAdmin = (New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) 7 | if(-not $IsAdmin) 8 | { 9 | [system.windows.forms.messagebox]::Show('This needs to be run as administrator, please right click and select "run as administrator".','Build Review',0,16) 10 | exit 11 | } 12 | 13 | #Basic WMI calls 14 | $OSInfo = Get-Wmiobject Win32_operatingsystem 15 | $SYSInfo = Get-Wmiobject Win32_computersystem 16 | $IPs = (Get-Wmiobject win32_networkadapterconfiguration -Filter 'IPEnabled = "True"' | Select-Object -ExpandProperty IPAddress) -Join ',' 17 | 18 | [xml]$Policy = [System.Text.Encoding]::UNICODE.GetString([System.Convert]::FromBase64String($PolicyXML)) 19 | $Config = $Policy.Policy 20 | 21 | # Check for internet access, for Windows Update 22 | if(-not $DisableWindowsUpdate) 23 | { 24 | $CabFile = Join-Path $env:SystemDrive 'wsusscn2.cab' 25 | if(-not (Test-Path $CabFile)) 26 | { 27 | # try to download the cab file 28 | # more info at https://msdn.microsoft.com/en-us/library/windows/desktop/aa387290%28v=vs.85%29.aspx 29 | $url = 'http://download.windowsupdate.com/microsoftupdate/v6/wsusscan/wsusscn2.cab' 30 | try 31 | { 32 | (New-Object System.Net.webclient).DownloadFile($url,$CabFile) 33 | } 34 | catch 35 | { 36 | [system.windows.forms.messagebox]::Show("Unable to download the required files for missing Windows Update checks. Please download from 'http://download.windowsupdate.com/microsoftupdate/v6/wsusscan/wsusscn2.cab' and save to '$CabFile'.",'Build Review',0,16) 37 | exit 38 | } 39 | } 40 | } 41 | 42 | New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS | Out-Null 43 | 44 | # Add basic info to the XML for future reference 45 | $DomainRole = @{ 46 | 0='Standalone Workstation' 47 | 1='Member Workstation' 48 | 2='Standalone Server' 49 | 3='Member Server' 50 | 4='Backup Domain Controller' 51 | 5='Primary Domain Controller' 52 | } 53 | $XMLResults = $Policy.CreateElement('ComputerInfo') 54 | $XMLResults.InnerXml = "$($SYSInfo.DNSHostName)$($SYSInfo.Domain)$($SYSInfo.Manufacturer)$($OSInfo.OSArchitecture)$($SYSInfo.UserName)$($OSInfo.Caption)$($OSInfo.CSDVersion)$($DomainRole[([int]$SYSInfo.DomainRole)])$IPs" 55 | $Config.AppendChild($XMLResults) | Out-Null 56 | Remove-Variable XMLResults 57 | 58 | $DesktopPath = [Environment]::GetFolderPath("Desktop") 59 | $SaveResultTo = Join-Path $DesktopPath "$($SYSInfo.DNSHostName)_$((Get-Date).ToString('dd-MM-yyyy_HH-mm')).xml" 60 | 61 | $StartCollection = [system.windows.forms.messagebox]::Show('The Build Review tool will now start. Do you want to continue?','Build Review',4,32) 62 | if($StartCollection -ne 6) 63 | { 64 | exit 65 | } 66 | 67 | #Checks 68 | 69 | $CollectionsCount = @($Config.Collection).Count 70 | $i = 1 71 | 72 | Write-Host "$((get-Date).ToString('dd-MM-yyyy HH:mm:ss')) - Starting checks" 73 | foreach($Collection in $Config.Collection) 74 | { 75 | Write-Host "$((get-Date).ToString('dd-MM-yyyy HH:mm:ss')) - Processing check collection $i out of $CollectionsCount, please wait..." 76 | $i++ 77 | 78 | foreach($Group in $Collection.Group) 79 | { 80 | $XMLResults = $Policy.CreateElement('Results') 81 | $InnerXML = '' 82 | 83 | $CheckResults = Foreach($Check in $Group.Check) 84 | { 85 | 86 | $Result = Invoke-Check $Check $Config $OSInfo.Caption $SYSInfo.DomainRole 87 | $Result 88 | if($Result) 89 | { 90 | # `0 replaces a 0x00 byte string, that sometimes the registry uses instead of null 91 | $InnerXml += ($Result.XML -replace "`0") 92 | $Result.Object 93 | Remove-Variable Check,Result 94 | } 95 | } 96 | 97 | $XMLResults.InnerXml = $InnerXml 98 | $Group.AppendChild($XMLResults) | Out-Null 99 | 100 | 101 | $ChecksPassed = [int]($CheckResults | Group-Object CheckResult | Where-Object { $_.name -eq 'Pass' }).count 102 | $ChecksFailed = [int]($CheckResults | Group-Object CheckResult | Where-Object { $_.name -eq 'Fail' }).count 103 | 104 | if($Group.Comparison -eq 'and' -and $ChecksFailed -eq 0) 105 | { 106 | $Group.SetAttribute('GroupResult','Pass') 107 | 108 | }elseif($Group.Comparison -eq 'or' -and $ChecksPassed -gt 0) 109 | { 110 | $Group.SetAttribute('GroupResult','Pass') 111 | }else{ 112 | $Group.SetAttribute('GroupResult','Fail') 113 | } 114 | 115 | Remove-Variable Group,ChecksFailed,ChecksPassed,CheckResults 116 | 117 | } 118 | 119 | } 120 | 121 | 122 | #Missing Updates 123 | $XMLResults = $Policy.CreateElement('Collection') 124 | $XMLResults.SetAttribute('Name','MissingUpdates') 125 | if(-not $DisableWindowsUpdate) 126 | { 127 | $MissingUpdates = Get-MissingUpdates 128 | if($MissingUpdates) 129 | { 130 | $XMLResults.InnerXml = "$($MissingUpdates -Join '')" 131 | }else{ 132 | $XMLResults.InnerXml = "" 133 | } 134 | }else{ 135 | $XMLResults.InnerXml = "" 136 | } 137 | $Config.AppendChild($XMLResults) | Out-Null 138 | Remove-Variable XMLResults 139 | 140 | # grab a list of all Java binaries on the system 141 | $XMLResults = $Policy.CreateElement('Collection') 142 | $XMLResults.SetAttribute('Name','JavaBinaries') 143 | Write-Host "$((get-Date).ToString('dd-MM-yyyy HH:mm:ss')) - Looking for Java binaries, please wait..." 144 | $JavaBinaries = Get-JavaVersions | foreach{ "" } 145 | if($JavaBinaries) 146 | { 147 | $XMLResults.InnerXml = "$($JavaBinaries -join '')" 148 | }else{ 149 | $XMLResults.InnerXml = "" 150 | } 151 | $Config.AppendChild($XMLResults) | Out-Null 152 | Remove-Variable XMLResults 153 | 154 | #Remove all comments before saving 155 | $Policy.SelectNodes('.//comment()') | foreach{ $N = [System.Xml.XmlNode]$_; $N.ParentNode.RemoveChild($N) } | Out-Null 156 | 157 | # collect raw configuration files 158 | $ExportedPolicy = (Join-Path $env:TEMP SecurityPolicy.inf) 159 | $null = Invoke-Expression "secedit /export /cfg $ExportedPolicy" 160 | $SecPol = Read-FileToBase64 $ExportedPolicy 161 | Remove-Item $ExportedPolicy -Force 162 | 163 | Remove-Variable ExportedPolicy 164 | $ExportedPolicy = (Join-Path $env:TEMP GPResult.html) 165 | $null = Invoke-Expression "gpresult /H $ExportedPolicy /F" 166 | $gpresult = Read-FileToBase64 $ExportedPolicy 167 | Remove-Item $ExportedPolicy -Force 168 | 169 | Remove-Variable ExportedPolicy 170 | $ExportedPolicy = (Join-Path $env:TEMP auditpol.txt) 171 | $null = Invoke-Expression "auditpol /get /category:* > $ExportedPolicy" 172 | $auditpol = Read-FileToBase64 $ExportedPolicy 173 | Remove-Item $ExportedPolicy -Force 174 | 175 | $XMLResults = $Policy.CreateElement('FileDump') 176 | $XMLResults.InnerXml = "$SecPol$gpresult$auditpol" 177 | $Config.AppendChild($XMLResults) | Out-Null 178 | 179 | # Save output 180 | $SaveResultTo = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($SaveResultTo) 181 | $Policy.Save($SaveResultTo) 182 | 183 | [system.windows.forms.messagebox]::Show("Completed!`nResults have been saved to '$SaveResultTo'",'Build Review',0,64) -------------------------------------------------------------------------------- /Collection_Functions/Invoke-Check.ps1: -------------------------------------------------------------------------------- 1 | Function Invoke-Check { 2 | param([PSObject]$CheckData,$Config,$Caption,$DomainRole) 3 | 4 | #Check if requirements are met for check 5 | $CheckRequirements = $CheckData.Requirements -split ',' 6 | $MeetsRequirements = $false 7 | foreach($Requirement in $CheckRequirements) 8 | { 9 | if(-not $MeetsRequirements) 10 | { 11 | $Tmp = $Config.SelectNodes("//Requirements/Requirement[@ID=`"$Requirement`"]") 12 | if($Caption -like "*$($($Tmp).Caption)*" -and ($($Tmp).DomainRole -split ',') -contains $DomainRole) 13 | { 14 | $MeetsRequirements = $true 15 | } 16 | 17 | } 18 | } 19 | if(-not $MeetsRequirements) 20 | { 21 | return $false 22 | } 23 | 24 | #Preload any required data 25 | if(-not $Global:SecurityOptionsCache) 26 | { 27 | $Global:SecurityOptionsCache = Read-LocalSecurity 28 | } 29 | if(-not $Global:AuditPolCache) 30 | { 31 | $Global:AuditPolCache = Get-AuditPolicy 32 | } 33 | if(-not $Global:SoftwareCache) 34 | { 35 | $Global:SoftwareCache = Get-InstalledSoftware 36 | } 37 | 38 | # Function to resolve SID to username 39 | Function Get-UserFromSID { 40 | param($RawSID) 41 | 42 | try 43 | { 44 | $objSID = New-Object System.Security.Principal.SecurityIdentifier ($RawSID) 45 | $objUser = $objSID.Translate([System.Security.Principal.NTAccount]) 46 | "SID resolves to $($objUser.Value)" 47 | } 48 | catch 49 | { 50 | # Could not be translated so output SID 51 | # This caused when accounts are deleted but policies not cleaned afterwards 52 | # or possibly a foreign domain 53 | "SID could not be resolved, user might be deleted or on a foreign domain" 54 | } 55 | 56 | } 57 | 58 | Switch($CheckData.Type) 59 | { 60 | 61 | 'registry' 62 | { 63 | 64 | switch($CheckData.Hive) 65 | { 66 | 'HKLM' 67 | { 68 | $OutObj = '' | Select-Object KeyUsed, PropertyUsed, ObtainedValue, CheckResult, Note 69 | $OutObj.KeyUsed = "$($CheckData.Hive):\$($CheckData.Path)" 70 | $OutObj.PropertyUsed = $CheckData.Name 71 | try 72 | { 73 | $OutObj.ObtainedValue = (Get-ItemProperty $OutObj.KeyUsed -ErrorAction stop).$($CheckData.Name) 74 | $OutObj.Note = $null 75 | if((Test-IsNull $OutObj.ObtainedValue)) 76 | { 77 | $Value = $OutObj.ObtainedValue 78 | } 79 | } 80 | catch 81 | { 82 | $OutObj.ObtainedValue = $null 83 | $OutObj.Note = "Check Failed due to Error: $_" 84 | } 85 | $OutObj.CheckResult = Compare-Values -ObtainedValue $OutObj.ObtainedValue -Value $CheckData.Value -Value2 $CheckData.Value2 -Comparison $CheckData.Comparison 86 | 87 | @{ 88 | Object = $OutObj 89 | XML = "" 90 | } 91 | } 92 | 93 | 'HKU' 94 | { 95 | # Only include SIDs that begin with a S-1-5-21 but do not end with a _Classes this stops the default and network service profiles being checked 96 | $SIDs = Get-ChildItem HKU: | Select-Object -ExpandProperty PSChildName | Where-Object { $_ -like 'S-1-5-21*' -and $_ -notlike '*_Classes' } 97 | foreach($SID in $SIDs) 98 | { 99 | $OutObj = '' | Select-Object KeyUsed, PropertyUsed, ObtainedValue, CheckResult, Note 100 | $OutObj.KeyUsed = "HKU:\$SID\$($CheckData.Path)" 101 | $OutObj.PropertyUsed = $CheckData.Name 102 | try 103 | { 104 | $OutObj.ObtainedValue = (Get-ItemProperty $OutObj.KeyUsed -ErrorAction stop).$($CheckData.Name) 105 | $OutObj.Note = Get-UserFromSID -RawSID $SID 106 | if((Test-IsNull $OutObj.ObtainedValue)) 107 | { 108 | $OutObj.ObtainedValue = $null 109 | } 110 | } 111 | catch 112 | { 113 | $OutObj.ObtainedValue = $null 114 | $OutObj.Note = "Check Failed due to Error: $_" 115 | } 116 | $OutObj.CheckResult = Compare-Values -ObtainedValue $OutObj.ObtainedValue -Value $CheckData.Value -Value2 $CheckData.Value2 -Comparison $CheckData.Comparison 117 | 118 | @{ 119 | Object = $OutObj 120 | XML = "" 121 | } 122 | } 123 | } 124 | 125 | default 126 | { 127 | throw 'Registry check requires a valid hive!' 128 | } 129 | } 130 | 131 | } 132 | 133 | 'securityoption' 134 | { 135 | $OutObj = '' | Select-Object ObtainedValue, CheckResult, Note 136 | $SecPath = $CheckData.Name.Split('/') 137 | if($SecPath[0] -eq 'UserRightsAssignment') 138 | { 139 | $OutObj.ObtainedValue = ($Global:SecurityOptionsCache | Where-Object { $_.SettingType -eq $SecPath[0] -and $_.Name -eq $SecPath[1] }).Value 140 | }else 141 | { 142 | $OutObj.ObtainedValue = ($Global:SecurityOptionsCache | Where-Object { $_.SettingType -eq $SecPath[0] -and $_.Name -eq $SecPath[1] }).RawValue 143 | } 144 | 145 | $OutObj.CheckResult = Compare-Values -ObtainedValue $OutObj.ObtainedValue -Value $CheckData.Value -Value2 $CheckData.Value2 -Comparison $CheckData.Comparison 146 | $OutObj.Note = $null 147 | 148 | @{ 149 | Object = $OutObj 150 | XML = "" 151 | } 152 | } 153 | 154 | 'audit' 155 | { 156 | $OutObj = '' | Select-Object ObtainedValue, CheckResult, Note 157 | $OutObj.ObtainedValue = ($Global:AuditPolCache | Where-Object { $_.SubCategory -eq $CheckData.Name }).RawValue 158 | $OutObj.CheckResult = Compare-Values -ObtainedValue $OutObj.ObtainedValue -Value $CheckData.Value -Comparison $CheckData.Comparison 159 | $OutObj.Note = $null 160 | 161 | @{ 162 | Object = $OutObj 163 | XML = "" 164 | } 165 | 166 | } 167 | 168 | 'software' 169 | { 170 | $OutObj = '' | Select-Object ObtainedValue, CheckResult, Note 171 | $SoftwareInfo = $Global:SoftwareCache | Where-Object { $_.DisplayName -eq $CheckData.Name } 172 | $OutObj.ObtainedValue = $SoftwareInfo.$($CheckData.Value) 173 | if($CheckData.Value -eq 'DisplayVersion') 174 | { 175 | $OutObj.ObtainedValue = [version]$OutObj.ObtainedValue 176 | $ValueToCompare = [version]$CheckData.Value2 177 | }else 178 | { 179 | $ValueToCompare = $CheckData.Value2 180 | } 181 | $OutObj.CheckResult = Compare-Values -ObtainedValue $OutObj.ObtainedValue -Value $CheckData.Value2 -Comparison $CheckData.Comparison 182 | if($SoftwareInfo) 183 | { 184 | $OutObj.Note = $null 185 | }else{ 186 | $OutObj.Note = "$($CheckData.Name) is not installed on this computer." 187 | } 188 | 189 | 190 | @{ 191 | Object = $OutObj 192 | XML = "" 193 | } 194 | } 195 | 196 | 'wmi' 197 | { 198 | $OutObj = '' | Select-Object ObtainedValue, CheckResult, Note 199 | 200 | try 201 | { 202 | $QueryResult = Get-WmiObject -Query $CheckData.Query 203 | } 204 | catch 205 | { 206 | $OutObj.Note = "WMI query failed to run: $_" 207 | } 208 | 209 | $OutObj.ObtainedValue = $QueryResult | Select-Object -ExpandProperty $($CheckData.Name) 210 | $OutObj.CheckResult = Compare-Values -ObtainedValue $OutObj.ObtainedValue -Value $CheckData.Value -Value2 $CheckData.Value2 -Comparison $CheckData.Comparison 211 | 212 | @{ 213 | Object = $OutObj 214 | XML = "" 215 | } 216 | } 217 | 218 | default { Write-Warning "Type '$($CheckData.Type)' is not defined!" } 219 | 220 | } 221 | 222 | 223 | } -------------------------------------------------------------------------------- /Collection_Functions/Read-LocalSecurity.ps1: -------------------------------------------------------------------------------- 1 | 2 | Function Read-LocalSecurity { 3 | param($SecurityPolicyFile,[switch]$ShowPasswordPolicy,[switch]$ShowLockoutPolicy,[switch]$ShowSecurityOptions,[switch]$ShowUserRightsAssignment) 4 | 5 | # Function taken with thanks from https://blogs.technet.microsoft.com/heyscriptingguy/2011/08/20/use-powershell-to-work-with-any-ini-file/ 6 | function Get-IniContent ($filePath) 7 | { 8 | $ini = @{} 9 | switch -regex -file $FilePath 10 | { 11 | "^\[(.+)\]" # Section 12 | { 13 | $section = $matches[1] 14 | $ini[$section] = @{} 15 | $CommentCount = 0 16 | } 17 | "^(;.*)$" # Comment 18 | { 19 | $value = $matches[1] 20 | $CommentCount = $CommentCount + 1 21 | $name = “Comment” + $CommentCount 22 | $ini[$section][$name] = $value.trim() 23 | } 24 | "(.+?)\s*=(.*)" # Key 25 | { 26 | $name,$value = $matches[1..2] 27 | $ini[$section][$name] = $value.trim() 28 | } 29 | } 30 | return $ini 31 | } 32 | 33 | # Function to resolve SID to username 34 | Function Get-UserFromSID { 35 | param($SID) 36 | 37 | if([string]::IsNullOrEmpty($SID)) 38 | { 39 | return $null 40 | } 41 | 42 | $CleanSID = $SID.Replace('*','').Trim() 43 | 44 | $Result = foreach($RawSID IN $CleanSID.Split(',')) 45 | { 46 | try 47 | { 48 | $objSID = New-Object System.Security.Principal.SecurityIdentifier ($RawSID) 49 | $objUser = $objSID.Translate([System.Security.Principal.NTAccount]) 50 | $objUser.Value 51 | } 52 | catch 53 | { 54 | # Could not be translated so output SID 55 | # This caused when accounts are deleted but policies not cleaned afterwards 56 | # or possibly a foreign domain 57 | $RawSID 58 | } 59 | } 60 | 61 | $Result -join ',' 62 | 63 | } 64 | 65 | # Function to create a new security object 66 | Function New-SecObj { 67 | Param($SettingType,$Name,$DisplayName,$RawValue,$Value) 68 | 69 | $Out = '' | Select-Object SettingType, Name, DisplayName, RawValue, Value 70 | $Out.SettingType = $SettingType 71 | $Out.Name = $Name 72 | $Out.DisplayName = $DisplayName 73 | $Out.RawValue = $RawValue 74 | $Out.Value = $Value 75 | $Out 76 | 77 | } 78 | 79 | # If using provided file then ignore export 80 | if($SecurityPolicyFile){ 81 | # Export the security policy 82 | $ExportedPolicy = $SecurityPolicyFile 83 | 84 | # Temp file flag true 85 | $TempFileCreated = $false 86 | }else{ 87 | # Export the security policy 88 | $ExportedPolicy = (Join-Path $env:TEMP SecurityPolicyExport.inf) 89 | 90 | # Run the export of the security policy 91 | $null = Invoke-Expression "secedit /export /cfg $ExportedPolicy" 92 | 93 | # Temp file flag true 94 | $TempFileCreated = $true 95 | } 96 | 97 | 98 | # Check if successful or not 99 | if($LASTEXITCODE -eq 0){ 100 | # Successful so grab info 101 | $global:SecPol = Get-IniContent $ExportedPolicy 102 | 103 | # Convert to security policy to objects as it makes life easier 104 | $SystemAccess = New-Object psobject -Property $SecPol.'System Access' 105 | $AuditPolicy = New-Object psobject -Property $SecPol.'Event Audit' 106 | $PrivilegeRights = New-Object psobject -Property $SecPol.'Privilege Rights' 107 | 108 | # Create empty array to store objects 109 | $FinalOutput = @() 110 | 111 | # Password Policy 112 | $FinalOutput += New-SecObj -SettingType PasswordPolicy -Name EnforcePasswordHistory -DisplayName 'Enforce password history' -RawValue ([int]($SystemAccess.PasswordHistorySize)) -Value ([int]($SystemAccess.PasswordHistorySize)) 113 | $FinalOutput += New-SecObj -SettingType PasswordPolicy -Name MaximumPasswordAge -DisplayName 'Maximum password age' -RawValue ([int]($SystemAccess.MaximumPasswordAge)) -Value ([int]($SystemAccess.MaximumPasswordAge)) 114 | $FinalOutput += New-SecObj -SettingType PasswordPolicy -Name MinimumPasswordAge -DisplayName 'Minimum password age' -RawValue ([int]($SystemAccess.MinimumPasswordAge)) -Value ([int]($SystemAccess.MinimumPasswordAge)) 115 | $FinalOutput += New-SecObj -SettingType PasswordPolicy -Name MinimumPasswordLength -DisplayName 'Minimum password length' -RawValue ([int]($SystemAccess.MinimumPasswordLength)) -Value ([int]($SystemAccess.MinimumPasswordLength)) 116 | $FinalOutput += New-SecObj -SettingType PasswordPolicy -Name PasswordComplexity -DisplayName 'Password must meet complexity requirements' -RawValue ([int]($SystemAccess.PasswordComplexity)) -Value ([bool]([int]($SystemAccess.PasswordComplexity))) 117 | $FinalOutput += New-SecObj -SettingType PasswordPolicy -Name ReversibleEncryption -DisplayName 'Store passwords using reversible encryption' -RawValue ([int]($SystemAccess.ClearTextPassword)) -Value ([bool]([int]($SystemAccess.ClearTextPassword))) 118 | 119 | # Lockout Policy 120 | $FinalOutput += New-SecObj -SettingType LockoutPolicy -Name LockoutDuration -DisplayName 'Account lockout duration' -RawValue ([int]($SystemAccess.LockoutDuration)) -Value ([int]($SystemAccess.LockoutDuration)) 121 | $FinalOutput += New-SecObj -SettingType LockoutPolicy -Name LockoutThreshold -DisplayName 'Account lockout threshold'-RawValue ([int]($SystemAccess.LockoutBadCount)) -Value ([int]($SystemAccess.LockoutBadCount)) 122 | $FinalOutput += New-SecObj -SettingType LockoutPolicy -Name ResetLockoutCount -DisplayName 'Reset account lockout counter after' -RawValue ([int]($SystemAccess.ResetLockoutCount)) -Value ([int]($SystemAccess.ResetLockoutCount)) 123 | 124 | # Audit Policy (legacy) 125 | function AuditType { 126 | param($RawValue) 127 | switch($RawValue) 128 | { 129 | 0 {"No Auditing"} 130 | 1 {"Success"} 131 | 2 {"Failure"} 132 | 3 {"Success, Failure"} 133 | } 134 | } 135 | 136 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditAccountLogon -RawValue ([int]($AuditPolicy.AuditAccountLogon)) -Value (AuditType ([int]($AuditPolicy.AuditAccountLogon))) 137 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditAccountManage -RawValue ([int]($AuditPolicy.AuditAccountManage)) -Value (AuditType ([int]($AuditPolicy.AuditAccountManage))) 138 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditDSAccess -RawValue ([int]($AuditPolicy.AuditDSAccess)) -Value (AuditType ([int]($AuditPolicy.AuditDSAccess))) 139 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditLogonEvents -RawValue ([int]($AuditPolicy.AuditLogonEvents)) -Value (AuditType ([int]($AuditPolicy.AuditLogonEvents))) 140 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditObjectAccess -RawValue ([int]($AuditPolicy.AuditObjectAccess)) -Value (AuditType ([int]($AuditPolicy.AuditObjectAccess))) 141 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditPolicyChange -RawValue ([int]($AuditPolicy.AuditPolicyChange)) -Value (AuditType ([int]($AuditPolicy.AuditPolicyChange))) 142 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditPrivilegeUse -RawValue ([int]($AuditPolicy.AuditPrivilegeUse)) -Value (AuditType ([int]($AuditPolicy.AuditPrivilegeUse))) 143 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditProcessTracking -RawValue ([int]($AuditPolicy.AuditProcessTracking)) -Value (AuditType ([int]($AuditPolicy.AuditProcessTracking))) 144 | $FinalOutput += New-SecObj -SettingType AuditPolicy -Name AuditSystemEvents -RawValue ([int]($AuditPolicy.AuditSystemEvents)) -Value (AuditType ([int]($AuditPolicy.AuditSystemEvents))) 145 | 146 | # Security Options (work in progress) 147 | function EorD { 148 | param($RawValue) 149 | 150 | switch($RawValue) 151 | { 152 | 0 {"Disabled"} 153 | 1 {"Enabled"} 154 | } 155 | 156 | } 157 | 158 | # Process MS account block status 159 | if($SecPol.'Registry Values'.'MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoConnectedUser'){ 160 | $BlockMSAccountsRaw = $SecPol.'Registry Values'.'MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoConnectedUser'.Split(',')[1] 161 | $BlockMSAccountsValue = switch($BlockMSAccountsRaw) 162 | { 163 | 0 {"This policy is disabled"} 164 | 1 {"Users can't add Microsoft accounts"} 165 | 3 {"Users can't add or log on with Microsoft accounts"} 166 | } 167 | }else{ 168 | $BlockMSAccountsRaw = -1 169 | $BlockMSAccountsValue = "Not Defined" 170 | } 171 | 172 | # console password use 173 | $LimitBlankPasswordUse = $SecPol.'Registry Values'.'MACHINE\System\CurrentControlSet\Control\Lsa\LimitBlankPasswordUse'.Split(',')[1] 174 | 175 | # Security Options 176 | $FinalOutput += New-SecObj -SettingType SecurityOptions:Accounts -Name AdminAccountStatus -DisplayName 'Administrator account status' -RawValue ([int]($SystemAccess.EnableAdminAccount)) -Value (EorD ([int]($SystemAccess.EnableAdminAccount))) 177 | $FinalOutput += New-SecObj -SettingType SecurityOptions:Accounts -Name BlockMSAccounts -DisplayName 'Block Microsoft accounts' -RawValue ([int]($BlockMSAccountsRaw)) -Value $BlockMSAccountsValue 178 | $FinalOutput += New-SecObj -SettingType SecurityOptions:Accounts -Name GuestAccountStatus -DisplayName 'Guest account status' -RawValue ([int]($SystemAccess.EnableGuestAccount)) -Value (EorD ([int]($SystemAccess.EnableGuestAccount))) 179 | $FinalOutput += New-SecObj -SettingType SecurityOptions:Accounts -Name LimitBlankPasswordUse -DisplayName 'Limit local account use of blank passwords to console logon only' -RawValue ([int]($LimitBlankPasswordUse)) -Value (EorD ([int]($LimitBlankPasswordUse))) 180 | $FinalOutput += New-SecObj -SettingType SecurityOptions:NetworkAccess -Name LSAAnonymousNameLookup -DisplayName 'Network access: Allow anonymous SID/Name translation' -RawValue ([int]($SystemAccess.LSAAnonymousNameLookup )) -Value (EorD ([int]($SystemAccess.LSAAnonymousNameLookup ))) 181 | $FinalOutput += New-SecObj -SettingType SecurityOptions:NetworkSecurity -Name ForceLogoffWhenHourExpire -DisplayName 'Network security: Force logoff when logon hours expire' -RawValue ([int]($SystemAccess.ForceLogoffWhenHourExpire )) -Value (EorD ([int]($SystemAccess.ForceLogoffWhenHourExpire ))) 182 | 183 | 184 | $FinalOutput += New-SecObj -SettingType SecurityOptions:Accounts -Name RenameAdministrator -DisplayName 'Rename administrator account' -RawValue ([string]($SystemAccess.NewAdministratorName).Replace('"','').trim()) -Value ([string]($SystemAccess.NewAdministratorName).Replace('"','').trim()) 185 | $FinalOutput += New-SecObj -SettingType SecurityOptions:Accounts -Name RenameGuest -DisplayName 'Rename guest account' -RawValue ([string]($SystemAccess.NewGuestName).Replace('"','').trim()) -Value ([string]($SystemAccess.NewGuestName).Replace('"','').trim()) 186 | 187 | # User rights assignment 188 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeNetworkLogonRight -DisplayName 'Access this computer from the network' -RawValue $PrivilegeRights.SeNetworkLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeNetworkLogonRight ) 189 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeBackupPrivilege -DisplayName 'Back up files and directories' -RawValue $PrivilegeRights.SeBackupPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeBackupPrivilege ) 190 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeChangeNotifyPrivilege -DisplayName 'Bypass traverse checking' -RawValue $PrivilegeRights.SeChangeNotifyPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeChangeNotifyPrivilege ) 191 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeSystemtimePrivilege -DisplayName 'Change the system time' -RawValue $PrivilegeRights.SeSystemtimePrivilege -Value (Get-UserFromSID $PrivilegeRights.SeSystemtimePrivilege ) 192 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeCreatePagefilePrivilege -DisplayName 'Create a pagefile' -RawValue $PrivilegeRights.SeCreatePagefilePrivilege -Value (Get-UserFromSID $PrivilegeRights.SeCreatePagefilePrivilege ) 193 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeDebugPrivilege -DisplayName 'Debug programs' -RawValue $PrivilegeRights.SeDebugPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeDebugPrivilege ) 194 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeRemoteShutdownPrivilege -DisplayName 'Force shutdown from a remote system' -RawValue $PrivilegeRights.SeRemoteShutdownPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeRemoteShutdownPrivilege ) 195 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeAuditPrivilege -DisplayName 'Manage auditing and security log' -RawValue $PrivilegeRights.SeAuditPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeAuditPrivilege ) 196 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeIncreaseQuotaPrivilege -DisplayName 'Adjust memory quotas for a process' -RawValue $PrivilegeRights.SeIncreaseQuotaPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeIncreaseQuotaPrivilege ) 197 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeIncreaseBasePriorityPrivilege -DisplayName 'Increase scheduling priority' -RawValue $PrivilegeRights.SeIncreaseBasePriorityPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeIncreaseBasePriorityPrivilege) 198 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeLoadDriverPrivilege -DisplayName 'Load and unload device drivers' -RawValue $PrivilegeRights.SeLoadDriverPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeLoadDriverPrivilege ) 199 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeBatchLogonRight -DisplayName 'Log on as a batch job' -RawValue $PrivilegeRights.SeBatchLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeBatchLogonRight ) 200 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeServiceLogonRight -DisplayName 'Log on as a service' -RawValue $PrivilegeRights.SeServiceLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeServiceLogonRight ) 201 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeInteractiveLogonRight -DisplayName 'Log on locally' -RawValue $PrivilegeRights.SeInteractiveLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeInteractiveLogonRight ) 202 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeSecurityPrivilege -DisplayName 'Generate security audits' -RawValue $PrivilegeRights.SeSecurityPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeSecurityPrivilege ) 203 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeSystemEnvironmentPrivilege -DisplayName 'Modify firmware environment values' -RawValue $PrivilegeRights.SeSystemEnvironmentPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeSystemEnvironmentPrivilege ) 204 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeProfileSingleProcessPrivilege -DisplayName 'Profile single process' -RawValue $PrivilegeRights.SeProfileSingleProcessPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeProfileSingleProcessPrivilege) 205 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeSystemProfilePrivilege -DisplayName 'Profile system performance' -RawValue $PrivilegeRights.SeSystemProfilePrivilege -Value (Get-UserFromSID $PrivilegeRights.SeSystemProfilePrivilege ) 206 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeAssignPrimaryTokenPrivilege -DisplayName 'Replace a process level token' -RawValue $PrivilegeRights.SeAssignPrimaryTokenPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeAssignPrimaryTokenPrivilege ) 207 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeRestorePrivilege -DisplayName 'Restore files and directories' -RawValue $PrivilegeRights.SeRestorePrivilege -Value (Get-UserFromSID $PrivilegeRights.SeRestorePrivilege ) 208 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeShutdownPrivilege -DisplayName 'Shut down the system' -RawValue $PrivilegeRights.SeShutdownPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeShutdownPrivilege ) 209 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeTakeOwnershipPrivilege -DisplayName 'Take ownership of files or other objects' -RawValue $PrivilegeRights.SeTakeOwnershipPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeTakeOwnershipPrivilege ) 210 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeDenyNetworkLogonRight -DisplayName 'Deny access to this computer from the network' -RawValue $PrivilegeRights.SeDenyNetworkLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeDenyNetworkLogonRight ) 211 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeDenyInteractiveLogonRight -DisplayName 'Deny log on locally' -RawValue $PrivilegeRights.SeDenyInteractiveLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeDenyInteractiveLogonRight ) 212 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeUndockPrivilege -DisplayName 'Remove computer from docking station' -RawValue $PrivilegeRights.SeUndockPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeUndockPrivilege ) 213 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeManageVolumePrivilege -DisplayName 'Perform volume maintenance tasks' -RawValue $PrivilegeRights.SeManageVolumePrivilege -Value (Get-UserFromSID $PrivilegeRights.SeManageVolumePrivilege ) 214 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeRemoteInteractiveLogonRight -DisplayName 'Allow log on through Remote Desktop Services' -RawValue $PrivilegeRights.SeRemoteInteractiveLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeRemoteInteractiveLogonRight ) 215 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeImpersonatePrivilege -DisplayName 'Impersonate a client after authentication' -RawValue $PrivilegeRights.SeImpersonatePrivilege -Value (Get-UserFromSID $PrivilegeRights.SeImpersonatePrivilege ) 216 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeCreateGlobalPrivilege -DisplayName 'Create global objects' -RawValue $PrivilegeRights.SeCreateGlobalPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeCreateGlobalPrivilege ) 217 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeIncreaseWorkingSetPrivilege -DisplayName 'Increase a process working set' -RawValue $PrivilegeRights.SeIncreaseWorkingSetPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeIncreaseWorkingSetPrivilege ) 218 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeTimeZonePrivilege -DisplayName 'Change the Time Zone' -RawValue $PrivilegeRights.SeTimeZonePrivilege -Value (Get-UserFromSID $PrivilegeRights.SeTimeZonePrivilege ) 219 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeCreateSymbolicLinkPrivilege -DisplayName 'Create symbolic links' -RawValue $PrivilegeRights.SeCreateSymbolicLinkPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeCreateSymbolicLinkPrivilege ) 220 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeLockMemoryPrivilege -DisplayName 'Lock pages in memory' -RawValue $PrivilegeRights.SeLockMemoryPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeLockMemoryPrivilege ) 221 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeCreatePermanentPrivilege -DisplayName 'Create permanent shared objects' -RawValue $PrivilegeRights.SeCreatePermanentPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeCreatePermanentPrivilege ) 222 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeMachineAccountPrivilege -DisplayName 'Add workstations to domain' -RawValue $PrivilegeRights.SeMachineAccountPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeMachineAccountPrivilege ) 223 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeTcbPrivilege -DisplayName 'Act as part of the operating system' -RawValue $PrivilegeRights.SeTcbPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeTcbPrivilege ) 224 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeDenyBatchLogonRight -DisplayName 'Deny logon as a batch job' -RawValue $PrivilegeRights.SeDenyBatchLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeDenyBatchLogonRight ) 225 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeDenyServiceLogonRight -DisplayName 'Deny logon as a service' -RawValue $PrivilegeRights.SeDenyServiceLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeDenyServiceLogonRight ) 226 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeDenyInteractiveLogonRight -DisplayName 'Deny local logon' -RawValue $PrivilegeRights.SeDenyInteractiveLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeDenyInteractiveLogonRight ) 227 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeDenyRemoteInteractiveLogonRight -DisplayName 'Deny logon through Terminal Services' -RawValue $PrivilegeRights.SeDenyRemoteInteractiveLogonRight -Value (Get-UserFromSID $PrivilegeRights.SeDenyRemoteInteractiveLogonRight ) 228 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeCreateTokenPrivilege -DisplayName 'Create a token object' -RawValue $PrivilegeRights.SeCreateTokenPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeCreateTokenPrivilege ) 229 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeTrustedCredManAccessPrivilege -DisplayName 'Access Credential Manager as a trusted caller' -RawValue $PrivilegeRights.SeTrustedCredManAccessPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeTrustedCredManAccessPrivilege ) 230 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeRelabelPrivilege -DisplayName 'Modify an object label' -RawValue $PrivilegeRights.SeRelabelPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeRelabelPrivilege ) 231 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeEnableDelegationPrivilege -DisplayName 'Enable computer and user accounts to be trusted for delegation' -RawValue $PrivilegeRights.SeEnableDelegationPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeEnableDelegationPrivilege ) 232 | $FinalOutput += New-SecObj -SettingType UserRightsAssignment -Name SeSyncAgentPrivilege -DisplayName 'Synchronize directory service data' -RawValue $PrivilegeRights.SeSyncAgentPrivilege -Value (Get-UserFromSID $PrivilegeRights.SeSyncAgentPrivilege ) 233 | 234 | 235 | # Output cleaned password policy 236 | if(-not $ShowLockoutPolicy -and -not $ShowPasswordPolicy -and -not $ShowSecurityOptions -and -not $ShowUserRightsAssignment) 237 | { 238 | $FinalOutput 239 | } 240 | if($ShowPasswordPolicy){ 241 | $FinalOutput | Where-Object { $_.SettingType -eq 'PasswordPolicy' } 242 | } 243 | if($ShowLockoutPolicy){ 244 | $FinalOutput | Where-Object { $_.SettingType -eq 'LockoutPolicy' } 245 | } 246 | if($ShowSecurityOptions){ 247 | $FinalOutput | Where-Object { $_.SettingType -like 'SecurityOptions*' } 248 | } 249 | if($ShowUserRightsAssignment){ 250 | $FinalOutput | Where-Object { $_.SettingType -eq 'UserRightsAssignment' } 251 | } 252 | 253 | # Clean up remove exported policy 254 | if($TempFileCreated){ 255 | Remove-Item $ExportedPolicy 256 | } 257 | }else{ 258 | 259 | # Handle secedit error 260 | Write-Error "secedit failed to run - $(([ComponentModel.Win32Exception]$LASTEXITCODE).Message)" -TargetObject secedit -ErrorId $LASTEXITCODE 261 | 262 | } 263 | } -------------------------------------------------------------------------------- /Collection_Functions/Test-IsNull.ps1: -------------------------------------------------------------------------------- 1 | function Test-IsNull($objectToCheck) { 2 | if ($objectToCheck -eq $null) { 3 | return $true 4 | } 5 | 6 | if ($objectToCheck -is [String] -and $objectToCheck -eq [String]::Empty) { 7 | return $true 8 | } 9 | 10 | if ($objectToCheck -is [DBNull]) { 11 | return $true 12 | } 13 | 14 | return $false 15 | }#end -------------------------------------------------------------------------------- /Functions/Export-AsHTML.ps1: -------------------------------------------------------------------------------- 1 | Function Export-AsHTML { 2 | param($InputFolder='.\') 3 | 4 | # Used for building a host list at the end 5 | $global:Hosts = @() 6 | 7 | Write-Progress -Activity 'Exporting Build Review Results to HTML' -Status 'Building File List' -PercentComplete 25 8 | 9 | # import required AssemblyName 10 | Add-Type -AssemblyName System.Web 11 | 12 | $Files = Get-ChildItem -Path $InputFolder -Filter *.xml 13 | if(-not $Files) 14 | { 15 | throw 'No files found to merge into a report!' 16 | return 17 | } 18 | 19 | [xml]$Def = Get-Content (Join-Path $global:BuildReviewRoot 'Policy\definitions.xml') 20 | 21 | $VulnID = 1 22 | $TableID = 1 23 | 24 | # create object to store results 25 | $FinalResult = '' | Select-Object Result 26 | $FinalResult.Result = @() 27 | 28 | Foreach($File in $Files) 29 | { 30 | [xml]$Result = Get-Content $File.FullName 31 | 32 | # output raw files 33 | $TooloutputFolder = Join-Path -Path (Resolve-Path $InputFolder) -ChildPath 'tool-output' 34 | if(-not (Test-Path $TooloutputFolder)) 35 | { 36 | New-Item $TooloutputFolder -ItemType Directory | Out-Null 37 | } 38 | $Result.Policy.FileDump.File | foreach { 39 | $FileOut = (Join-Path $TooloutputFolder "$($Result.Policy.ComputerInfo.HostName)-$($_.Name)") 40 | Write-Progress -Activity 'Exporting Build Review Results to HTML' -Status "Exporting Raw Files from '$($File.Name)'" -CurrentOperation "Exporting raw file $($_.Name)" -PercentComplete 50 41 | Out-FileFromBase64 -Base64 $_.'#text' -FileName $FileOut 42 | Remove-Variable FileOut 43 | } 44 | 45 | # add to host list 46 | $FileDevices = (New-Object -TypeName PSObject -Property @{ 47 | 'HostName'=$Result.Policy.ComputerInfo.HostName 48 | 'OS'=$Result.Policy.ComputerInfo.OS 49 | }) 50 | $Hosts += @($FileDevices) 51 | 52 | # Checks to exclude from collections or groups 53 | $CheckIDsToExclude = $Def.Definitions.Checks.Check | Select-Object -ExpandProperty CID 54 | 55 | # process collections 56 | foreach($Collection in ($Def.Definitions.Collections.Collection)) 57 | { 58 | Write-Progress -Activity 'Exporting Build Review Results to HTML' -Status "Exporting Collection Results from '$($File.Name)'" -CurrentOperation "Processing results for '$($Collection.name)'" -PercentComplete 75 59 | 60 | # check to see if any groups are excluded from this result 61 | $ResultCollection = $Result.SelectNodes("//Collection[@Name=`"$($Collection.name)`"]").Group 62 | $GroupsForCollection = $Def.Definitions.Groups.Group | Where-Object { $_.collection -eq $Collection.name } 63 | $ResultGroups = foreach($ResultCollectionGroup in $ResultCollection) 64 | { 65 | # excludes any defined groups 66 | if(-not ($GroupsForCollection | Where-Object { $_.name -eq $ResultCollectionGroup.Name }) -and $ResultCollectionGroup.GroupResult -ne 'Pass') 67 | { 68 | foreach($CheckResult in $ResultCollectionGroup.Results.Result) 69 | { 70 | if($CheckIDsToExclude -notcontains $CheckResult.CID -and $CheckResult.CheckResult -ne 'Pass') 71 | { 72 | # process group and add results to table array for collection 73 | Get-CheckResult $Result $CheckResult $Def 74 | $CollectionHasResults = $true 75 | } 76 | } 77 | } 78 | } 79 | 80 | if($CollectionHasResults) 81 | { 82 | $FinalResult.Result += (New-Object -TypeName PSObject -Property @{ 83 | 'Title'=$Collection.Title 84 | 'Description'=$Collection.Description 85 | 'LongRecommendation'=$Collection.LongRecommendation 86 | 'ShortRecommendation'=$Collection.ShortRecommendation 87 | 'Devices'=$FileDevices 88 | 'TableTitle'=$Collection.TableTitle 89 | 'TableResults'=$ResultGroups 90 | 'Details'=$Collection.Details 91 | 'ExternalReference'=$Collection.ExternalReference 92 | }) 93 | 94 | $CollectionHasResults = $false 95 | } 96 | } 97 | 98 | #process groups 99 | foreach($Group in ($Def.Definitions.Groups.Group)) 100 | { 101 | Write-Progress -Activity 'Exporting Build Review Results to HTML' -Status "Exporting Group Results from '$($File.Name)'" -CurrentOperation "Processing results for '$($Group.name)'" -PercentComplete 85 102 | 103 | # check to see if any groups are excluded from this result 104 | $ResultGroup = $Result.SelectNodes("//Group[@Name=`"$($Group.name)`"]") 105 | if($ResultGroup.GroupResult -eq 'Fail') 106 | { 107 | $GroupChecks = foreach($CheckResult in $ResultGroup.Results.Result) 108 | { 109 | if($CheckIDsToExclude -notcontains $CheckResult.CID -and $CheckResult.CheckResult -ne 'Pass') 110 | { 111 | # process group and add results to table array for collection 112 | Get-CheckResult $Result $CheckResult $Def 113 | $GroupHasResults = $true 114 | } 115 | } 116 | 117 | if($GroupHasResults) 118 | { 119 | 120 | $FinalResult.Result += (New-Object -TypeName PSObject -Property @{ 121 | 'Title'=$Group.Title 122 | 'Description'=$Group.Description 123 | 'LongRecommendation'=$Group.LongRecommendation 124 | 'ShortRecommendation'=$Group.ShortRecommendation 125 | 'Devices'=$FileDevices 126 | 'TableTitle'=$Group.TableTitle 127 | 'TableResults'=$GroupChecks 128 | 'Details'=$Group.Details 129 | 'ExternalReference'=$Group.ExternalReference 130 | }) 131 | 132 | $GroupHasResults = $false 133 | } 134 | } 135 | } 136 | 137 | #process checks 138 | foreach($Check in ($Def.Definitions.Checks.Check)) 139 | { 140 | Write-Progress -Activity 'Exporting Build Review Results to HTML' -Status "Exporting Indivdual Check Results from '$($File.Name)'" -CurrentOperation "Processing results for '$($Check.CID)'" -PercentComplete 90 141 | 142 | # check to see if any groups are excluded from this result 143 | $CheckResult = $Result.SelectNodes("//Result[@CID=`"$($Check.CID)`"]") 144 | $CheckData = Get-CheckResult $Result $CheckResult $Def 145 | $Details = $Check.Details -replace '{{VALUE}}',$CheckData.'Value Obtained' 146 | 147 | if($CheckResult.CheckResult -eq 'Fail') 148 | { 149 | 150 | $FinalResult.Result += (New-Object -TypeName PSObject -Property @{ 151 | 'Title'=$Check.Title 152 | 'Description'=$Check.Description 153 | 'LongRecommendation'=$Check.LongRecommendation 154 | 'ShortRecommendation'=$Check.ShortRecommendation 155 | 'Devices'=$FileDevices 156 | 'TableTitle'=$null 157 | 'TableResults'=$null 158 | 'Details'=$Details 159 | 'ExternalReference'=$Check.ExternalReference 160 | }) 161 | 162 | } 163 | } 164 | 165 | } 166 | 167 | # start to build the HTML output 168 | $FinalResult = $FinalResult.Result | Group-Object Title 169 | $HTML = '' 170 | 171 | # build the devices in scope of review 172 | $HTML += "

Hosts for Review

$($Hosts | Foreach { 173 | '' 178 | })
HostnameOS
' 174 | $($Hosts.HostName) 175 | '' 176 | $($Hosts.OS) 177 | '
" 179 | 180 | # build summary of findings 181 | $HTML += '

Summary of Findings

The below summary lists the findings identified during the review. Click the left hand number for further details.

' 182 | $HTML += '' 183 | $HTML += $FinalResult | %{ 184 | 185 | $ResultTmp = $_ 186 | $FirstRow = $ResultTmp.Group | Select-Object -First 1 187 | $VulnDevices = @($ResultTmp.Group | Select-Object -ExpandProperty Devices) 188 | "" 189 | 190 | $VulnID++ 191 | 192 | } 193 | $HTML += '
#TitleRecommendationAffected Hosts
$($VulnID)$($FirstRow.Title)$($FirstRow.ShortRecommendation)$($VulnDevices.Count)
' 194 | 195 | # build the main body of the report 196 | $VulnID = 1 197 | $HTML += '

Finding Details

' 198 | $HTML += $FinalResult | %{ 199 | 200 | $ResultTmp = $_ 201 | $FirstRow = $ResultTmp.Group | Select-Object -First 1 202 | Write-Progress -Activity 'Exporting Build Review Results to HTML' -Status "Merging all Results" -CurrentOperation "Processing Vulnerability '$($FirstRow.Title)'" -PercentComplete 100 203 | 204 | '
' 205 | "

$($FirstRow.Title)

    " 206 | $ResultTmp.Group | Select-Object -ExpandProperty Devices | %{ "
  • $($_.HostName)
  • " } 207 | '
' 208 | '

Description

' 209 | "

$($FirstRow.Description)

" 210 | if($FirstRow.ExternalReference){ "

External Reference

"} 211 | '

Recommendation

' 212 | "

$($FirstRow.LongRecommendation)

" 213 | '

Detail

' 214 | 215 | if($FirstRow.TableTitle) 216 | { 217 | $TableResults = ($ResultTmp.Group | Select-Object -ExpandProperty TableResults | Sort-Object Description,Host | ConvertTo-Html -Fragment) -replace '','
' 218 | }else{ 219 | $TableResults = $null 220 | } 221 | 222 | $AllDetails = $ResultTmp.Group | Select-Object -ExpandProperty Details 223 | if(@($AllDetails).Count -gt 0 -and $TableResults -eq $null) 224 | { 225 | $Details = $AllDetails -Join "`r`n" 226 | }else{ 227 | $Details = '

' + $FirstRow.Details + '

' + $TableResults 228 | } 229 | 230 | $Details 231 | $VulnID++ 232 | '' 233 | } 234 | 235 | 236 | # complete the HTML file and save to disk 237 | $HTML = New-HTML $HTML 238 | $HTMLPath = Join-Path (Resolve-Path $InputFolder) "BuildReview-Results-$(get-date -Format D).html" 239 | $HTML | Out-File -FilePath $HTMLPath -Encoding ascii -Force 240 | 241 | # move file to tool-output folder to mark it as complete 242 | $Files | Move-Item -Destination $TooloutputFolder 243 | 244 | } -------------------------------------------------------------------------------- /Functions/Get-CheckResult.ps1: -------------------------------------------------------------------------------- 1 | Function Get-CheckResult { 2 | param($ResultXML,$CheckResult,$Definition) 3 | 4 | if($CheckResult.ParentNode.ParentNode.Name -eq 'MissingUpdates') 5 | { 6 | 7 | $Out = '' | Select-Object Host, Title, Severity, KB, SecurityBulletin, CVE, DateReleased, OptionalUpdate, UpdateService 8 | $Out.Host = $ResultXML.Policy.ComputerInfo.HostName 9 | $Out.Title = $CheckResult.Title 10 | $Out.Severity = $CheckResult.Severity 11 | $Out.KB = $CheckResult.KB 12 | $Out.SecurityBulletin = $CheckResult.SecurityBulletin 13 | $Out.CVE = $CheckResult.CVE 14 | $Out.DateReleased = $CheckResult.DateReleased 15 | $Out.OptionalUpdate = $CheckResult.OptionalUpdate 16 | $Out.UpdateService = $CheckResult.UpdateService 17 | $Out 18 | 19 | }elseif($CheckResult.ParentNode.ParentNode.Name -eq 'JavaVersions') 20 | { 21 | 22 | $Out = '' | Select-Object Host, FileName, FileVersion, ProductVersion, ProductName 23 | $Out.Host = $ResultXML.Policy.ComputerInfo.HostName 24 | $Out.FileName = $CheckResult.FileName 25 | $Out.FileVersion = $CheckResult.FileVersion 26 | $Out.ProductVersion = $CheckResult.ProductVersion 27 | $Out.ProductName = $CheckResult.ProductName 28 | $Out 29 | 30 | }else{ 31 | 32 | # get check 33 | $CheckData = $ResultXML.SelectSingleNode("//Check[@CID=`"$($CheckResult.CID)`"]") 34 | 35 | # get values 36 | $ValueItem = $Definition.SelectSingleNode("//Check/CIDs/CID[text()=`"$($CheckResult.CID)`"]") 37 | $ValueItemDescription = $ValueItem.Description 38 | $Note = $CheckResult.Note 39 | 40 | if($Note -like 'Check Failed due to Error: Cannot find path*') 41 | { 42 | $Note = 'No registry key or property was found, "Not Defined" has been assumed.' 43 | } 44 | 45 | Switch($CheckData.Type) 46 | { 47 | 'software' 48 | { 49 | $CheckDataValue = "version $($CheckData.Value2)" 50 | } 51 | 52 | default 53 | { 54 | $CheckDataValue = $CheckData.Value 55 | } 56 | } 57 | 58 | Switch($CheckData.Comparison) 59 | { 60 | 'ge' 61 | { 62 | $ValueItemObtained = $CheckResult.ObtainedValue 63 | $ValueItemRequired = "Greater or equal to $CheckDataValue" 64 | } 65 | 66 | 'le' 67 | { 68 | $ValueItemObtained = $CheckResult.ObtainedValue 69 | $ValueItemRequired = "Less or equal to $CheckDataValue" 70 | } 71 | 72 | 'gt' 73 | { 74 | $ValueItemObtained = $CheckResult.ObtainedValue 75 | $ValueItemRequired = "Greater than $CheckDataValue" 76 | } 77 | 78 | 'lt' 79 | { 80 | $ValueItemObtained = $CheckResult.ObtainedValue 81 | $ValueItemRequired = "Less than $CheckDataValue" 82 | } 83 | 84 | 'between' 85 | { 86 | $ValueItemObtained = $CheckResult.ObtainedValue 87 | $ValueItemRequired = "Between $CheckDataValue and $($CheckData.Value2) inclusive" 88 | } 89 | 'ne' 90 | { 91 | $ValueItemObtained = $ValueItem.ParentNode.ParentNode.Value | Where-Object { $_.raw -eq $CheckResult.ObtainedValue } | Select-Object -ExpandProperty translated 92 | $ValueItemRequired = $ValueItem.ParentNode.ParentNode.Value | Where-Object { $_.raw -eq $CheckDataValue } | Select-Object -ExpandProperty translated 93 | if((Test-IsNull $ValueItemObtained)){ 94 | $ValueItemObtained = $CheckResult.ObtainedValue 95 | } 96 | if((Test-IsNull $ValueItemRequired)) 97 | { 98 | $ValueItemRequired = $CheckDataValue 99 | } 100 | $ValueItemRequired = 'Not equal ' + $ValueItemRequired 101 | } 102 | 103 | default 104 | { 105 | if($ValueItem) 106 | { 107 | $ValueItemObtained = $ValueItem.ParentNode.ParentNode.Value | Where-Object { $_.raw -eq $CheckResult.ObtainedValue } | Select-Object -ExpandProperty translated 108 | $ValueItemRequired = $ValueItem.ParentNode.ParentNode.Value | Where-Object { $_.raw -eq $CheckDataValue } | Select-Object -ExpandProperty translated 109 | }else{ 110 | $ValueItemDescription = 'No definition for check item, update the definition file!' 111 | $ValueItemObtained = $CheckResult.ObtainedValue 112 | $ValueItemRequired = $CheckDataValue 113 | } 114 | 115 | } 116 | 117 | } 118 | 119 | if((Test-IsNull $ValueItemObtained) -and (Test-IsNull $CheckResult.ObtainedValue)) 120 | { 121 | $ValueItemObtained = 'Not Defined' 122 | }elseif((Test-IsNull $ValueItemObtained)){ 123 | $ValueItemObtained = $CheckResult.ObtainedValue 124 | } 125 | if((Test-IsNull $ValueItemRequired)) 126 | { 127 | $ValueItemRequired = $CheckDataValue 128 | } 129 | 130 | $Out = '' | Select-Object Host, Description, 'Value Obtained', 'Value Required', Notes 131 | $Out.Host = $ResultXML.Policy.ComputerInfo.HostName 132 | $Out.Description = $ValueItemDescription 133 | $Out.'Value Obtained' = $ValueItemObtained 134 | $Out.'Value Required' = $ValueItemRequired 135 | $Out.Notes = $Note 136 | $Out 137 | 138 | } 139 | 140 | } -------------------------------------------------------------------------------- /Functions/New-BuildReviewCollector.ps1: -------------------------------------------------------------------------------- 1 | Function New-BuildReviewCollector { 2 | 3 | begin 4 | { 5 | 6 | # Check for internet access, for Windows Update 7 | $CabFile = (Join-Path ($env:USERPROFILE) 'wsusscn2.cab') 8 | if(-not (Test-Path $CabFile)) 9 | { 10 | # try to download the cab file 11 | # more info at https://msdn.microsoft.com/en-us/library/windows/desktop/aa387290%28v=vs.85%29.aspx 12 | $url = 'http://download.windowsupdate.com/microsoftupdate/v6/wsusscan/wsusscn2.cab' 13 | try 14 | { 15 | (New-Object System.Net.webclient).DownloadFile($url,$CabFile) 16 | } 17 | catch 18 | { 19 | [system.windows.forms.messagebox]::Show("Unable to download the required files for missing Windows Update checks. Please download from 'http://download.windowsupdate.com/microsoftupdate/v6/wsusscan/wsusscn2.cab' and save to '$CabFile'.",'Build Review',0,16) 20 | exit 21 | } 22 | } 23 | 24 | # Store WSUS cab file as base64 25 | #$WSUSFile = Read-FileToBase64 -FileName $CabFile 26 | 27 | $Functions = Get-ChildItem -Path $BuildReviewRoot\Collection_Functions -Filter *.ps1 | Get-Content | Out-String 28 | 29 | # load policy file 30 | [xml]$Policy = Get-Content (Join-Path $BuildReviewRoot 'Policy\policy.xml') 31 | # strip comments 32 | $Policy.SelectNodes('.//comment()') | foreach{ $N = [System.Xml.XmlNode]$_; $N.ParentNode.RemoveChild($N) } | Out-Null 33 | # convert contents to base64 34 | $Base64 = [System.Convert]::ToBase64String([System.Text.Encoding]::UNICODE.GetBytes($Policy.InnerXml)) 35 | } 36 | 37 | process 38 | { 39 | 40 | $Collector = @" 41 | param([switch]`$DisableWindowsUpdate) 42 | $Functions 43 | `$PolicyXML = '$Base64' 44 | $(Get-Content $BuildReviewRoot\Collection_Functions\Invoke-BuildReview.tpl | Out-String) 45 | "@ 46 | 47 | } 48 | 49 | end 50 | { 51 | $File = (Join-Path ($env:USERPROFILE) 'BuildReview.ps1') 52 | $Collector | Out-File $File 53 | Write-Host "File saved to $File" 54 | Write-Host "Finished!" -ForegroundColor Green 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /Functions/New-HTML.ps1: -------------------------------------------------------------------------------- 1 | Function New-HTML { 2 | param($InnerHTML) 3 | 4 | @" 5 | 6 | 7 | 8 | Build Review Results - $(get-date -Format d) 9 | 10 | 11 |
12 |

Build Review Results

13 |

Results were generated on the $(get-date -Format d).

14 | $InnerHTML 15 |
16 | 17 | "@ 18 | 19 | } -------------------------------------------------------------------------------- /Functions/Out-FileFromBase64.ps1: -------------------------------------------------------------------------------- 1 | Function Out-FileFromBase64 { 2 | param($Base64,$FileName) 3 | $Content = [System.Convert]::FromBase64String($Base64) 4 | Set-Content -Path $FileName -Value $Content -Encoding Byte -Force 5 | } -------------------------------------------------------------------------------- /Functions/Test-IsNull.ps1: -------------------------------------------------------------------------------- 1 | function Test-IsNull($objectToCheck) { 2 | if ($objectToCheck -eq $null) { 3 | return $true 4 | } 5 | 6 | if ($objectToCheck -is [String] -and $objectToCheck -eq [String]::Empty) { 7 | return $true 8 | } 9 | 10 | if ($objectToCheck -is [DBNull]) { 11 | return $true 12 | } 13 | 14 | return $false 15 | }#end -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Policy/Test-XMLFiles.ps1: -------------------------------------------------------------------------------- 1 | $PolicyFile = Join-Path $PSScriptRoot policy.xml 2 | $DefinitionsFile = Join-Path $PSScriptRoot definitions.xml 3 | 4 | $global:Policy = New-Object XML 5 | $Policy.Load($PolicyFile) 6 | 7 | $global:Definitions = New-Object XML 8 | $Definitions.Load($DefinitionsFile) 9 | 10 | 11 | # Checks both policy and definitions are valid XML -------------------------------------------------------------------------------- /Policy/definitions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Microsoft Windows Domain Hosts Cache Domain Credentials Locally 8 |
The system was found to cache domain authentication credentials for the last <code>{{VALUE}}</code>.
9 | By default, Windows stores the credentials, username and password hash, of the last 10 people that have logged into a Windows computer. This is a feature, known as cached credential storage, that allows users to authenticate even if Active Directory (AD) is unavailable. However, these cached credentials can be used to attack accounts that have authenticated in the past. An administrator, or attacker with administrator or system privileges, could extract the cached credentials and crack the passwords for other accounts that have logged-on to the machine. This is particularly useful to an attacker that has gained control of a machine in a Domain environment, where a Domain Admin has previously logged-on to the machine with their current password. Cracking the Domain Admin's password would lead to a full Domain compromise in this instance. Cracking the passwords for less-privileged accounts could also be useful for impersonating them and gaining access to other machines that also cache passwords. 10 | It is recommended that four or fewer domain user authentication credentials are cached. This can be accomplished by modifying the following security policy setting <b>Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options / Interactive Logon: Number of Previous Logons to Cache</b> and setting the value to 0 Logons. 11 | Ensure that the LAN Manager authentication level is set to 'Send NTLMv2 response only. Refuse LM & NTLM' 12 | 13 |
14 | 15 |
The following value was obtained during testing: <code>{{VALUE}}</code>
16 | LAN Manager authentication level accepts NTLM 17 | The <b>Network security: LAN Manager authentication level</b> setting determines which challenge/response authentication protocol is used for network logons. This choice affects the authentication protocol level that clients use, the session security level that the computers negotiate, and the authentication level that servers accept. 18 | Ensure that the configuration 'Network Security: Audit LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'. When implementing a phased approach is recommended, ensuring client devices are completed first followed by member servers and domain controllers last. 19 | Ensure that the LAN Manager authentication level is set to 'Send NTLMv2 response only. Refuse LM & NTLM' 20 | 21 |
22 | 23 |
The following value was obtained during testing: <code>{{VALUE}}</code>
24 | UAC Disabled for Administrator Account 25 | The system is configured to automatically grant full administrative privileges to all applications executed by the built-in Administrator account. This effectively allows the built-in Administrator account to bypass the additional security benefits implemented by User Account Control (UAC). In an administrative context User Account Control provides an additional layer of protection against the inadvertent modification of system settings and the accidental execution of malicious software. 26 | The system should be configured to enforce User Account Control restrictions on the built-in Administrator account. Navigate to <b>Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options</b> and configure the option <b>User Account Control: Admin Approval Mode for the Built-in Administrator account</b> to <b>Enabled</b>. 27 | Enable UAC for the built-in Administrator account 28 | 29 |
30 |
31 | 32 | 33 |
Please see appendix ? for table of results.
34 | Administrative Templates Inadequate 35 | Administrative Templates 36 | Administrative templates supplement security options with additional hardening configuration, they can also be used to configure additional options to meet the organisation's needs such as folder redirection for example. Administrative templates are particularly recommended when direct registry settings are commonly used within the environment for hardening. Since it is only necessary to define an administrative template once and then allow for distribution via Group Policy. Among other things, this ensures that the registry settings are actually implemented on all target computers in a replicated manner. This allows for essential security configuration to quickly deploy in a manner that is identical from system to system, thus reducing the management overhead in maintaining best practices. Incorrect configuration of an administrative template could lead to security risks and present opportunities for an illicit individual, thus it is essential the policies are regularly reviewed and updated. 37 | Configure the administrative templates to best practice. 38 | Ensure the administrative templates conform to best practice 39 | 40 |
41 | 42 |
Please see appendix ? for table of results.
43 | Windows Firewall Configuration Inadequate 44 | Windows Firewall Configuration 45 | The defined firewall options are not in line with best practices. 46 | Configure the Windows firewall to best practice. 47 | Configure the Windows firewall to best practice 48 | 49 |
50 | 51 |
Please see appendix ? for table of results.
52 | Windows Security Options Inadequate 53 | Inadequate Security Options 54 | The defined security options are not in line with best practices. 55 | Change the Windows security options to conform to best practices. 56 | Ensure the Windows security options conform to best practice 57 | 58 |
59 |
60 | 61 | 62 |
The following value was obtained during testing: <code>{{VALUE}}</code>
63 | Server Message Block Version 1 Enabled SMBv1 Configuration 64 | 65 | Microsoft and others are advising that customers should consider blocking legacy protocols on their networks in particular SMBv1 as an additional defense-in-depth strategy to further protect against attacks.<br />Disabling SMBv1 could cause a range of software and other services that depend on SMB to stop functioning correctly, so it is recommended to check with vendors and test first before disabling it.<br />A client that uses SMBv1 is susceptible to a man-in-the-middle attack which could see your client ignore all the enhanced features of a higher protocol version. This is performed by answering the requests for a particular host but blocking the use of SMBv2 or higher, thus ensuring that only SMBv1 is used during the attack. The client will unwillingly connect using the SMBv1 protocol and share credentials with the rogue server; unless encryption was required on that share to prevent SMBv1.<br />Additionally, it is worth noting that SMBv1 is over 30 years old and potentially has many unidentified issues that could cause harm or disruption to the host. 66 | Ensure SMBv1 is disabled this can be achieved by issuing the following commands and then restarting the host.<br /><b><u>Server Configuration</u></b><br />From an administrative PowerShell window issue the following command:<br /><code>New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\ -Name SMB1 -Type DWORD -Value 0 -Force</code><br /><b><u>Client Configuration</u></b><br />From an administrative PowerShell window issue the following command:<br /><code>New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\mrxsmb10\ -Name Start -PropertyType DWORD -Value 4 -Force</code><br /><code>New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\ -Name DependOnService -Type MultiString -Value 'Bowser','MRxSmb20','NSI' -Force</code> 67 | Ensure SMBv1 is disabled for both client and server 68 | https://blogs.technet.microsoft.com/staysafe/2017/05/17/disable-smb-v1-in-managed-environments-with-ad-group-policy/ 69 |
70 | 71 |
Please see appendix ? for table of results.
72 | LLMNR and NBT-NS Poisoning 73 | LLMNR and NBT-NS Poisoning 74 | Link-Local Multicast Name Resolution (LLMNR) and NetBIOS Name Service (NBT-NS) are two components of Microsoft Windows machines. LLMNR was introduced in Windows Vista and is the successor to NBT-NS. It allows machines on the same subnet to identify hosts when DNS fails, a broadcast to other machines on the same local network is made instead, the correct address is then received via LLMNR or NBT-NS. A malicious host on the same network can intercept requests for LLMNR and NBT-NS, allowing for a poisoned address to be returned. A handshake is initiated between the two hosts, which includes the NTLM hash, the hash is then captured and taken offline for decryption. 75 | <p>Ensure that you have disabled LLMNR and NBT-NS on Windows hosts. Also ensure that the administrative passwords are changed to meet a complexity requirements and are greater than 14 characters. Additionally, these should not be based on a dictionary word.</p><p><b><u>Disable LLMNR for Windows</u></b></p><ol><li>Launch <i>Group Policy Editor</i> this can be local or a group policy for the domain</li><li>Navgate to <i>Local Computer Policy -> Computer Configuration -> Administrative Templates -> Network -> DNS Client</i></li><li>In the <i>DNS Client</i> double click on the <i>Turn Off Multicast Name Resolution</i> ensure it set to <i>Enabled</i></li></ol><p>You can also disable this via the registry, add a DWORD named <i>EnableMulticast</i> with a value of 0 to the following key location <i>HKLM\Software\Policies\Microsoft\Windows NT\DNSClient</i>.</p><p><b><u>Disable NetBIOS Name Service</u></b></p><ol><li>From the run command enter <i>ncpa.cpl</i> and click <i>OK</i></li><li>Right-click <i>Local area connection</i> and then click on <i>Properties</i></li><li>Double-click on <i>Internet Protocol Version 4 (TCP/IPv4)</i>, click <i>Advanced </i>then click on the <i>WINS (Windows Internet Name Service)</i> tab</li><li>Click on <i>Disable NetBIOS over TCP/IP</i></li></ol> 76 | Disable LLMNR and NBT-NS 77 | 78 |
79 | 80 |
Please see appendix ? for table of results.
81 | Java Binaries Identified 82 | Missing Microsoft Patches 83 | A list of Java binaries found and their version number. 84 | Ensure that all binaries identified are up to date. 85 | Ensure that all binaries identified are up to date 86 | https://www.java.com/en/download/faq/release_dates.xml 87 |
88 | 89 |
Please see appendix ? for table of results.
90 | Windows Host Patch Levels are not Current 91 | Missing Microsoft Patches 92 | The target system was discovered not to have all the relevant patches applied. It is important to maintain patch status because often patches counter vulnerabilities that are exploited in the wild. As is common for major software products, numerous vulnerabilities have been identified in Microsoft Windows operating systems over the years, many of which can be exploited to allow an attacker to gain control of a target system. Microsoft releases vendor security patches, as well as functional fixes on a monthly basis to address issues found. Occasionally, patches are released for particularly significant vulnerabilities outside the monthly "patch Tuesday" releases. Also less frequently Microsoft release Service Packs which contain a roll up of all previous vendor fixes and patches. However, these patches need to be applied to counter the vulnerabilities and this was not the case for the listed instances, for at least some patches. 93 | All systems should have the latest Microsoft security patches applied, particularly when Microsoft issue an emergency patch outside the monthly "patch Tuesday" releases. There are a number of methods for deploying security patches in an enterprise environment, some of which have little to no financial cost implications. However, it is further recommended that an appropriate regression testing mechanism is employed to ensure business continuity and the use of critical business applications. 94 | Apply the latest security patches 95 | 96 |
97 | 98 |
The following configuration was observed:
99 | Windows Password Policies Inadequate 100 | Inadequate Account Policies 101 | The defined account and/or password policies present on the host are inadequate. 102 | Change the enforced account and password policies to conform to best practices. 103 | Ensure the enforced account and password policies conform to best practice 104 | 105 |
106 | 107 |
The following configuration was observed:
108 | Windows Audit Policy Inadequate 109 | Advanced Audit Policy 110 | The advanced audit policy (local or effective group policy) defined on the host is not in line with best practices. 111 | Change the Advanced Audit Policy settings to conform to best practices. 112 | Ensure the Advanced Audit Policy conforms to best practice 113 | 114 |
115 | 116 |
The following configuration was observed:
117 | Windows User Rights Assignment Inadequate 118 | User Rights Assignment 119 | The defined User Rights Assignments settings are inadequate and should be hardened. 120 | Change the user rights assignments to conform to best practices. 121 | Change the user rights assignments to conform to best practices 122 | 123 |
124 | 125 |
The following configuration was observed:
126 | Cryptographic Server Protocols Inadequate 127 | Cryptographic Server Protocols 128 | The defined server protocols are inadequate and should be hardened. 129 | Navigate to registry key of:<br /><code>HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols</code><br />Ensure the following registry values as detailed below are configured to best practice. All registry properties listed below are a DWORD type. 130 | Change the server protocols to conform to best practices 131 | 132 |
133 | 134 |
The following configuration was observed:
135 | Cryptographic Ciphers Inadequate 136 | Cryptographic Ciphers 137 | The defined cryptographic ciphers are inadequate and should be hardened. 138 | Navigate to registry key of:<br /><code>HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers</code><br />Ensure the following registry values as detailed below are configured to best practice. All registry properties listed below are a DWORD type. 139 | Change the cryptographic ciphers to conform to best practices 140 | 141 |
142 | 143 |
The following configuration was observed:
144 | Cryptographic Hashes Inadequate 145 | Cryptographic Hashes 146 | The defined cryptographic hashes are inadequate and should be hardened. 147 | Navigate to registry key of:<br /><code>HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Hashes</code><br />Ensure the following registry values as detailed below are configured to best practice. All registry properties listed below are a DWORD type. 148 | Change the cryptographic hashes to conform to best practices 149 | 150 |
151 | 152 |
The following configuration was observed:
153 | Cryptographic Client Protocols Inadequate 154 | Client Protocols 155 | The defined client protocols are inadequate and should be hardened. 156 | Navigate to registry key of:<br /><code>HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols</code><br />Ensure the following registry values as detailed below are configured to best practice. All registry properties listed below are a DWORD type. 157 | Change the client protocols to conform to best practices 158 | 159 |
160 |
161 | 162 | 163 | 164 | 165 | 166 | 87e89da6-68cb-445e-83df-52012e49e123 167 | 3c1a3d58-abc6-4717-83cc-1b17a8741d5d 168 | 42525fae-0d21-45f7-8719-fbcdd3c54bdc 169 | 2159aed8-17e4-4c1d-b9ab-337374edfefd 170 | bb4839b8-0d69-4016-937d-30ef26cb0f5e 171 | 59af4b5b-92df-418f-82e8-d4eb77b2bf80 172 | defe513e-d05a-4aa7-973d-57e848b8b683 173 | f38889b0-75c0-4926-aaee-d8902e53fcb9 174 | e0d2f97b-964e-4496-9cc9-11beb7d98d70 175 | c534d7d9-7763-4142-b79d-17a12ad2e854 176 | 7145b074-288d-4f5e-821b-e2074aa5eea6 177 | a3465d27-2a33-448e-adc0-169f6cf755f9 178 | d632bc25-58e1-41c4-8a1e-a0aad1a4adf3 179 | 4d63be6a-9a3e-422f-988c-c404e6c63595 180 | 9989f643-104c-450f-99ed-c8b0a8cb9cdd 181 | cb0fe20b-c26c-4aef-b19c-b358df2cfaa3 182 | b365e900-737b-4e25-a1d8-6a4276751e4f 183 | 589985a0-ed95-467c-b5bb-435ea1a08bcd 184 | cf1ae60d-a3a8-421e-875b-bc01b87272d3 185 | b72b160f-5a18-4078-867d-9f4c0813c443 186 | 915f2efd-cb28-4957-af3c-af77e282f637 187 | d2de9bf8-d3fc-44f7-957c-c8e5ed7263fb 188 | 1a07fba4-a26f-4a0c-ac14-d09381288856 189 | 5807bdce-43d8-464a-b7b8-980fa88b77cb 190 | 8d7d8a95-364c-47ec-9b61-c6cd71cc2bb4 191 | 0d238209-cd25-48c9-8ed6-1e79af1b678e 192 | fc87e638-86ee-40c6-874d-24793ef88ba8 193 | 4db9118a-300c-4101-a036-3a4ee5fb6ad2 194 | 0b9152bc-ef40-492a-b133-845a47d924a5 195 | b4c26939-82b3-495b-92f9-b91d7936f61f 196 | 72e38cd1-91d5-444e-add0-a89af34da2ae 197 | 6e5b1ecc-f425-447c-875f-a8bcfb82d38b 198 | 0bf4b215-58b8-4034-a30d-5662e8bcac73 199 | 63e7e2c7-f52f-480a-8d77-1750d7bf2c98 200 | e4dfb008-0676-4526-aca6-ccee4a45e039 201 | af2dc39b-6eab-4505-b748-146fbbf6933f 202 | a620cef7-908f-4207-9b40-1e49a4d25f24 203 | 2795d73e-b828-4c6a-9fb7-d3bb981fcdf0 204 | d56828be-a95e-4cf0-bd3e-d3b047efa05f 205 | 6dccfaf0-0ed8-4109-ae4b-fa7ce6608c7c 206 | f5b96ef2-22da-48aa-9dca-31b243673715 207 | 989b78f9-d127-48e7-8750-5c190a9da8e2 208 | 708b402f-0b57-4d5f-acb0-fff08c7def9d 209 | 0f40178c-3ee8-4a83-8908-a557ae4e0dd8 210 | 8e86dc7f-32ba-4619-a139-b558a7c12bfa 211 | 212 | 213 | 214 | 215 | 216 | 7c37adaa-3861-4cb8-96d3-ad2e46c244c4 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 15686850-54fd-4eab-9364-40dd983d80ca 228 | 1af4a504-feba-4085-9d97-bfea84ee4232 229 | f9d0c466-0345-4846-97b0-5d78d3899d3b 230 | d7eebe6a-d91b-4bed-b63b-4a9ef42bfe97 231 | cf6b4cc3-80ec-49ca-9125-e4a7baf5c785 232 | f92f1e48-66a6-45d5-9faf-00854da766fe 233 | 2129135d-febb-46c8-b07b-3a9a316ce374 234 | 61832c35-1418-4a67-a1f3-ae7a4094da03 235 | 6a3a2bfc-af0e-4833-b7ba-1939680d7e05 236 | 757b3875-d15c-4d51-ae5d-af65121ebac5 237 | 771cb00f-f270-421a-bd1e-224e3ee14bd4 238 | 232ff704-c64d-48dc-9831-93b35363c927 239 | 5bb372c1-8b27-4d4a-a5fa-ff84c281fc8b 240 | fb2b9a45-ff83-4b27-8d9e-eb2d6cfa3943 241 | a44f3748-8f2d-40de-a05d-088bafe73902 242 | fdb4ab25-1957-4f48-9b27-61203ff5c574 243 | c5013664-5df0-4fa3-86c3-609c318d1d01 244 | 08d6b6b6-1b29-4916-be79-e78c282d7918 245 | 2cc777fa-c5c7-4dff-9d49-d1725e420d1e 246 | 0cfee966-298f-4595-bac9-dc9cad2788ef 247 | 66cff5b6-aaf0-48e8-bb4a-f2a831ea30d9 248 | 15b72739-c774-4a5e-8556-4e94d9388f0b 249 | 14a6a5e2-1b34-4967-9d34-65866a0d9727 250 | c53fd130-499e-4e3e-adb5-31f904e9e5aa 251 | 4367d96c-e6ff-45c2-9fb9-a0f8e55eb2f2 252 | 0c248876-f783-4344-8d85-0defc40d0312 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 14a5b442-45e3-4c53-b262-91d0688e935b 262 | 52943eab-6723-4cd7-b19d-6e80918144a9 263 | 85d06ab9-1876-4979-8116-b816f81775dc 264 | 6249abea-5ae9-4eed-b108-3bbe7d540167 265 | cadefe81-ebe3-4107-b30f-eede209f62cd 266 | 5ab5db68-29d2-402d-9df9-d8239879fe9f 267 | e779c004-c6bc-4c49-99f2-4532eca016ae 268 | aea19c2f-60c5-4d7a-b28b-51a3a250d49c 269 | 0b0a84db-d1a0-42cb-8b0b-c82b30523f23 270 | d19738b5-fe27-4bce-8466-019c4a8b0095 271 | 8a0b639d-225a-4b5b-a037-955f89987882 272 | 0fa9c02e-0c7e-48c8-8dec-3d70aeca1bae 273 | ee80e233-485f-40bd-8c34-faa356738638 274 | e5c483af-4e41-4898-b44a-b78a990d645f 275 | e5e05a7f-0ae1-4070-b5e1-776de2fdbf8e 276 | 64d777a8-33b0-4514-8f26-b705f352bbd5 277 | 8478f674-cfc1-407d-8fc2-228c9de1d8f9 278 | c1f51c3d-f7fa-4f26-a825-f6e1c6f8695c 279 | 242f4178-5314-43a8-9d81-8eadc9e155c9 280 | 316f07e0-3651-4091-b9e7-5a6192a7726e 281 | 02ada47c-5a08-4f53-bf08-6be9aaf44385 282 | 1fe9f876-8303-4a65-ae8a-8fe2985fba18 283 | 8bbe7384-c50d-410a-89ca-d7b352477e14 284 | 1cb1b2b6-3ac3-44d4-af8a-0ba11fb6ce8d 285 | 8d3a1292-1331-4b39-ac2c-9fae67a9c25b 286 | 11a968e2-65be-4c60-9a5e-b401f1ecb58e 287 | ba7e0015-a92a-47eb-b3af-47c207913920 288 | 82325cd2-f2f8-4e1e-8c2f-5208e383b851 289 | 130dee46-b58b-42bf-bfa6-d5d74c5056ff 290 | 0943536d-a2ed-449e-bb98-a140970dd6a7 291 | f124dbe8-15fd-4e0c-a48d-0aa91ae831a1 292 | fe7832a6-a6db-427f-af19-b2c8642c924f 293 | e51686d3-877c-45f2-a8d2-29ea01911750 294 | f7c47f6a-e42f-48d5-bf11-e834488938f0 295 | f076dc1a-6027-4b63-acb5-c814d34abb43 296 | 492bb5f3-08af-4f3d-9308-dc0bc35d30a3 297 | 38c09f0c-13a9-4882-aee5-a438ae6ab89d 298 | cb9921cd-f249-467f-a870-90a5eb581010 299 | c46ecc4a-465d-4d0b-ba9e-80cd8eccd111 300 | 8d5974fa-a08a-46b4-ac6c-6e183e6d3c00 301 | 1563b49b-86c2-4712-a571-e5d425618161 302 | b8c15d84-51f2-4edf-aa89-fcbce5097570 303 | e2f13cb0-88e9-43e9-848c-118f5c726922 304 | b03df1e0-a7d0-451e-89bb-f56daae49a24 305 | d0cdb6e5-08df-443e-9143-754771bf8ad5 306 | 45e454bc-3db8-46c4-b8a1-a2f80f0f9280 307 | 94edb6a9-d261-4cf2-ab7c-8564f95e713f 308 | 1bee68eb-305b-4c2a-ae41-363e9e64f92a 309 | a5443733-1274-4e8b-b939-f8f93439ba1d 310 | ec5a4509-f45c-4d3d-8ee9-6d188b4de960 311 | 60e6a536-2277-4b71-8f6d-33e6d79565c1 312 | 54c1a723-dfe1-47e5-a9d2-13e670dcc8b5 313 | 39ae3907-5c60-4493-8d4e-9613d5b2c9de 314 | fd96ff55-6145-4b88-9308-2ba5cdeb11f3 315 | 56ae0612-6806-498d-a6d1-e7fdb93adada 316 | 1d69988c-7cc2-41f8-927d-b84411f6d13b 317 | 590e5b6d-77bf-48c1-b5d2-b706f621f66b 318 | 33fcf940-4cf0-428d-bf5a-c401409717ff 319 | 57b8d73f-ff22-47bb-81e4-6fd7de22c92c 320 | 4cb94baa-d61d-45e3-a9e1-1baf4dc47168 321 | 7ad4559f-c604-45fa-8e0b-0f710cfd846c 322 | ca76de25-bbe0-4531-8299-facc629019c9 323 | f3a6cb5b-b96e-4e2a-81a4-f6c402b4e873 324 | 9f3ce6f2-e26c-4cf6-afe3-211ebbba77eb 325 | 15e4e2f6-63df-4a2b-aeb8-c99f75e91006 326 | fd9a8aa6-ad03-4c87-9939-53a385329ffc 327 | f4211ec0-42d6-44fc-875f-e994bca3dbc0 328 | 07ab6463-2e1f-4350-a20d-ddac21134d97 329 | d9da10c9-5372-4b17-ac9a-dd1b6fbfdebb 330 | 4b81f390-6b11-462c-bbc8-87c94e2da6b1 331 | 7f35ee10-b7ca-4388-ad3e-669236cfa8f4 332 | 99b2da2e-8a98-4b61-86f9-cc47babdc9fa 333 | 24f7d206-4522-44b1-a69a-0d0db0a024cd 334 | b121ce60-9f6e-4c54-97cd-c8fc10111705 335 | 10f57135-80bc-4f4c-a10d-6b55cf460064 336 | b3db37b9-997b-45cc-b404-5c638ff54f98 337 | e59fb4f1-b8c8-4f9d-b62d-3b305d6485a3 338 | a8439b6c-7bc6-4944-8961-6d65ee5fc5e0 339 | 1ef5577d-a1c5-4c1d-a138-ce8819fb0861 340 | 22c95407-e4d3-44ed-b534-3ed7429ab10d 341 | b56101e8-9724-459c-94e6-c090010f1406 342 | d37e2f13-a5e0-4d3f-b120-c0d7eeb5bcb6 343 | 9573137d-77be-4c50-a440-1613fc630332 344 | f22bb592-8ae8-4cf1-9970-c4a02976cf79 345 | 99e15fc6-8264-40c0-9877-25f14b93636c 346 | ce259af0-aeae-494d-a69b-4b1d5bd3ef4b 347 | 25cdc2ef-b70a-449a-b6b2-6d97adf347ef 348 | 13d862b2-f817-40f8-a947-fe80794565a5 349 | 28082330-19b4-4cdb-b0b7-390fc8be970f 350 | b60d0d80-6193-4114-85e2-32f646939aa7 351 | b522e5fe-3b75-4253-b395-5e49ba0f7099 352 | 2af00edd-893e-43e1-94a3-62efc1b30467 353 | 11593662-da73-442e-9bec-66a5592c9394 354 | eaec2f95-c01a-4c5f-a50d-4d09c20f377f 355 | 6fd7ece0-cf5f-4ef2-b276-1bc23aa6dd94 356 | 1e7b6f29-f670-4375-b15f-0c10cdf64b2e 357 | 1dce4e52-4738-4045-87af-9c4281cac661 358 | 6e013626-b9e5-41cd-b7b5-e203c1fad6c5 359 | 87f2b7be-8f66-48af-8726-4bc23365f765 360 | 76e0700d-a4bc-413c-956f-232f25017bda 361 | 4af474a5-de67-4b33-bd2a-a969f3790da1 362 | 8a39621f-cc0a-4020-96f1-6fa42545dcde 363 | 749c91d0-156b-4eb3-92f3-622887c5f2e0 364 | d2a50f47-ed2d-4b8f-8b88-03ba1f232d04 365 | c3e7e7f5-7f31-422d-9bf0-20a45b12d9f4 366 | 2fe8613d-fffd-43b8-af61-fa7e01813446 367 | 36cf44c5-39c2-44cd-aa41-04a4b02c0794 368 | 0f8ed4f1-e7da-4265-ba1b-0c2b3c92897f 369 | 7e61fb32-e407-4735-89bd-33e612627d21 370 | 8b95eb63-cc98-4592-b8d1-c38bdc6de10d 371 | 372 | 373 | 374 | 375 | 376 | 377 | 8acd2980-3246-4168-befa-d87bb15e275c 378 | 1157f558-53bf-438e-bad5-031f732667a0 379 | b071fc57-12d8-4f5a-ab40-495e8084c2a7 380 | 7a7a29e0-5909-4b0e-b928-f60496c9db40 381 | 50fdd27c-8ce4-4127-8d58-828aee8afa6f 382 | 383 | 384 | 385 | 386 | 387 | 388 | 137c1456-0eee-4793-b41f-11eeafd271b0 389 | 2eee54b3-1e95-4b66-9d9c-68dd1153b357 390 | 1ac8c378-1b7b-4d80-bd2d-9d79ac7bb482 391 | 60d7ca12-ce36-4997-9e63-82135ac4efe1 392 | ba89d037-d52c-4467-b837-6c198b112f60 393 | 9b184aa6-4e74-4be5-b35b-0587ebcab050 394 | 172f8277-04ff-4103-a8a2-b74f20de55ba 395 | 33dae92f-2a2c-4707-bd34-b692c037021a 396 | 0575829a-31e9-4475-ad7c-6e2294a731d5 397 | 33ed3502-3552-4a73-949a-f0f449c34d98 398 | e36b56bd-7619-45cc-b63c-ca186cc670f4 399 | d5d9aa4c-afb5-4c1d-aba0-1f9ea5d10851 400 | 401 | 402 | 403 | 404 | 405 | 406 | ac73faa1-5ff4-42cc-91e2-c2924458cb44 407 | af75ee8e-cae4-4cca-84f9-16effa05dada 408 | 83a32471-52ed-4ec8-ae27-8e994b3c43c6 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | aa5e8231-ad95-4117-950d-59b454e4ce98 417 | d6e3db9f-0593-499a-bf09-31a8110be410 418 | 4011c5f1-28d3-4ca4-aacd-ce8ef407232d 419 | 3ead8957-67a3-4c73-87e9-31ddca096247 420 | 25b7df73-4cd6-440b-8299-8d3753716902 421 | 9676bc09-8631-4124-86c3-4cfae53a97bc 422 | 423 | 424 | 425 | 426 | 427 | 428 | f437a3a6-32a2-4afa-b3f9-a0e8a633140a 429 | 5e1bd874-d1f8-44ec-9b09-896e2febc3ef 430 | 590ab5e4-2019-4bf1-82d6-d378b6402d50 431 | a0fb77b7-862e-46c2-8522-146ada76a027 432 | b930091a-1d83-4ad1-832e-fee1185efe3f 433 | ffbb8fa7-6cd2-46bc-92e8-cc97cb25676f 434 | 375a4763-db9c-4b06-9baf-ca1282c7a5b6 435 | 8269e387-5351-455f-b57d-9a17d26c0a21 436 | 0ae91728-87ba-4b47-9cd0-e280b7669306 437 | fb034757-9ba5-44df-b014-c0b235e6a37c 438 | 8ed87aba-b96d-4441-8ba6-f90f95f0f75b 439 | d2a542bb-6372-4280-bd17-c39e134b9b10 440 | 61179282-3f98-47b0-bd62-34e7371a2258 441 | a889a0f3-95c2-4bb1-96fa-0798c0785c5a 442 | 6de9ffc4-d920-48ef-88a6-40e5c4bbac3d 443 | c345da6a-1dc5-473f-a2fa-55204c52175b 444 | 0846bffb-c940-41cd-b957-eaec7cd7aa75 445 | f5e7f384-5378-4f74-8e94-f75a72305456 446 | a641d648-5d95-4dfe-b598-c37c0a391112 447 | 05013fe1-242a-442d-8610-10b969e19802 448 | 10de63ba-6a28-4042-86b8-92673f4804b4 449 | c2374e7d-ef47-46fd-a373-327986688bab 450 | dfe6c74d-ac16-43c4-a9ec-d1218d3e0920 451 | 7bab984c-b115-4364-90df-e02e277cc148 452 | cc8e989c-52e1-4d3d-9500-07596981166b 453 | 0f38368e-f50a-4c69-b2dd-80438bd4229c 454 | dbd58d4c-2a44-4ea0-bdfb-6e7a7a5390bf 455 | f3901f0e-0593-4c67-9e5a-b52f8237e578 456 | 5064b4c2-9887-46a1-a224-26da0640cc35 457 | cd43cac3-a832-42b0-becf-0c61f25f9a1f 458 | 9dfa43c5-2cc1-4443-98f8-094a2b5298af 459 | edfc7c69-02b0-4b6b-b080-e2ca75740ce6 460 | 8c545295-64ef-41fd-a3f6-6e699d2b88d5 461 | d2dbec95-774a-41e0-ab76-687893428f86 462 | 8e10a2a0-ef85-4296-8e3e-868ce325ca09 463 | 3ed1f63c-f7a5-4e1c-bde8-1662a4147dfb 464 | eb790ba4-2ab0-4ee4-95c2-c50da3d991d6 465 | 22ca1a60-a003-4069-9602-9041d19bcb77 466 | d69cdb13-9e67-4235-adc5-8051f79295f3 467 | 5b12ca4f-40aa-431a-8514-69e48bf4c42c 468 | ba55200f-72ea-4d65-a1ec-c4eb1ba71b91 469 | d37a1a64-4cfb-4900-9cee-937af5c9e3ea 470 | da1a604e-d73f-4f71-a2d2-23c0601c498c 471 | 0db80d4c-dae3-40e9-a415-9dd6fea67a52 472 | 7ed19e3f-723e-4bc1-b9ff-975ee0b47972 473 | c2e083a9-b84f-4ba0-a364-6da9e595f840 474 | d74d2397-012a-47bd-a4b3-7f976a3129fc 475 | c10c45a6-2704-4866-9387-ca17da7d3dd4 476 | f69b23f1-3972-4099-9b04-8b070b7c63fc 477 | 4ed021ad-e569-45ca-a7cd-dcfdde93cfff 478 | 2ae1bb38-cd71-4312-a47c-b7f2d785f93a 479 | 6caacc90-6b69-46a1-b1a9-660877024302 480 | 48a0d7a0-b511-49ca-a368-d7fb7579bea9 481 | b5181ee1-cb94-4e54-8728-cbc4de291c5c 482 | 107a1e19-9985-4732-867e-3d3185a5bb32 483 | bb9d11e1-c40a-4212-88ba-9990382b2456 484 | 888fa34e-7fbe-484a-960d-1319f1f189f4 485 | 419928a3-0e35-48bd-9444-0c8d691fa46e 486 | 974b0949-3410-43e6-aad8-885e8dc4127c 487 | d87f986a-b13f-4107-b8c2-769fce8d3afb 488 | 272fc420-edbf-4c38-a9b9-98221341b973 489 | 323889a8-46dd-4273-9bf5-76032d6f3096 490 | cc0f285e-ec3e-4cd1-8f8a-f9dcdf36b05b 491 | 679790dc-6174-4730-8e41-81c1d4219d8e 492 | 2f8bbcb9-226c-4ddd-81cf-4b50b93c00c9 493 | 6ac0787f-1b7d-42b0-b6fa-325e2232db88 494 | 1d1be83f-ce47-4646-be3c-4e88d2e8699a 495 | 1e9e6523-f3ca-47c3-9510-5f91ec07d845 496 | 9cca2dfe-c068-4e82-9725-3cbe3359e829 497 | 602ee31c-36c9-42a3-b2ec-2f8d554af684 498 | 7c37adaa-3861-4cb8-96d3-ad2e46c244c4 499 | f870c09c-f655-487b-9d06-e1b4cf4c6e3a 500 | 670c4fd6-9ba0-4de0-b20a-43524049db14 501 | e71cf50d-0661-4b8c-9820-2ad1df574297 502 | aac3daf9-4e14-4613-a548-c7fa7d4cd0f4 503 | a858d994-0427-4a8d-9735-3ccc2eaca7fa 504 | 8e44db21-7502-4f87-9de5-c109f11931c3 505 | 296d3b38-ca5b-491a-bd2e-e90dea229fd8 506 | 027e8452-1fb3-4918-9f68-ed223951cf49 507 | bc665647-7ae9-49ba-ae55-d2034db0a368 508 | 8a246344-b7e0-412b-87e7-957074759a03 509 | 171e4ef6-dfda-4b17-b0d3-7d7277095b91 510 | 29f973ba-f472-46b9-b28d-d112cbfbd0fd 511 | e1324afc-9828-4e02-b97b-55f1e5a371cf 512 | 1157f558-53bf-438e-bad5-031f732667a0 513 | d840e014-a401-40a7-8058-1b53fbd94ab6 514 | 85297f82-3c16-460a-a5aa-503634251bfd 515 | bb1081b4-1f6f-407d-aa67-aa44bed91eaa 516 | bb1a7bb8-e97b-43d0-bf87-8426387c425b 517 | a83abe03-c577-47cc-b22c-901dd359d42f 518 | a62f3627-4cf0-4079-8221-009fc56505d4 519 | acfa7193-25f5-4f7a-8a0d-f3c341b19ea1 520 | ce524973-3c2c-4422-92f2-9781ec80e471 521 | 14900803-276d-4bdb-b2d1-3bf397e3fbf9 522 | ada0ac56-aa38-458f-a072-04d30843f458 523 | 524 | 525 | 526 | 527 | 528 | 0420dca4-f3c6-48ea-b551-3b14d0ae13e7 529 | 5a18ad50-f2e8-4f51-9953-b17b744262d6 530 | c038e731-677e-46d5-9f9b-ee6ce77d3d41 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 2d347c15-df3a-4f53-be46-1bbd58c29ef9 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 11fcf4e0-d23d-4a73-add0-06cb4263aaa7 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | eba58073-961d-4a6d-abbc-3fd6730309d8 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 9736fb76-76a6-4dd1-8d3c-02653331a0c6 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | be1ebb31-b10e-4e4f-9eb5-99b22974ad87 579 | 70e42f84-5227-4bef-afba-1e853d8afbc1 580 | c81409bd-2e60-415a-9122-dfd770855253 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | a5b08e0a-c558-4e74-9f4d-dd280fd06a78 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | baf4f1c4-557c-430f-ad96-8f8072ac070f 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 11b0cd7c-44c7-44c5-9af2-ad5edd4b6813 606 | b9fd81ce-fb76-472f-97cd-dd6b582fff7d 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 75e6707f-4858-4803-b107-7fbbc76540fc 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | eeaf75d4-8ac7-4490-b834-2e490b9cfb5f 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | b07e54f5-9a99-4a2a-a568-8c1d14e5e5f5 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | bfe1a21b-0632-492d-9724-8e1d60c3a798 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 99bb0b72-1389-459d-aa78-db6ea230f5a5 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 20461f75-fd0b-42a5-9d37-9e1b4946f89d 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 6967b57b-cc58-4f66-8b20-2eac8ac7db45 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 8a15f5ad-3f56-4719-b1e2-93cd763fc4ca 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 44a1a3ad-6cf9-48ef-a415-19c389fc6431 683 | 6a8f333c-bf38-44af-b874-da839f540f0d 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 2e331681-bee9-4a98-89ce-ac7638059dec 695 | 696 | 697 | 698 | 699 | 700 | a782edc7-d848-4c12-9401-16ce0ed38fd2 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 9819d18f-0451-4ee1-918d-dfad9e568ae9 709 | 710 | 711 | 712 | 713 | 714 | 715 | c4dcf64f-c226-4772-9595-9a7b80ef15b9 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | db4d2502-63db-4fe1-862c-de42aba60649 724 | 31e1effb-6cfc-45f9-937d-70b91b37d06e 725 | 726 | 727 | 728 | 729 | 730 | 731 |
-------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Setup 2 | From a PowerShell window run the following: 3 | ```PowerShell 4 | Import-Module "C:\path\to\root\folder\BuildReview.psd1" 5 | New-BuildReviewCollector 6 | ``` 7 | 8 | You should now have a wsus cab file and a ps1 in the root of your %userprofile% folder. You need these both on the system to be audited, note the wsus cab file must be on the root of the C:\ drive; the script can be anywhere. 9 | 10 | # Running the Script 11 | You might find the script fails to run even when running as an administrative PowerShell window, issue the following command; 12 | ```PowerShell 13 | Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force 14 | ``` 15 | *Process* is used here as it will ensure that after PowerShell is closed the client's security is restored. 16 | 17 | To run simply launch PowerShell as an **administrator** then issue: 18 | ```PowerShell 19 | .\BuildReview.ps1 20 | ``` 21 | 22 | In cases were a policy is enforcing the execution policy simply run this instead; 23 | ```PowerShell 24 | iex [System.IO.File]::ReadAllText('c:\BuildReview.ps1') 25 | ``` 26 | 27 | # Exporting Results 28 | The XML results for each host will be saved to your desktop, take the XMLs and save in 1 folder on your own machine. Now issue the following command; 29 | ```PowerShell 30 | Export-AsHTML -InputFolder C:\Results\ 31 | ``` 32 | A HTML file will be saved to *C:\Results* and any useful files collected will be stored in the sub directory **tool-output**. 33 | 34 | # Coverage 35 | It takes a lot of time to check each registry value is correct, I will get to the end eventually. 36 | 37 | In the meantime ensure you read the raw XML results file generated as you will see blank results for some collections/groups/checks depending on the OS. Additionally, it is recommend each reported issue is verified to ensure accuracy. 38 | 39 | In Scope: 40 | * Windows 2012 R2 (works best) 41 | * Windows 2008 R2 42 | * Windows 2016 43 | * Windows 8.1 44 | * Windows 10 45 | * Windows 7 46 | 47 | Out of Scope: 48 | * Windows 2012 49 | * Windows 2008 50 | * Windows Vista 51 | * Windows 8 52 | * Windows XP 53 | * Windows 2000 or older 54 | -------------------------------------------------------------------------------- /old scripts/Firewall-Enabled.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneLogicalMyth/BuildReview-Windows/5906397d56365aab232bf65f083474e02411c4e6/old scripts/Firewall-Enabled.ps1 -------------------------------------------------------------------------------- /old scripts/Get-FirewallRules.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneLogicalMyth/BuildReview-Windows/5906397d56365aab232bf65f083474e02411c4e6/old scripts/Get-FirewallRules.ps1 -------------------------------------------------------------------------------- /old scripts/Get-ServicePermission.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneLogicalMyth/BuildReview-Windows/5906397d56365aab232bf65f083474e02411c4e6/old scripts/Get-ServicePermission.ps1 -------------------------------------------------------------------------------- /old scripts/Read-AdvancedAuditPolicy.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneLogicalMyth/BuildReview-Windows/5906397d56365aab232bf65f083474e02411c4e6/old scripts/Read-AdvancedAuditPolicy.ps1 -------------------------------------------------------------------------------- /old scripts/Read-SecPolicy.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneLogicalMyth/BuildReview-Windows/5906397d56365aab232bf65f083474e02411c4e6/old scripts/Read-SecPolicy.ps1 --------------------------------------------------------------------------------