freeBuf
主站

分类

云安全 AI安全 开发安全 终端安全 数据安全 Web安全 基础安全 企业安全 关基安全 移动安全 系统安全 其他安全

特色

热点 工具 漏洞 人物志 活动 安全招聘 攻防演练 政策法规

点我创作

试试在FreeBuf发布您的第一篇文章 让安全圈留下您的足迹
我知道了

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

如何使用COMThanasia对COM对象执行安全审计
Alpha_h4ck 2024-10-29 14:19:51 80759
所属地 广西

关于COMThanasia

COMThanasia是一款针对COM对象的安全审计工具,可以帮助广大研究人员轻松检测COM对象中的各种安全问题。

功能介绍

1、检测COM对象(LaunchPermission、AccessPermission)中不正确的访问控制问题;

2、COM对象中不正确的注册表权限;

3、找到新的Elevation Moniker - UAC Bypass;

4、获取有关特定 CLSID 的详细信息;

5、检查低权限用户跨会话问题;

工具组成

当前版本的COMThanasia由一下几个组件组成:

PermissionHunter

ComDiver

MonikerHound

ClsidExplorer

ComTraveller

工具安装

广大研究人员可以直接使用下列命令将该项目源码克隆至本地:

git clone https://github.com/CICADA8-Research/COMThanasia.git

工具使用

PermissionHunter

PermissionHunter 是一个工具,它允许您检查系统上所有 COM 对象上的 LaunchPermission 和 ActivatePermission:

PS A:\mzhmo> .\PermissionHunter.exe -h

 

                     ,

                `-.   \    .-'

        ,-"`````""-\__ |  /

         '-.._    _.-'` '-o,

             _>--:{{<   ) |)

         .-''      '-.__.-o`

        '-._____..-/`  |  \

                ,-'   /    `-.

                      `

  PermissionHunter - hunt for incorrect LaunchPermission and ActivatePermission

 

        CICADA8 Research Team

        From Michael Zhmaylo (MzHmO)

 

PermissionHunter.exe

Small tool that allows you to find vulnerable COM objects with incorrect LaunchPermission and ActivatePermission

 

[OPTIONS]

-outfile : output filename

-outformat : output format. Accepted 'csv' and 'xlsx'

-h/--help : shows this windows

使用样例:

PS A:\mzhmo> .\PermissionHunter -outfile result -outformat xlsx

 

                     ,

                `-.   \    .-'

        ,-"`````""-\__ |  /

         '-.._    _.-'` '-o,

             _>--:{{<   ) |)

         .-''      '-.__.-o`

        '-._____..-/`  |  \

                ,-'   /    `-.

                      `

  PermissionHunter - hunt for incorrect LaunchPermission and ActivatePermission

 

        CICADA8 Research Team

        From Michael Zhmaylo (MzHmO)

 

[+] Result will be in result, format xlsx

[+] Success

输出内容如下:

ComDiver

此工具可让您检测此类漏洞,并根据搜索 COM 对象时查看的键的优先级扫描注册表。通过这种方式,您甚至可以找到 Shadow COM Hijacking:

PS A:\ssd\gitrepo\COMThanasia\ComDiver\x64\Debug> .\ComDiver.exe -h

 

              \     /

          \    o ^ o    /

            \ (     ) /

 ____________(%%%%%%%)____________

(     /   /  )%%%%%%%(  \   \     )

(___/___/__/           \__\___\___)

   (     /  /(%%%%%%%)\  \     )

    (__/___/ (%%%%%%%) \___\__)

            /(       )\

          /   (%%%%%)   \

               (%%%)

                 !

 

----------- COM DIVER --------------

[?] Small tool to check insecure registry and disk permissions on com objects

[?] ARGS

        -h/--help <- show this message

        --from <CLSID> <- analyze CLSIDs from this clsid

        --target <CLSID> <- analyze one target clsid

        --no-context <- dont check another COM-server context. Only registry analyzing.

        --no-create <- dont create target COM object. This is the fastest mode

使用样例:

.\ComDiver.exe --no-create

MonikerHound

MonikerHound允许我们检测UAC绕过问题:

PS A:\ssd\gitrepo\COMThanasia\MonikerHound\x64\Debug> .\MonikerHound.exe

 

 

          ,_  _  _,

            \o-o/

           ,(.-.),

         _/ |) (| \_

           /\=-=/\

          ,| \=/ |,

        _/ \  |  / \_

            \_!_/

 

 MonikerHound - find your own UAC Bypass!

 

         CICADA8 Research Team

         From Michael Zhmaylo (MzHmO)

 

[+] Potential COM server for elevation moniker found!

Name: CEIPLuaElevationHelper

CLSID: {01D0A625-782D-4777-8D4E-547E6457FAD5}

LocalizedString: @%systemroot%\system32\werconcpl.dll,-351

Enabled: 1

IconReference: @%systemroot%\system32\werconcpl.dll,-6

Activate: Success

PID: 15800

DllHost.exe

[+]........................[+]

[+] Potential COM server for elevation moniker found!

Name: CTapiLuaLib Class

CLSID: {03e15b2e-cca6-451c-8fb0-1e2ee37a27dd}

LocalizedString: @%systemroot%\system32\tapiui.dll,-1

Enabled: 1

IconReference: @%systemroot%\system32\tapiui.dll,-201

Activate: Success

PID: 440

DllHost.exe

[+]........................[+]

ClsidExplorer

ClsidExplorer 允许您检索有关特定 CLSID 的信息:

PS A:\ssd\gitrepo\COMThanasia\ClsidExplorer\x64\Debug> .\CLSIDExplorer.exe -h

CLSIDExplorer.exe - identify all info by clsid

Usage:

.\CLSIDExplorer.exe --clsid "{00000618-0000-0010-8000-00aa006d2ea4}"

使用样例:

PS A:\ssd\gitrepo\COMThanasia\ClsidExplorer\x64\Debug> .\CLSIDExplorer.exe --clsid "{00000618-0000-0010-8000-00aa006d2ea4}"

[{00000618-0000-0010-8000-00aa006d2ea4}]

        AppID: Unknown

        ProgID: Unknown

        PID: 1572

        Process Name: CLSIDExplorer.exe

        Username: WINPC\\Michael

        Methods:

        [0] __stdcall void QueryInterface(IN GUID*, OUT void**)

        [1] __stdcall unsigned long AddRef()

        [2] __stdcall unsigned long Release()

        [3] __stdcall void GetTypeInfoCount(OUT unsigned int*)

        [4] __stdcall void GetTypeInfo(IN unsigned int, IN unsigned long, OUT void**)

        [5] __stdcall void GetIDsOfNames(IN GUID*, IN char**, IN unsigned int, IN unsigned long, OUT long*)

        [6] __stdcall void Invoke(IN long, IN GUID*, IN unsigned long, IN unsigned short, IN DISPPARAMS*, OUT VARIANT*, OUT EXCEPINFO*, OUT unsigned int*)

        [7] __stdcall BSTR Name()

        [8] __stdcall void Name(IN BSTR)

        [9] __stdcall RightsEnum GetPermissions(IN VARIANT, IN ObjectTypeEnum, IN VARIANT)

        [10] __stdcall void SetPermissions(IN VARIANT, IN ObjectTypeEnum, IN ActionEnum, IN RightsEnum, IN InheritTypeEnum, IN VARIANT)

        [11] __stdcall void ChangePassword(IN BSTR, IN BSTR)

        [12] __stdcall Groups* Groups()

        [13] __stdcall Properties* Properties()

        [14] __stdcall _Catalog* ParentCatalog()

        [15] __stdcall void ParentCatalog(IN _Catalog*)

        [16] __stdcall void ParentCatalog(IN _Catalog*)

[END]

ComTraveller

此工具允许您探索所有可用的 COM 对:

PS A:\SSD\gitrepo\COMThanasia\ComTraveller\x64\Debug> .\ComTraveller.exe -h

 

        ,,_

       zd$$??=

     z$$P? F:`c,                _

    d$$, `c'cc$$i           ,cd$?R

   $$$$ cud$,?$$$i       ,=P"2?z "

    $" " ?$$$,?$$$.    ,-''`>, bzP

     'cLdb,?$$,?$$$   ,h' "I$'J$P

  ... `?$$$,"$$,`$$h  $$PxrF'd$"

d$PP""?-,"?$$,?$h`$$,,$$'$F44"

?,,_`=4c,?=,"?hu?$`?L4$'? '

   `""?==""=-"" `""-`'_,,,,

           .ccu?m?e?JC,-,"=?

                """=='?"

 

ComTraveller - small tool to parse and extract information about all registered CLSIDs on the system

Usage:

--file <output> - output filename. Default: output.csv

--from <clsid> - start exploring clsids from this clsid. (for ex. default enum from 1 to 9. with --from 4 will be from 4 to 9)

--session <session> - use if you want to check Cross-Session Activation in a specific session. Useful only with 'Run as interactive user COM objects'

--target <CLSID> - analyze this CLSID

-h/--help - shows this screen

使用样例:

.\ComTraveller.exe --file rep.csv --session 1

项目地址

COMThanasia:【GitHub传送门

参考资料

https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation/com-hijacking

# 系统安全 # 安全审计 # COM
免责声明
1.一般免责声明:本文所提供的技术信息仅供参考,不构成任何专业建议。读者应根据自身情况谨慎使用且应遵守《中华人民共和国网络安全法》,作者及发布平台不对因使用本文信息而导致的任何直接或间接责任或损失负责。
2. 适用性声明:文中技术内容可能不适用于所有情况或系统,在实际应用前请充分测试和评估。若因使用不当造成的任何问题,相关方不承担责任。
3. 更新声明:技术发展迅速,文章内容可能存在滞后性。读者需自行判断信息的时效性,因依据过时内容产生的后果,作者及发布平台不承担责任。
本文为 Alpha_h4ck 独立观点,未经授权禁止转载。
如需授权、对文章有疑问或需删除稿件,请联系 FreeBuf 客服小蜜蜂(微信:freebee1024)
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
相关推荐
Alpha_h4ck LV.10
好好学习,天天向上
  • 2359 文章数
  • 1023 关注者
Tetragon:一款基于eBPF的运行时环境安全监控工具
2025-01-21
DroneXtract:一款针对无人机的网络安全数字取证工具
2025-01-21
CNAPPgoat:一款针对云环境的安全实践靶场
2025-01-21
文章目录