https://github.com/xyz2022/DesktopProcessMonitor/releases/latest
Terminate policy-prohibited applications on corportate-owned devices. This application aims to block the use of specific apps on managed devices. Example: 3rd party VPN binaries like Psiphon 3 may be against the terms of use for users of managed devices, however the users might have been using the VPN regardless. In this case, the default behavior of DesktopProcessMonitor is to terminate Psiphon 3 when the user tries to open it. The default behavior can be modified to target any policy-prohibitied applications.
Slowdown. For each process, gpedit blocks processes from starting-up until the certificate is located and read; impacting system performance, especially on older hardware. On the other hand, DesktopProcessMonitor is fast. It does not block processes while certifcates are located and read. It does however terminate new processes if their certificates are from any policy-prohibited publisher. This results in reduced impact to system performance.
Project has 3 sub-projects:
- App.Windows.Service: C# Windows Service. Spawns WMProcMon for each logged in user. Re-runs WMProcMon if it is terminated by the user.
- WMProcMon: C++ background worker. Subscribes to the InstanceCreationEvent message via WMI. This event is a signal that a new process was created for or by the user. WMProcMon looksup the Authenticode certificate for the exe_file of each new process. If the publisher matches "Psiphon Inc", WMProcMon terminates the process. Note: this is a non-blocking operation, no processes on the OS will be prevented or delayed from starting-up. However the process will terminate within a few ms if its certificate publisher is a match to the target string.
- SetPsiBlock: The Visual Studio Setup project handling installation and uninstallation of App.Windows.Service and WMProcMon.
Resisting Priv-Esc tecniques:
- The file path to service executable is quoted.
- Service executable folder is read-only for unpriveliged users.
- WMProcMon executable folder is read-only for unpriveliged users.
- WMProcMon process is owned by the current logged-in user.
- Open workers.sln in Microsoft Visual Studio 2022 17.7.4 or higher
- Publish App.Windows.Service -> Local Folder (use default selected folder)-> Enabled Options: Self-contained, Produce Single File, EnableReadyToRunCompilation
- Rebuild WMProcMon
- Rebuild SetupPsiBlock
- SetupPsiBlock.msi will build in ./release/x64 directory
Desktop Users install via MSI
Network administrators install & uninstall silently via script:
Install ->
msiexec.exe /i SetupPsiBlock.msi MSIFASTINSTALL=4 /qn /norestart
Uninstall ->
msiexec.exe /x SetupPsiBlock.msi MSIFASTINSTALL=4 /qn /norestart