jhalon/cSessionHop

GitHub: jhalon/cSessionHop

利用 IHxHelpPaneServer COM 接口实现 Windows 跨会话进程执行的 Cobalt Strike Beacon Object File。

Stars: 68 | Forks: 5

# cSessionHop **cSessionHop** 是一个用于 Cobalt Strike 的 Beacon Object File (BOF),旨在通过 `IHxHelpPaneServer` COM 接口劫持用户会话。该技术允许操作者在其他用户会话中执行进程,而无需依赖诸如进程注入或凭据窃取等传统方法。 该 BOF 与 `IHxHelpPaneServer` COM 接口(CLSID:`8cec58ae-07a1-11d9-b15e-000d56bfe6ee`)进行交互,该接口在目标会话中以交互用户的权限运行。通过使用会话名字对象(`session:!new:`)跨会话边界绑定到此 COM 对象,它可以在指定用户会话的上下文中执行进程。 ## 用法 要使用 cSessionHop,请在 Cobalt Strike 中加载该 BOF 和 Aggressor 脚本。然后,使用以下命令在目标会话中执行所需的进程: ``` beacon> cSessionHop ``` ### 示例 ``` # 在 session 1 中执行 notepad beacon> cSessionHop 1 notepad.exe # 在 session 2 中执行 cmd.exe beacon> cSessionHop 2 cmd.exe # 使用完整路径执行特定 binary beacon> cSessionHop 1 C:\Windows\System32\cmd.exe ``` ## 构建 本项目使用 MinGW 进行编译。要构建该 BOF,只需运行以下命令: ``` make ``` 这将从 `src` 目录编译该 BOF 的 x86 和 x64 版本。 ### 构建要求 * **MinGW-w64** (x86_64-w64-mingw32-gcc 和 i686-w64-mingw32-gcc) * **Make** ## 致谢 本项目基于前人的研究和实现: - **James Forshaw**:关于会话名字对象滥用的原创研究 - [Raising The Dead: Abusing Elevation on Windows](https://googleprojectzero.blogspot.com/2016/01/raising-dead.html) - **Michael Zhmailo (CICADA8)**:关于 IHxHelpPaneServer 技术的文档说明 - [Process Injection is Dead, Long Live IHxHelpPaneServer](https://cicada-8.medium.com/process-injection-is-dead-long-live-ihxhelppaneserver-af8f20431b5d) - **Andrew Oliveau (3lp4tr0n)**:原创 C# SessionHop 实现 - [SessionHop GitHub Repository](https://github.com/3lp4tr0n/SessionHop)
标签:BOF, Cobalt Strike, COM对象滥用, Conpot, Gophish, IHxHelpPaneServer, MinGW编译, Modbus, Session Moniker, Windows安全, 会话劫持, 免注入执行, 协议分析, 安全测试, 攻击性安全, 攻击诱捕, 权限提升, 模糊测试, 横向移动, 欺骗防御, 编程规范, 网络安全, 跨会话执行, 隐私保护