Windows/Mark-of-the-Web

Windows/Mark-of-the-Web

Mark of the Web (MotW) 是 Windows 10+ 最傻逼的安全特性之一。其会对所有来自 Internet 下载的文件通过 NTFS alternate stream 写入一个标识标记文件来源 Internet 并在各种地方限制对该文件的访问:

  • Windows Defender SmartScreen
  • MS Office protected view: 理论上只会用 sandbox (protected view) 打开 office 文件。但我遇到过某些环境 Office 直接弹窗报错无法打开网上下载的 Office 文件,提示内存不足!傻逼微软!
  • Application Guard for Office

查看 / 管理 MotW

PowerShell

# 查看文件的 MotW (如果文件没有 MotW, 会报错)
Get-Content -Stream Zone.Identifier .\document.doc
# 删除文件的 MotW
Remove-Item -Stream Zone.Identifier .\document.doc
[ZoneTransfer]
ZoneId = 3

ZoneId:

  • 0: Local computer
  • 1: Local intranet
  • 2: Trusted sites
  • 3: Internet
  • 4: Restricted sites

禁用 MotW 相关限制

  • Windows Defender: 在设置里禁用 SmartScreen。
  • Office: 打开 Word (或其他任意 Office 组件) - File - Options - Trust Center - Trust Center Settings - Protected View: 取消勾选所有3个 "Enabled protected view for ..." 的复选框,点击 OK。

Last update: 2023-01-25 03:39:37 UTC