在MS Office文档属性中隐藏Payload的技术解析

40 阅读1分钟

在MS Office文档属性中隐藏Payload

Carrie Roberts* //
你是否想过为何要在MS Office文档属性中插入超长注释?本文介绍的PowerShell脚本可突破应用程序限制实现该功能。动画演示展示了脚本运行效果:

  1. 突破长度限制:原生Word/Excel/PowerPoint对注释字段有长度限制,该脚本可完全绕过
  2. 属性清洗功能:包含"Sanitize"选项可清除"作者"和"最后修改者"等元数据
  3. 命令行参数:支持通过参数自定义属性值

宏读取实现

MS Word版本

Dim prop As DocumentProperty
For Each prop In ActiveDocument.BuiltInDocumentProperties
    If prop.Name = "Comments" Then
        MsgBox prop.Value
    End If
Next

MS Excel版本(仅需替换对象):

Dim prop As DocumentProperty
For Each prop In ActiveWorkbook.BuiltinDocumentProperties
    If prop.Name = "Comments" Then
        MsgBox prop.Value
    End If
Next

PowerPoint版本

Dim prop As DocumentProperty
For Each prop In ActivePresentation.BuiltInDocumentProperties
    If prop.Name = "Comments" Then
        MsgBox prop.Value
    End If
Next

进阶技巧

  • 支持Base64编码注释,配合VBScript解码代码使用
  • 适用于红队测试中的Payload隐藏场景