astrixsystems / Secure-WindowsServices

Our PowerShell script for securing vulnerable Windows services' insecure permissions.
https://astrix.co.uk/news/2018/10/22/secure-your-windows-services
MIT License
6 stars 6 forks source link

Problem when Service uses .exe in parameters #2

Open czuk opened 2 years ago

czuk commented 2 years ago

I've been running the v1.8 script on some PCs that are running a very old app based on Apple WebObjects. Some of the service command lines contain parameters which include .exe which causes the script to fail for that service. For example:

Service commmand line C:\Apple\Library\WebObjects\Applications\wotaskd.woa\woservice.exe -NTService C:\Apple\Library\WebObjects\Applications\Monitor.woa\Monitor.exe

The command $WindowsService_File_Path = ($WindowsService_Path -Replace '(.+exe).*', '$1').Trim('"'); results in $WindowsService_File_Path = C:\Apple\Library\WebObjects\Applications\wotaskd.woa\woservice.exe -NTService C:\Apple\Library\WebObjects\Applications\Monitor.woa\Monitor which obviously fails later on in the script.

mythofechelon commented 2 years ago

Hi @czuk,

(I'm the original creator of this script, which I've forked to https://github.com/mythofechelon/Secure-WindowsServices since leaving Astrix).

Thanks for reporting this. I believe I've fixed this in v1.15, now available at https://github.com/mythofechelon/Secure-WindowsServices/releases/tag/v1.15.

Ben.