Git Product home page Git Product logo

container-escape-exps's Introduction

0x01 介绍

收集一些能够导致容器逃逸的EXP,有一部分经过了的改造。尽可能清楚地从底层介绍了漏洞的原理以及利用思路,所有的exp都是经过本地验证的。

0x02 漏洞列表

漏洞 描述 验证
CVE-2021-22555 内核漏洞逃逸 已验证
CVE-2020-15257 Containerd组件漏洞逃逸 已验证
CVE-2019-14271 Docker组件漏洞逃逸 已验证
CVE-2019-5736 Runc漏洞逃逸 已验证
CVE-2017-7308 内核漏洞逃逸 已验证
CVE-2016-5195 内核漏洞逃逸 已验证
CVE-2018-18955 内核漏洞提权 已验证
CVE-2018-15664 Docker Daemon漏洞逃逸 已验证

0x03 一些错误配置导致的逃逸

错误配置 描述 验证
--privileged 特权容器导致的逃逸 已验证
Shocker CAP_DAC_READ_SEARCH错误配置 已验证
未授权访问 docker remote api未授权访问 未验证
不当挂载 docker.sock挂载到容器内部 未验证

0x04 一些容器基本知识

机制 说明
Namespace 提供多种资源的隔离
Cgroup Linux Control Groups,分为v1和v2,主要限制进程可使用的资源
Capability 根据最小权限原则设计的限制特权进程的能力的机制,漏洞防御最为有效的手段
Seccomp 限制进程能够使用的系统调用
UnionFS 联合文件系统系统,Docker通过联合文件系统实现镜像功能

0x05 总结

  1. --privileged选项等同于将宿主机暴露给容器,可以完全绕过mnt namespace的限制,也可以进一步通过挂接/proc的方式绕过pid namespace。
  2. 和虚拟机相比,容器存在更多的逃逸攻击面:
    1. 系统内核的漏洞
    2. 容器组件本身的漏洞
    3. 错误的配置
  3. 和虚拟机相比,容器逃逸攻击成本非常低
    1. 更多逻辑漏洞
    2. 在错误的配置下,攻击无需绕过任何防御机制
  4. 和虚拟机相比,容器逃逸的形式更加灵活
    1. 由于隔离机制的分散性,逃逸往往不需要对于所有隔离机制的破解
    2. 各个隔离机制存在木桶效应

0x06 环境搭建

0x07 漏洞利用工具

container-escape-exps's People

Contributors

duowen1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

container-escape-exps's Issues

Hello, duowen1

Hi,之前在Metarget的工作很棒!👍不知您是学生还是老师,欢迎来绿盟星云实验室实习、工作,或者一起合作在容器、云原生安全领域做一些有意思的事情。如果有兴趣,可联系我:[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.