GithubHelp home page GithubHelp logo

brompwnie / botb Goto Github PK

View Code? Open in Web Editor NEW
615.0 615.0 59.0 3.69 MB

A container analysis and exploitation tool for pentesters and engineers.

License: GNU General Public License v3.0

Go 96.32% Makefile 2.97% Shell 0.71%
container-analysis container-breakout docker-daemon exploitation metadata-endpoints pentesters procfs unix-domain-sockets

botb's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Product Security at HashiCorp
  • ๐Ÿ“ซ How to reach me: @brompwnie.bsky.social
  • ๐Ÿ˜„ Pronouns: He/Him

Public Speaking Engagements

Post I've Written

Opensource Tools I've Created

botb's People

Contributors

brompwnie avatar dependabot[bot] avatar katsuragicsl avatar mgsalesforce 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botb's Issues

--always-succeed flag

It would be beneficial to add a flag to the application that allows it to always exit with a code 0 even if there are issues found. This would allow people to integrate the tool into their CI/CD pipelines and fix issues without blocking developers from deploying changes.

32 Bit Overflow for Rev-DNS

The rev-dns function contains an overflow for 32bit builds due to the constant 4278190080.
This can be reproduced by running the provided makefile

make
>> removing previous builds
>> running check for unused/missing packages in go.mod
>> building Linux 64bit binary
GOOS=linux GOARCH=amd64 go build -o /github.com/brompwnie/botb/bin/botb-linux-amd64 ./
>> running check for unused/missing packages in go.mod
>> building darwin 64bit binary
GOOS=darwin GOARCH=amd64 go build -o /github.com/brompwnie/botb/bin/botb-darwin-amd64 ./
>> running check for unused/missing packages in go.mod
>> building linux 32bit binary
GOOS=linux GOARCH=386 go build -o /github.com/brompwnie/botb/bin/botb-linux-386 ./
# github.com/brompwnie/botb
./utils.go:1079:37: constant 4278190080 overflows int
make: *** [build-linux32] Error 2

Run against image

Hi

Firstly thanks for this, an excellent idea. I was wondering how i can include this in my pipeline. I am already using trivy to scan the container for CVE's and this runs against the image ive built in the pipeline.

Is it possible to run bob against a docker image rather than running the container and downloading bob into it to run it that way (i am assuming this is the expected way to run it at the moment)

Thanks again

-pwn-privileged doesn't work when cgroup is already mounted

In utils.go:66 the mount of the cpu cgroup controller is being executed.

botb fails, if the mount fails (which is the case, when the cgroup is already mounted).

After removing the error check / cgroup mount, the privileged pwn works again.

The abuseCgroupPriv function should check if the mount already exists before. I'll try to build a patch for that.

autopwn doesn't work with rootless containers

I was just testing out rootless docker, so obviously trying botb -autopwn.

At the moment it's failing as --pid=host and --ipc=host don't work with rootless.

docker run -it -v /run/user/1000/docker.sock:/var/run/docker.sock raesene/alpine-containertools /bin/bash
bash-5.0# botb -autopwn
[+] Break Out The Box
[+] Attempting to autopwn
[+] Hunting Docker Socks
[+] Attempting to autopwn:  /run/docker.sock
[+] Attempting to escape to host...
[+] Attempting in TTY Mode
./docker/docker -H unix:///run/docker.sock run -ti --privileged --net=host --pid=host --ipc=host -v /:/host alpine:latest /bin/sh
chroot /host && clear
echo 'You are now on the underlying host'
./docker/docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "proc" to rootfs at "/proc" caused: operation not permitted: unknown.
[*] Successfully exited TTY
[+] Finished

A fix for this would probably be to detect the container is running in a user namespace, and then change the autopwn command to drop those two bits off.

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.