Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
RogueAssemblyHunter — Rogue Assembly Hunter 是一款用于发现运行进程中“有趣”的 .NET CLR 模块的实用工具。 | Kitploit
工具/GitHubGitHub/bohops/rogueassemblyhunter
防御工具内存取证取证分析恶意软件分析事件响应
GitHubbohops/rogueassemblyhunter

RogueAssemblyHunter

Rogue Assembly Hunter 是一款用于发现运行进程中“有趣”的 .NET CLR 模块的实用工具。

查看仓库
1201044年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

__________ _____ . .
_
____ \ ____ ____ __ __ ____ / _ \ ______ ______ ____ _ | | | .. | // _ \ / __| | _/ __ \ / /\ \ / // __// __ \ / | __ | |< | | | | ( <> ) // > | /\ / / | \ \ _ \ /| Y Y \ _\ \ |_ | || /_/_ /|/ _ > _| /____ >____ >___ >|| / /____/ | / // / / / / / / / /
___ ___ __
/ | \ __ __ / | ___________ / ~ \ | / \ __/ __ _ __
\ Y / | / | \ | \ /| | / _| /|
/|
| /
| _
>
|
/ / /

Rogue Assembly Hunter

Rogue Assembly Hunter 是一个用于发现正在运行的进程中“有趣”的 .NET CLR 模块的实用工具。

  • 作者: @bohops
  • 许可证: MIT
  • 项目: https://github.com/bohops/RogueAssemblyHunter

背景

.NET 是一个功能强大且能力丰富的开发平台和运行时框架,用于构建和运行 .NET 托管应用程序。在过去几年中,.NET 已被红队(及类似团队)采用,用于实现支持进攻性行动的技术。特别是,从进攻性 PowerShell 转向 .NET 对许多人来说是一个合乎逻辑的飞跃,因为 PowerShell v5+ 中增加了监控和机会性可见性。因此,.NET 进攻性工具和技术已成功用于规避基于主机的防御能力、绕过应用程序控制以及构建/搭建/交付/执行恶意代码(类似于 PowerShell)。

从防御角度来看,微软正在采取更多措施来对抗 .NET 相关威胁并最小化 .NET 的整体攻击面。例如,微软在 .NET Framework 4.8 中增加了 AMSI 检查能力,而 WDAC/WLDP 机制也非常有效。从检测/响应角度来看,进一步了解 .NET 生态系统内部情况总是有利于发现对抗 .NET 威胁的新方法。

2017 年,Joe Desimone (@dez_) 撰写了一篇精彩的文章,名为 Hunting For In-Memory .NET Attacks。该文章至今仍具有现实意义,概述了现代 .NET 攻击向量以及用于检测的按需和基于事件的技术。伴随该文章,Joe 发布了一个工具 (Get-ClrReflection),用于主动检测(并检索)内存中缺少适当磁盘引用的 .NET CLR 模块。受 Joe 工作的启发,并利用 CLRMD 运行时诊断库(以及随后的 mscordacwks.dll 数据访问能力)的内省能力,Rogue Assembly Hunter 旨在:

  • 检查所有正在运行的 .NET(“托管”)进程中是否存在有趣的 CLR 模块(例如,构成“程序集”的模块)
  • 检查单个 .NET(“托管”)进程(按 PID)中是否存在有趣的 CLR 模块
  • 监视新生成的进程并尝试检查是否存在有趣的 CLR 模块
  • 支持多种“狩猎”能力,以发现内存中加载的模块、模块的签名状态(如果从磁盘加载)、从有趣目录加载的模块以及冒名模块(例如,虚假文件引用)
  • 支持 CLR 模块导出功能(从 Get-ClrReflection 快速移植而来)
  • 激发更多有趣的工具和技术

主要需求与依赖

  • 以特权用户/进程上下文运行
  • .NET Framework 4.6.1+
  • .NET CLRMD - Microsoft.Diagnostics.Runtime 内省库(NuGet 包)
  • ILMerge - 静态链接器(NuGet 包)
  • ...以及 Visual Studio 中的支持 NuGet 包

备注、提示与注意事项

  • 以高/系统完整性权限的特权用户身份运行。
  • “狩猎”是实验性的,不保证提供完整/正确的结果。注意误报(例如,已签名的模块)并进行相应验证。
  • RogueAssemblyHunter 使用 CLRMD 连接到实时进程,这可能会引入有趣的结果。
  • 由于 RogueAssemblyHunter 的扫描性质,可能存在竞态条件和遗漏结果的情况。考虑使用 --checks 和 --sleep 开关进行调优(尤其是在“监视”模式下)。在某些情况下,由于执行速度(例如 execute-assembly 和临时进程)可能难以“捕获”特定程序集加载。
  • 架构(“位数”)和 .NET 版本(例如 4+)对于使用 .NET CLRMD 库与远程进程交互很重要。
    • 为了获得最大的检查/覆盖范围,请分别为 x86 和 x64 用例构建并运行此程序。
    • 进程扫描模式将尝试连接到所有正在运行的进程,无论其“位数”如何。否则,架构不匹配时会失败。
  • 已在 Windows 10 Pro 2H1H 和 Windows Server 2016 Standard 1607 上测试。在具有相关 .NET Framework 的其他版本上可能也能运行。
  • 本项目中包含带有 NuGet 包的 Visual Studio 项目源代码、PowerShell 脚本和发布二进制文件。
  • Notice.md 包含项目免责声明和许可证信息。
  • 自行承担风险(并且不要介意我糟糕的代码 ;) )!

用法

root@kitploit:~
[*] Parameters:
    
    --mode=<.>   : Required | Select analysis mode. Options include sweep, process, and watch.

    --hunt=<.>   : Optional | Select the hunt scan type to find interesting CLR modules. Specify all (default), memory-only, unusual-dir,
                   sig-status, imposter-file, or list.

    --export=<.> : Optional, Experimental | Specify a file path to export loaded CLR modules for in-memory hunt scans and imposter-file hunt scans 
                   (e.g. --hunt=memory-only/imposter-file/all).

    --pid=<.>    : Optional | Specify a targeted process by PID. Must be used with --mode=process parameter/value.

    --checks=<.> : Optional | Specify a value for scan cycles. This may help reduce race condition misses during scans but could also repeat result output.
                   Default value is 1.

    --sleep=<.>  : Optional | Specify a value for sleep seconds. This may help reduce race condition misses during scans by delaying the check cycle.
                   Default value is 0 seconds.

    --debug      : Optional | Display exception information (e.g. process connect errors).

    --nobanner   : Optional | Suppress the display banner. Useful for executing with the PowerShell script or for use cases that leverage automation.

    --suppress   : Optional | Do not scan the RogueAssemblyHunter process during --mode=sweep or --mode=watch.

    --help       : Optional | Show this help. This will override any other cmdline parameters and exit the application. *This is the default without parameters.


[*] Modes (--mode=)

    - sweep   : Scan/iterate through all processes (Note: Only processes of like architecture/'bitness' will be successfully scanned. Compile to run for x86/x64/etc.).

    - process : Scan a single process. Use with --pid=<PID>.
    
    - watch   : Scan new processes when created. Adjust scan attributes with --checks and --sleep. (Note: This is experimental. Race conditions are likely.)


[*] Hunts (--hunt=)

    - all           : Default value. Analyze with all hunt options (Except 'list').

    - memory-only   : Memory hunt. Analyze CLR modules that are not backed by disk.

    - unusual-dir   : Unusual directory hunt. Analyze CLR modules loaded outside of 'normal' directories.
                      Edit '_huntUnusualDirectoryFilter' to customize.

    - sig-status    : File signature hunt. Analyze CLR modules with anomalous signature status (e.g. unsigned). Note: This is experimental. False positives are possible.
                      Edit '_huntSigExclusionsFilter'  to customize.

    - imposter-file : Unexpected CLR module hunt. Analyze CLR module with suspicious disk file backing. Experimental.
    
    - list          : Iterate through all CLR modules and list accordingly.


[*] Example Usage
    
    - Example 1 : Scan processes and run through all hunts for accessible 64-bit processes (except 'list') -
                  RogueAssemblyHunter_x64.exe --mode=sweep
    
    - Example 2 : Scan processes, list all CLR modules in accessible 32-bit managed processes, and show error information -
                  RogueAssemblyHunter_x86.exe --mode=sweep --hunt=list --debug

    - Example 3 : Watch for new processes, scan all CLR modules (if managed and 64-bit), do not scan the RogueAssemblyHunter process, and do 2 checks with a 3 second delay between - 
                  RogueAssemblyHunter_x64.exe --mode=watch --suppress --checks=2 --sleep=3

    - Example 4 : Scan single process by PID, list in-memory only CLR module findings, and export CLR modules to specified path -
                  RogueAssemblyHunter_x86.exe --mode=process --pid=4650 --hunt=memory-only --export=c:\evilassemblies\
    
    - Example 5 : Scan processes, list in-memory only CLR module findings for accessible 64-bit processes, do no scan RogueAssemblyHunter process, and do not show title banner -
                  RogueAssemblyHunter_x64.exe --mode=sweep --hunt=memory-only --suppress --nobanner

发布文件:Invoke-RogueAssemblyHunter 和编译二进制文件

为了方便,项目包含一个 PowerShell 脚本和两个编译好的二进制文件(RogueAssemblyHunter_x64.exe 和 RogueAssemblyHunter_x86.exe),位于 Release 文件夹中。您可以根据需求修改它们(例如,部署、嵌入、检查、休眠等)。

示例用法:

以扫描模式运行 Invoke-RogueAssemblyHunter 并检查所有狩猎选项

root@kitploit:~
cd c:\path\to\RogueAssemblyHunter
import-module .\Invoke-RogueAssemblyHunter.ps1
Invoke-RogueAssemblyHunter

以监视模式运行 Invoke-RogueAssemblyHunter 并检查所有狩猎选项

root@kitploit:~
cd c:\path\to\RogueAssemblyHunter
import-module .\Invoke-RogueAssemblyHunter.ps1
Invoke-RogueAssemblyHunter -ScanMode watch

SHA256 哈希值:

root@kitploit:~
e804711a8b6469f1b13b388de47dfa6dde1c85279d365db7b6e19e1644990fa6  Invoke-RogueAssemblyHunter.ps1
cc985d918e566671aa209142abc55bd798ca6c1a18730b785ac8c18d489736c3  RogueAssemblyHunter_x64.exe
ae3aead43871e263cd8465d5356c4daaae0635714321f872c931ec825008287a  RogueAssemblyHunter_x86.exe

路线图

  • 托管转储(.dmp)文件分析
  • 改进签名状态检查
  • 输出改进(例如,JSON)
  • 稳定性和错误修复

致谢、灵感与资源

  • Hunting For In-Memory .NET Attacks | 作者:Joe Desimone (@dez_)
  • Get-ClrReflection | 作者:Joe Desimone (@dez_)
  • Get-InjectedThread | 作者:Jared Atkinson (@jaredcatkinson)
  • pe-sieve | 作者:hasherezade (@hasherezade)
  • CLR MD — Analyzing Live Process | 作者:Harsha
  • How to enumerate Modules in each App Domain using ClrMD | 作者:Sukesh Ashok Kumar
  • WMIProcessWatcher | 作者:Tim MalcomVetter (@malcomvetter)
下载工具