All Projects → ctrsploit → ctrsploit

ctrsploit / ctrsploit

Licence: other
A penetration toolkit for container environment

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects
python
139335 projects - #7 most used programming language
shell
77523 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to ctrsploit

Ko
Build and deploy Go applications on Kubernetes
Stars: ✭ 3,755 (+7889.36%)
Mutual labels:  container
dockerfilegraph
Visualize your multi-stage Dockerfiles
Stars: ✭ 55 (+17.02%)
Mutual labels:  container
laravel-devcontainer
🐋 Fully-Dockerised Laravel development in Visual Studio Code
Stars: ✭ 80 (+70.21%)
Mutual labels:  container
docker-electrumx
Run an Electrum server with one command
Stars: ✭ 87 (+85.11%)
Mutual labels:  container
hybridnet
A CNI plugin, provides networking environment where overlay and underlay containers can run on the same node and have cluster-wide bidirectional network connectivity.
Stars: ✭ 188 (+300%)
Mutual labels:  container
remark-directive
remark plugin to support directives
Stars: ✭ 137 (+191.49%)
Mutual labels:  container
Staticvec
Implements a fixed-capacity stack-allocated Vec alternative backed by an array, using const generics.
Stars: ✭ 236 (+402.13%)
Mutual labels:  container
USmallFlat
Ubpa small flat containers based on C++20
Stars: ✭ 20 (-57.45%)
Mutual labels:  container
nginx-lua
Nginx 1.19+ with LUA support based on Alpine Linux, Amazon Linux, Debian, Fedora and Ubuntu.
Stars: ✭ 112 (+138.3%)
Mutual labels:  container
windows-container
Docker files for various Windows Container build
Stars: ✭ 30 (-36.17%)
Mutual labels:  container
di
🐑 A flexible dependency injection container; It is an implementation of PSR-11
Stars: ✭ 20 (-57.45%)
Mutual labels:  container
docker eventer
A Docker container to notify about Docker events written in Python
Stars: ✭ 14 (-70.21%)
Mutual labels:  container
docker-java
Intro Level Lab for Docker Development for Java Developers
Stars: ✭ 34 (-27.66%)
Mutual labels:  container
pouchrobot
An AI robot to collaborate in any open source project on GitHub
Stars: ✭ 39 (-17.02%)
Mutual labels:  container
docker-darling
Experimental docker container with Darling for macOS runtime
Stars: ✭ 38 (-19.15%)
Mutual labels:  container
Haconiwa
MRuby on Container / A Linux container runtime using mruby DSL for configuration, control and hooks
Stars: ✭ 247 (+425.53%)
Mutual labels:  container
go-docker
Golang Docker Container Example
Stars: ✭ 39 (-17.02%)
Mutual labels:  container
default-http-login-hunter
Login hunter of default credentials for administrative web interfaces leveraging NNdefaccts dataset.
Stars: ✭ 285 (+506.38%)
Mutual labels:  penetration-testing-tools
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (-29.79%)
Mutual labels:  container
docker
Template project for deploying Chevereto V4 based applications using Docker
Stars: ✭ 33 (-29.79%)
Mutual labels:  container

ctrsploit: A penetration toolkit for container environment

中文文档

ctrsploit [kənˈteɪnər splɔɪt]

Why ctrsploit

see here

Pre-Built Release

https://github.com/ctrsploit/ctrsploit/releases

Build by yourself

Build the target binary with Docker container toolkit

git clone https://github.com/ctrsploit/ctrsploit.git
cd ctrsploit
docker build . -t ctrsploit_builder
chmod +x build/build.sh  
# auto build
docker run -v $(pwd):/ctrsploit --rm ctrsploit_builder 

or you can do it manually

...
docker run -it -v $(pwd):/ctrsploit --rm ctrsploit_builder /bin/sh
build_ctrsploit

Note:To modify the target platform, modify the OS/arch parameter string in the build/build.sh file, e.g. -osarch="linux/amd64"

Usage

Quick-Start

wget -O ctrsploit https://github.com/ctrsploit/ctrsploit/releases/download/v0.4/ctrsploit_linux_amd64 && chmod +x ctrsploit
./ctrsploit --help
NAME:
   ctrsploit - A penetration toolkit for container environment

ctrsploit is a command line ... //TODO


USAGE:
   ctrsploit [global options] command [command options] [arguments...]

COMMANDS:
   auto, a     auto gathering information, and detect vuls, and exploit // TODO
   exploit, e  run a exploit
   env, e      gather information // TODO
   help, h     Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --lang value  language for the greeting (default: "english")
   --help, -h    show help (default: false)

gather information

usage

root@ctr:/# ./ctrsploit env
NAME:
   ctrsploit env - gather information

USAGE:
   ctrsploit env command [command options] [arguments...]

COMMANDS:
   where, w        detect whether you are in the container, and which type of the container
   graphdriver, g  detect graphdriver type and extend information
   cgroups, c      gather cgroup information
   help, h         Shows a list of commands or help for one command

OPTIONS:
   --help, -h  show help (default: false)

where

root@ctr:/# ./ctrsploit  env  w
INFO[0000] ===========Docker=========
.dockerenv exists: ✔
rootfs contains 'docker': ✔
cgroup contains 'docker': ✘
the mount source of /etc/hosts contains 'docker': ✔
hostname match regex ^[0-9a-f]{12}$: ✔
=> is in docker: ✔ 
INFO[0000] ===========k8s=========
/var/run/secrets/kubernetes.io exists: ✘
hostname match k8s pattern: ✘
the mount source of /etc/hosts contains 'pods': ✘
cgroup contains 'kubepods': ✘
=> is in k8s: ✘ 

run a exploit

root@2aa13a052102:/# ./ctrsploit e
NAME:
   ctrsploit exploit - run a exploit

USAGE:
   ctrsploit exploit command [command options] [arguments...]

COMMANDS:
   cgroupv1-release_agent, ra                       escape tech by using the notify_on_release of cgroup v1
   cgroupv1-release_agent-unknown_rootfs, ra3       escape tech by using the notify_on_release of cgroup v1 without known rootfs
   help, h                                          Shows a list of commands or help for one command

OPTIONS:
   --help, -h  show help (default: false)

eg. : escape by 'cgroupv1-release_agent' tech.

root@host # docker run -ti --rm --security-opt="apparmor=unconfined" --cap-add="sys_admin" busybox
root@ctr # wget -O ctrsploit https://github.com/ctrsploit/ctrsploit/releases/download/v0.4/ctrsploit_linux_amd64 && chmod +x ctrsploit
root@ctr # ./ctrsploit e ra -c "cat /etc/hostname"

check security

Just execute ctrsploit checksec or standalone binary file checksec in the container.

[root@ctr ~]# /checksec_linux_amd64 
===========Seccomp=========
kernel supported: ✔
seccomp enabled in current container: ✘

===========Apparmor=========
Kernel Supported: ✘
Container Enabled: ✘

===========Cgroups=========
is cgroupv1: ✔
is cgroupv2: ✘

------sub systems-------
["perf_event" "memory" "net_cls" "cpuset" "blkio" "hugetlb" "files" "cpu" "cpuacct" "pids" "rdma" "freezer" "devices" "net_prio"]

--------top level subsystem----------
["rdma"

Details

env

command alias description
where w detect whether you are in the container, and which type of the container
graphdriver g detect graphdriver type and extend information
cgroups c gather cgroup information
capability cap show the capability of pid 1 and current process
seccomp s show the seccomp info
apparmor a show the apparmor info

exploit

exploit alias description
cgroupv1-release_agent ra escape tech by using the notify_on_release of cgroup v1
cgroupv1-release_agent-unknown_rootfs ra3 escape tech by using the notify_on_release of cgroup v1 without known rootfs
cve-2021-22555_ubuntu18.04 22555 escape tech by using the CVE-2021-22555 (ubuntu18.04)

helper

helper alias description
cve-2021-3493 ubuntu-overlayfs-pe,3493 Ubuntu OverlayFS Local Privesc

checksec

Just execute ctrsploit checksec or standalone binary file checksec.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].