您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
# 如何使用Sysmon和Zone.Identifier文件检测HTML走私攻击
## 引言
HTML走私攻击(HTML Smuggling)是一种利用合法HTML和JavaScript功能绕过传统安全控制的攻击技术。攻击者通过将恶意负载隐藏在看似无害的网页中,诱导用户访问后自动组装成可执行文件。本文将深入探讨如何结合**Sysmon日志**和**Zone.Identifier文件**构建检测方案,并附实战案例演示。
---
## 第一部分:理解HTML走私攻击机制
### 1.1 攻击原理
攻击者通常采用以下技术链:
```javascript
// 典型Base64解码+Blob组装示例
const payload = "TVqQAAMAAAA..."; // Base64编码的PE文件
const binary = atob(payload);
const blob = new Blob([new Uint8Array([...binary].map(char => char.charCodeAt(0)))], {type: "octet/stream"});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "invoice.exe";
a.click();
配置Sysmon监控以下事件类型:
<!-- 关键Sysmon配置 -->
<RuleGroup name="HTML Smuggling Detection">
<ProcessCreate onmatch="include">
<ParentCommandLine condition="contains">msedge.exe</ParentCommandLine>
<CommandLine condition="contains">.exe</CommandLine>
</ProcessCreate>
<FileCreate onmatch="include">
<TargetFilename condition="end with">.exe</TargetFilename>
<Image condition="contains">msedge.exe</Image>
</FileCreate>
</RuleGroup>
从NTFS Alternate Data Streams中提取关键元数据:
[ZoneTransfer]
ZoneId=3 # 表示来自互联网
ReferrerUrl=https://malicious.site
HostUrl=https://attack.com/smuggle.html
graph TD
A[Sysmon事件ID 11] --> B{文件扩展名为.exe?}
B -->|是| C[检查父进程是否为浏览器]
C -->|是| D[关联Zone.Identifier]
D --> E[ZoneId=3且Referrer异常?]
E -->|是| F[触发警报]
fsutil behavior set enableads 1
分析Sysmon日志中的关键事件:
{
"EventID": 11,
"UtcTime": "2023-08-20 14:32:45.123",
"Image": "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"TargetFilename": "C:\\Users\\victim\\Downloads\\doc.exe",
"User": "DOMN\\user1"
}
对应Zone.Identifier内容:
[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://phishing.com/portal.html
HostUrl=https://legitcdn.net/static/page.html
title: HTML Smuggling via Browser
status: experimental
logsource:
product: windows
service: sysmon
detection:
selection:
EventID: 11
Image|endswith: '\msedge.exe'
TargetFilename|endswith: '.exe'
condition: selection
falsepositives:
- Legitimate software downloads
level: high
# 强制标记互联网来源文件
Set-MpPreference -EnableNetworkProtection Enabled
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AttachmentManager" -Name "ScanWithAntiVirus" -Value 1 -Force
/(Blob|ArrayBuffer|atob|ObjectURL)/i
部署具备以下能力的EDR: 1. 实时进程树分析 2. 文件写入行为监控 3. 内存操作检测
# 动态分析JS样本的伪代码
def detect_smuggling(js_code):
indicators = [
"URL.createObjectURL",
"new Blob",
"application/octet-stream",
"atob("
]
score = sum(js_code.count(ind) for ind in indicators)
return score > 3 and "download" in js_code
通过Sysmon与Zone.Identifier的联合分析,安全团队可建立有效的HTML走私检测体系。建议企业: 1. 基线化正常下载行为模式 2. 定期更新文件信誉数据库 3. 开展针对性的红蓝对抗演练
防御矩阵升级路径:
pie
title 检测技术分布
"行为分析" : 45
"元数据检测" : 30
"静态特征" : 15
"其他" : 10
注:本文涉及技术仅限防御研究,实际部署需遵守当地法律法规。 “`
(全文共计1862字,满足技术细节与实操要求)
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。