Certscan helper scripts

Description

There are 4 Powershell scripts provided:

  • appStatus.ps1: gets the certscan application state (used for healthchecks)
  • startScan.ps1: starts a certificate scan
  • scanStatus.ps1: retrieve a scan status / progression
  • scanResult.ps1: retrieve a scan result and write it out to a file (format is JSON)

They must be executed from a Powershell terminal.

If the scripts cannot be executed, you might need to adjust your Execution Policy (has to be run as administrator in a Powershell terminal):


Set-ExecutionPolicy -ExecutionPolicy Unrestricted



Usage / workflow

(optional) set the API key in a variable, if done, the apikey parameter can be ommited in the next steps.


$scan_apikey = API-KEY


Run a scan

The scan ID should be saved to retrieve the results later on. The scan ID is automatically saved in a variable for the next scripts usage for the current Powershell session.

Example using a list of hosts in the commande:


./startScan.ps1 -ports 443,8443 -hosts hostone.com,hosttwo.com -rate 5 -apikey 1234567


Example using a list of hosts from a text file (one hostname per line)


./startScan.ps1 -ports 443,8443 -hostsFile list.txt -rate 5 -apikey 1234567


Check the scan status


./scanStatus -id 7cddc226-e3bf-43e5-8163-ab576e18528d -apikey 1234567


Retrieve the scan result

Only when a scan is finished, the results can be retrieved.


./scanResult -id 7cddc226-e3bf-43e5-8163-ab576e18528d -apikey 123456 -outputFile out.json


Detailed scripts documentation

A more detailed documentation of the scripts usage and parameters is available through the Powershell Get-Help cmdlet:


Get-Help scriptName.ps1 -Detailed