Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Snipping Tool still can be executable via its keyboard shortcut #343

Closed
fideliochan opened this issue Apr 14, 2024 · 9 comments
Closed
Labels
bug Something isn't working

Comments

@fideliochan
Copy link

fideliochan commented Apr 14, 2024

Description

I deleted Snipping Tool via privacy.sexy to use Win+Shift+S shortcut for another application and restarted my pc, but yeah it still executes the Snipping tool it shows rectangle stuff.

OS

Windows 10 IOT LTSC 21

Reproduction steps

Just delete Snipping tool in Bloatware section and run win+shift+s does not matter if you reboot or not it still executes itself.

Scripts

@echo off
:: https://privacy.sexy — v0.13.1 — Sun, 14 Apr 2024 02:25:33 GMT
:: Ensure admin privileges
fltmc >nul 2>&1 || (
    echo Administrator privileges are required.
    PowerShell Start -Verb RunAs '%0' 2> nul || (
        echo Right-click on the script and select "Run as administrator".
        pause & exit 1
    )
    exit 0
)
:: Initialize environment
setlocal EnableExtensions DisableDelayedExpansion


:: ----------------------------------------------------------
:: ----------------Remove "Snipping Tool" app----------------
:: ----------------------------------------------------------
echo --- Remove "Snipping Tool" app
:: Uninstall 'Microsoft.ScreenSketch' Microsoft Store app.
PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.ScreenSketch' | Remove-AppxPackage"
:: Mark 'Microsoft.ScreenSketch' as deprovisioned to block reinstall during Windows updates.
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\Microsoft.ScreenSketch_8wekyb3d8bbwe" /f
:: ----------------------------------------------------------


:: Pause the script to view the final state
pause
:: Restore previous environment settings
endlocal
:: Exit the script successfully
exit /b 0

Screenshots

Additional information

@fideliochan fideliochan added the bug Something isn't working label Apr 14, 2024
@undergroundwires
Copy link
Owner

Hi, thanks for the report.

It works on older versions but snipping tool is not provided as separate store app but as part of MicrosoftWindows.Client.Core (Windows Feature Experience Pack) on modern versions of Windows.

I will not add functionality delete this package. It includes a lot of other useful things and would have big impact to delete it. I think we can add group policy to achieve this.

But we can disable it:

reg add "HKCU\Control Panel\Keyboard" /v "PrintScreenKeyForSnippingEnabled" /t "REG_DWORD" /d "0" /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\TabletPC" /v "DisableSnippingTool" /t "REG_DWORD" /d "1" /f

Let me know if it works.

We can introduce this as new script: Disable Snipping Tool as this tool is historically known to have vulnerabilities 1 and disabling would reduce your attack surface.

@fideliochan
Copy link
Author

Hi! Did not work but thanks for help.

@undergroundwires
Copy link
Owner

undergroundwires commented Apr 14, 2024

Restart your computer and please get back if it worked.

It did not work for me until reboot but works fine afterwards.

I see that this is what control panel option (Settings > Accessibility > Keyboard > Use the Print screen key to open screen capture) does too. It sets HKCU\Control Panel\Keyboard!PrintScreenKeyForSnippingEnabled to 0 (tested on Windows 11 Pro 23H2) and does something else to not require restart explorer.exe.

I see that users of other screenshot software posted related issues flameshot-org/flameshot#1551, greenshot/greenshot#482.

@fideliochan
Copy link
Author

fideliochan commented Apr 14, 2024

Sadly, no still does not work.

@undergroundwires
Copy link
Owner

Thank you for coming back. Try this:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "DisabledHotkeys" /t "REG_SZ" /d "S" /f

After running this, try directly if it works, if it doesn't work, try restarting explorer:

taskkill /f /im explorer.exe & start explorer

If it doesn't work try system restart.

Check if it works, and feel free to let me know if restarting explorer or computer was needed.

@fideliochan
Copy link
Author

Yes! After restarting it works now thanks!

@undergroundwires
Copy link
Owner

I will update the code in a patch release, did you need to restart the computer or was restarting explorer.exe enough?

@fideliochan
Copy link
Author

@undergroundwires IIRC, restarting explorer.exe was enough.

undergroundwires added a commit that referenced this issue Apr 25, 2024
Due to changes in how Windows handles the Snipping Tool, this commit
reclassifies the tool's disablement into its own distinct category.
This update introduces alternative methods to disable the tool,
enhances documentation, and improves script functionality.

Changes include:

- Move Snipping Tool removal to a standalone category for clearer
  navigation.
- Expand documentation to better describe the tool's impact on privacy.
- Add methods to disable the tool without removing the app.
- Implement a shared function to disable specific Windows hotkeys.
undergroundwires added a commit that referenced this issue Apr 25, 2024
Due to changes in how Windows handles the Snipping Tool, this commit
reclassifies the tool's disablement into its own distinct category.
This update introduces alternative methods to disable the tool,
enhances documentation, and improves script functionality.

Changes include:

- Move Snipping Tool removal to a standalone category for clearer
  navigation.
- Expand documentation to better describe the tool's impact on privacy.
- Add methods to disable the tool without removing the app.
- Implement a shared function to disable specific Windows hotkeys.
- Rename Cortana shortcut disablement script for consistency.
@undergroundwires
Copy link
Owner

🎉 Released since 0.13.3.

undergroundwires added a commit that referenced this issue Aug 30, 2024
This commit adds missing system apps for Windows 10 19H2 to 22H2 and
Windows 21H2 to 23H2.

Changes:

- Add missing system apps.
- Improve documentation and naming of existing apps
- Add documentation about excluded system apps (#343)
- Adjust recommendation levels
- Enhance disabling of some apps with extra configurations

New apps added:

- Microsoft.MicrosoftEdge.Stable
- MicrosoftWindows.UndockedDevKit
- Microsoft.Windows.XGpuEjectDialog
- NarratorQuickStart

New apps excluded:

- Microsoft.Windows.StartMenuExperienceHost (#316)
- Microsoft.Windows.ShellExperienceHost (#316)
- MicrosoftWindows.Client.Core
- MicrosoftWindows.Client.CBS
- MicrosoftWindows.Client.FileExp
- Microsoft.Windows.Cortana

Other supporting changes:

- Add conditional store app removal when constraining Windows version
- Add more generated comments in code for better script readability
undergroundwires added a commit that referenced this issue Aug 30, 2024
This commit adds missing system apps for Windows 10 19H2 to 22H2 and
Windows 11 21H2 to 23H2.

Changes:

- Add missing system apps.
- Improve documentation and naming of existing apps
- Add documentation about excluded system apps (#343)
- Adjust recommendation levels
- Enhance disabling of some apps with extra configurations

New apps added:

- Microsoft.MicrosoftEdge.Stable
- MicrosoftWindows.UndockedDevKit
- Microsoft.Windows.XGpuEjectDialog
- NarratorQuickStart

New apps excluded:

- Microsoft.Windows.StartMenuExperienceHost (#316)
- Microsoft.Windows.ShellExperienceHost (#316)
- MicrosoftWindows.Client.Core
- MicrosoftWindows.Client.CBS
- MicrosoftWindows.Client.FileExp
- Microsoft.Windows.Cortana

Other supporting changes:

- Add conditional store app removal when constraining Windows version
- Add more generated comments in code for better script readability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants