自动化EXP Active Directory(目录服务)、权限提升神器

作者:Sec-Labs | 发布时间:

autobloody

autobloody是一个自动利用BloodHound显示的活动目录权限升级路径的工具,结合pathgen.pyautobloody.py

项目地址

https://github.com/CravateRouge/autobloody

说明

如果BloodHound数据库中存在privesc路径,这个工具可以在两个AD对象之间自动进行AD privesc,即源对象(我们拥有的对象)和目标对象(我们想要的对象)。自动化分为两部分,以便与代理链等隧道工具透明地使用。

  • pathgen.py使用Bloodhound数据和neo4j查询,为privesc找到最佳路径。
  • autobloody.py用来执行pathgen.py找到的路径。

autobloody依赖于bloodAD,支持使用明文密码、pass-the-hash、pass-the-ticket或证书进行认证,并与域控制器的LDAP服务绑定以执行AD privesc。

环境依赖

需要以下环境

为你的虚拟环境使用requirements.txt: pip3 install -r requirements.txt

如何使用它

首先必须将数据导入BloodHound(例如使用SharpHound或BloodHound.py),并且Neo4j必须正在运行。

简易用法

pathgen.py -dp neo4jPass -ds 'OWNED_USER@ATTACK.LOCAL' -dt 'TARGET_USER@ATTACK.LOCAL' && proxychains autobloody.py -d ATTACK -u 'owned_user' -p 'owned_user_pass' --host dc01.attack.local

pathgen.py的完整帮助。

[bloodyAD]$ python pathgen.py -h
usage: pathgen.py [-h] [--dburi DBURI] [-du DBUSER] -dp DBPASSWORD -ds DBSOURCE -dt DBTARGET [-f FILEPATH]

Attack Path Generator

options:
  -h, --help            show this help message and exit
  --dburi DBURI         The host neo4j is running on (default is "bolt://localhost:7687")
  -du DBUSER, --dbuser DBUSER
                        Neo4j username to use (default is "neo4j")
  -dp DBPASSWORD, --dbpassword DBPASSWORD
                        Neo4j password to use
  -ds DBSOURCE, --dbsource DBSOURCE
                        Case sensitive label of the source node (name property in bloodhound)
  -dt DBTARGET, --dbtarget DBTARGET
                        Case sensitive label of the target node (name property in bloodhound)
  -f FILEPATH, --filepath FILEPATH
                        File path for the graph path file (default is "path.json")

autobloody.py的完整帮助。

[bloodyAD]$ python autobloody.py -h
usage: autobloody.py [-h] [-d DOMAIN] [-u USERNAME] [-p PASSWORD] [-k] [-s] --host HOST [--path PATH]

Attack Path Executor

options:
  -h, --help            show this help message and exit
  -d DOMAIN, --domain DOMAIN
                        Domain used for NTLM authentication
  -u USERNAME, --username USERNAME
                        Username used for NTLM authentication
  -p PASSWORD, --password PASSWORD
                        Cleartext password or LMHASH:NTHASH for NTLM authentication
  -k, --kerberos
  -c CERTIFICATE, --certificate CERTIFICATE
                        Certificate authentication, e.g: "path/to/key:path/to/cert"
  -s, --secure          Try to use LDAP over TLS aka LDAPS (default is LDAP)
  --host HOST           Hostname or IP of the DC (ex: my.dc.local or 172.16.1.3)
  --path PATH           Filename of the attack path generated with pathgen.py (default is "path.json")

它是如何工作的

首先pathgen.py使用Neo4j的GDS库中的Dijkstra算法生成一条私有路径。Dijkstra算法可以解决加权图上的最短路径问题。默认情况下,BloodHound创建的边没有权重,只有类型(如MemberOf, WriteOwner)。然后,根据边的类型和到达的节点类型(如用户、组、域),为每条边添加相应的权重。

一旦路径生成并存储为json文件,autobloody.py将连接到DC,并执行路径和清理可逆的东西(除了密码改变之外的一切)。

标签:工具分享