Skip to main content

Workaround - Windows Search Protocol Vulnerability

Summary

This script backs up and removes or restores the following registry key:
HKEY_CLASSES_ROOT/search-ms
Key backup location:
C:/Windows/LTSvc/Packages/SearchMSRegDirectory

This script is automatically executed by the “ProVal - Development - Workaround - Windows Search Protocol Vulnerability [G]” Monitor.

This script can also be run manually. It will give you the option to pass the value for the parameter "Restore" if you run it manually. The "HKEY_CLASSES_ROOT/search-ms" key will be restored if the argument is set to 1. The script's default behavior is to attempt to export and delete the registry file. The script can create a ticket for failure as well, but to enable the ticketing feature, you need to update the value of the Global Variable Ticket to 1. The script's default behavior is to not generate any ticket.

Apart from this, it saves the final result to a script state, "Search-MS Registry Status," to display the data in the “Windows Search Protocol Registry Key Audit [Script][Role]” dataview.

Additionally, the script will import all the contents of the solution for its first run.

Sample Run

Leave the Restore field blank to remove the registry key:
Remove Registry Key

Set the Restore to 1 for restoring the registry keys:
Restore Registry Key

Dependencies

Variables

NameDescription
OutComeStore the output of the PowerShell scripts being executed to perform the necessary action.
TickidVariable for retrieving and storing the ticket ID of an existing failure ticket.

Global Parameters

NameExampleRequiredDescription
Ticketid1 or 0FalseSet it to 1 to make the script create tickets for the failures.

User Parameters

NameExampleRequiredDescription
Restore1 or leave it blankFalse1 to use the script to restore the key

Script States

NameExampleDescription
search-ms Registry StatusBacked Up And Removed, Failed to Remove, Restored, Failed to RestoreOutcome of the recent operation performed

Process

Step 1: Imports all the parts to the solution.
Step 2: Checks if it is called to restore or to remove the registry key.

For Backup and Restore.

Step 1: Clears the script state, "Search-MS Registry Status."
Step 2: Executes the PowerShell script to take the backup of the registry key and to remove the key.
Step 3: Verifies the outcome of the PowerShell and proceeds accordingly.
Step 4: For success, it will set the script state as "Backed Up And Removed," and exit.
Step 5: For failure, it will set the script state as "Failed to Remove," and check whether ticket creation is enabled or not.
Step 6: If ticket creation is enabled, it will look for the already existing ticket and add a comment to that; otherwise, it will create a ticket if the ticket does not exist.
Step 7: Exit with success for success and exit with failure for any failures.

For Restore.

Step 1: Clears the script state, "Search-MS Registry Status."
Step 2: Executes the PowerShell script to restore the key.
Step 3: Verifies the outcome of the PowerShell and proceeds accordingly.
Step 4: For success, it will set the script state as "Restored" and exit.
Step 5: For failure, it will set the script state as "Failed to Restore," and check whether ticket creation is enabled or not.
Step 6: If ticket creation is enabled, it will look for the already existing ticket and add a comment to that; otherwise, it will create a ticket if the ticket does not exist.
Step 7: Exit with success for success and exit with failure for any failures.

Output

  • Script log
  • Script state
  • Ticket
  • Dataview