Attacks and Exploits

A SYSTEM service has the unquoted path C:\Program Files\Vendor Tools\Agent Service\svc.exe. The tester can write only to C:\Program Files\Vendor Tools. Which file name placed there runs first when the service restarts?

Show the answer

Correct answerD. Agent.exe

AWhy not this: Program.exe is only tried at the root of C:\, which is outside the writable folder.

BWhy not this: Vendor.exe is only tried inside C:\Program Files, which the tester cannot write to.

CWhy not this: svc.exe is the legitimate binary in a deeper folder and is tried last.

DWhy this is right: the prefix up to the space before Service resolves to Agent.exe in the writable folder.

Windows tries each space-delimited prefix of the path in order. Agent.exe in the Vendor Tools folder matches the prefix C:\Program Files\Vendor Tools\Agent and is tried before svc.exe. Vendor.exe would have to be in C:\Program Files, which is not writable.