HTB-Pikaptcha
本文最后更新于 2025年4月13日 凌晨
关于 Windows 的注册表取证
Description
Happy Grunwald contacted the sysadmin, Alonzo, because of issues he had downloading the latest version of Microsoft Office. He had received an email saying he needed to update, and clicked the link to do it. He reported that he visited the website and solved a captcha, but no office download page came back. Alonzo, who himself was bombarded with phishing attacks last year and was now aware of attacker tactics, immediately notified the security team to isolate the machine as he suspected an attack. You are provided with network traffic and endpoint artifacts to answer questions about what happened.
分析用户 happy grunwald 的注册表配置单元,查找其下载并执行 stager 的完整命令
tree 一下发现文件中有多个用户(实际上也只用了一个)
用 Registry Explorer 打开 Pikaptcha\2024-09-23T052209_alert_mssp_action\C\Users\happy.grunwald
下的 NTUSER.DAT
文件,访问 RunMRU
文件夹,找到命令
1 |
|
- NoP:NoProfile,不加载 PowerShell 配置文件,快速启动
- NonI:Nonlnteractive,非交互模式
- W Hidden:WindowStyle Hidden,隐藏 PowerShell 窗口,让用户无法察觉程序运行
- Exec Bypass:ExecutionPolicy Bypass,绕过系统脚本执行策略
- Command中的
IRX
:Invoke-Expression,直接执行下载的脚本
整个命令的作用就是:下载来自 IP 43.205.115.44
的 office2024install.ps1
脚本,但下载和执行都被隐藏了
payload 执行的 UTC 时间
1 |
|
找出该脚本的 SHA256 哈希值
加载流量包,导出关于 office2024install.ps1
的文件
获取 hash 值
1 |
|
反向 shell 连接的端口
把 office2024install.ps1
文件内容解码
1 |
|
从中可以看出端口是 6969
1 |
|
C2 和工作站之间的反向 shell 连接建立持续时间
因为前面已经找到反向 shell 的端口号了,所以直接过滤就行
1 |
|
根据详细判断开始和结束时间,然后直接相减得到 403 s
1 |
|
包含 payload 的函数名称
过滤 IP 和端口,追踪 TCP 流发现下载 BloodHound
执行了 SharpHound.ps1
文件输出到 Windows 的 tmp 目录
1 |
|
这是一个能映射和量化 Active Directory 攻击路径的工具 , 但是在此并没有什么危害
过滤 http 数据包
1 |
|
追踪 HTTP 流,发现 stageClipboard()
函数包含了 payload 命令
所以为
1 |
|