Share via


Test your server for Heartbleed via Powershell

Download latest OpenSSL for Windows and install your computer.
Open your text editor and write one domain name or IP address on each line and save it.
Then change $sites and $oSSL variables.

$sites = Get-Content -Path "C:\domains.txt"$oSSL = "C:\OpenSSL-Win64\bin\openssl.exe"$Result = @()foreach ($site in $sites) {$IpAddr = [System.Net.Dns]::GetHostAddresses($site) | foreach { $_.IPAddressToString }$Status = & $oSSL s_client -host $IpAddr -port 443 -tlsextdebug -debug -state | Select-String heartbeat    if (!$Status) {    $Heartbleed = "No"    $Properties = New-Object System.Object    $Properties | Add-Member Noteproperty Site $Site    $Properties | Add-Member Noteproperty SiteIP $IpAddr    $Properties | Add-Member Noteproperty Heartbleed $Heartbleed    $Result += $Properties    }     else {    $Heartbleed = "Vulnerable !"    $Properties = New-Object System.Object    $Properties | Add-Member Noteproperty Site $Site    $Properties | Add-Member Noteproperty SiteIP $IpAddr    $Properties | Add-Member Noteproperty Heartbleed $Heartbleed    $Result += $Properties    }} $Result

Other Languages
This article is also available in the following languages: