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

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

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

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

工具目录

分类

查看所有分类
Loading categories
Aladdin — 生成利用 AddInProcess.exe 通过 .NET 反序列化实现的初始访问载荷,支持 HTA、VBA、JS 和 CHM 模板以实现内存代码执行。 | Kitploit
工具/GitHubGitHub/nettitude/aladdin
Payload生成漏洞利用红队Payload 开发
GitHubnettitude/aladdin

Aladdin

生成利用 AddInProcess.exe 通过 .NET 反序列化实现的初始访问载荷,支持 HTA、VBA、JS 和 CHM 模板以实现内存代码执行。

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Aladdin

root@kitploit:~
           .-.
          [.-''-.,
          |  //`~\)
          (<| 0\0|>_
          ";\  _"/ \\_ _,
         __\|'._/_  \ '='-,
        /\ \    || )_///_\>>
       (  '._ T |\ | _/),-'
        '.   '._.-' /'/ |
        | '._   _.'`-.._/
        ,\ / '-' |/
        [_/\-----j
   _.--.__[_.--'_\__
  /         `--'    '---._
 /  '---.  -'. .'  _.--   '.
 \_      '--.___ _;.-o     /
   '.__ ___/______.__8----'
     c-'----'
  Lefty @lefterispan - Nettitude Red Team - 2022 / 2023 

关于

Aladdin 是基于 James Forshaw (@tiraniddo) 工作的一种载荷生成技术,它允许反序列化 .NET 载荷并在内存中执行。原始向量记录于 https://www.tiraniddo.dev/2017/07/dg-on-windows-10-s-executing-arbitrary.html。

通过以参数 /guid:32a91b0f-30cd-4c75-be79-ccbd6345de99 和 /pid: 生成进程 AddInProcess.exe,该进程将在 \\.\pipe\32a91b0f-30cd-4c75-be79-ccbd6345de99 下启动一个命名管道,并等待 .NET Remoting 对象。如果我们生成一个具有与 .NET Remoting 监听器通信所需适当数据包字节的载荷,我们将能够触发 System.Workflow.ComponentModel 中的 ActivitySurrogateSelector 类,并获得代码执行。

最初,James Forshaw 在 https://github.com/tyranid/DeviceGuardBypasses/tree/master/CreateAddInIpcData 发布了一个 POC。然而,这个 POC 在较新的 Windows 版本上会失败,因为微软已经修补了易受攻击的 System.Workflow.ComponentModel (https://github.com/microsoft/dotnet-framework-early-access/blob/master/release-notes/NET48/dotnet-48-changes.md)。

但 Nick Landers (@monoxgas) 发现了一种禁用微软引入的检查的方法,并在 https://www.netspi.com/blog/technical/adversary-simulation/re-animating-activitysurrogateselector/ 写了一篇详细文章。该绕过方法记录在 https://github.com/pwntester/ysoserial.net/pull/41。

Aladdin 是一个载荷生成工具,利用特定的绕过方法以及 .NET Remoting 协议的必要头部字节,能够生成初始访问载荷,这些载荷滥用最初文档中记录的 AddInProcess。

提供的模板有:

root@kitploit:~
* HTA

* VBA

* JS

* CHM

注意事项

为了使攻击成功,.NET 程序集必须包含一个具有空构造函数的单个公共类,作为反序列化时的入口点。项目中包含了示例程序集。

root@kitploit:~
public class EntryPoint {
    public EntryPoint() {
        MessageBox.Show("Hello");
    }
}

用法

root@kitploit:~
Usage:
  -w, --scriptType=VALUE     设置为 js / hta / vba / chm。

  -o, --output=VALUE         生成的输出,例如:-o
                                C:\Users\Nettitude\Desktop\payload

  -a, --assembly=VALUE       提供的程序集 DLL,例如:-a
                                C:\Users\Nettitude\Desktop\popcalc.dll

  -h, --help                 帮助

操作安全

  • 用户提供的 .NET 二进制文件将在由 HTA/JS 载荷生成的 AddInProcess.exe 下执行。目前进程的生成使用 COM 对象 9BA05972-F6A8-11CF-A442-00A0C90A8F39 (https://dl.packetstormsecurity.net/papers/general/abusing-objects.pdf),该对象将进程作为 Explorer.exe 进程的子进程启动。

  • 提供给 AddInProcess.exe 进程参数的 GUID 可以由用户控制。目前该 GUID 在模板和代码中是硬编码的。

  • CHM 通过 XSLT 转换执行 JScript。

防御考虑

  • Addinprocess.exe 将始终以 /guid 和 /pid 启动。请为合法使用建立环境基线,并监控其余活动。

有用的参考:

root@kitploit:~
* https://www.tiraniddo.dev/2017/07/dg-on-windows-10-s-executing-arbitrary.html

* https://www.netspi.com/blog/technical/adversary-simulation/re-animating-activitysurrogateselector/

自述 / 致谢

代码基于以下仓库:

root@kitploit:~
* https://github.com/tyranid/DeviceGuardBypasses/tree/master/CreateAddInIpcData

* https://github.com/pwntester/ysoserial.net

感谢:

  • @m0rv4i 帮助处理 C# 细微差别
  • @ace0fspad3s 进行故障排除
  • @ Nettitude RT 的出色表现
下载工具