# Kubernetes常见攻击方式

#### 概述

* &#x20;随着越来越多企业开始上云的步伐，在攻防演练碰到云相关的场景有：公有云、私有云、混合云、虚拟化集群。
* &#x20;以往渗透是从外网突破-> 提权 -> 权限维持 -> 信息收集 -> 横向移动 -> 循环收集信息获得重要目标系统。随着业务上云以及虚拟化技术的引入改变了这种格局，也打开了新的入侵路径。

&#x20;

1\. 通过虚拟机攻击云管理平台，利用管理平台控制所有机器

2\. 通过容器进行逃逸，从而控制宿主机以及横向渗透到K8s Master节点控制其上所有容器

3\. 购买弹性虚拟主机-> KVM-QEMU/执行逃逸 -> 获取宿主机 -> 进入物理网络 -> 横向移动控制云平台

&#x20;

TeamTNT专门以Kubernetes为目标，近50000个IP受到攻击。受害者大多数来自于中国。

![](/files/ZUnvWOEjapm3SvVnDTvX)&#x20;

&#x20;

主要攻击人员方式：

* &#x20;黑产人员：批量扫描查找API Server未授权访问下载恶意镜像进行挖矿。
* &#x20;定向攻击：定向攻击的高级渗透，对整个容器较为了解，进行逃逸、横向移动、获取K8s控制权。

&#x20;

传统数据中心 VS 云容器化基础架构区别

<figure><img src="/files/r2OiUFie2cdTAUaYb4pX" alt=""><figcaption></figcaption></figure>

容器化基本架构

&#x20;

<figure><img src="/files/2zWZTJKMQLZan3XwMydu" alt=""><figcaption></figcaption></figure>

* &#x20;进程提权
* &#x20;特权容器配置不当
* &#x20;管理控制台、弱口令、高危漏洞
* &#x20;API接口、未授权访问、越权

#### Kubernetes攻击面

&#x20;

<figure><img src="/files/iZHfwa8X0p8nSNrOwEuJ" alt=""><figcaption></figcaption></figure>

* &#x20;Pod开放到互联网
* &#x20;Pod对其它Pod或服务开放
* &#x20;从Pod向Node逃逸
* &#x20;从Pod攻击Master Node组件
* &#x20;从Pod攻击API Server
* &#x20;从API Server攻击其它Pods/Nodes
* &#x20;从K8s集群攻击云内的其它服务


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lzcloudsecurity.gitbook.io/yun-an-quan-gong-fang-ru-men/di-liu-zhang-yun-yuan-sheng-gong-fang/kubernetes-chang-jian-gong-ji-fang-shi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
