analyzing-docker-container-forensics

analyzing-docker-container-forensics is a skill for Claude Code from killvxk/cybersecurity-skills-zh. It costs 44 tokens per session (3,642 once invoked), scanned D, original, Apache-2.0.

A procedure for investigating compromised Docker containers by examining their images, filesystem layers, volumes, logs, processes, network connections, and runtime traces. Docker is software that runs applications in isolated containers.

In plain words
What is it for?
Use it during container incident response or security audits. It covers preserving container state, exporting filesystems and logs, inspecting processes and connections, examining image layers, and scanning images for vulnerabilities.
Why use it?
It helps preserve evidence and reconstruct what happened after a container or container host may have been attacked. It also supports checking for malicious images, container escapes, privilege increases, and unsafe configuration.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cybersecurity-skills-zh plugin — 58 skills shipped together

Good fit Use it during container incident response or security audits. It covers preserving container state, exporting filesystems and logs, inspecting processes and connections, examining image layers, and scanning images for vulnerabilities.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/killvxk/cybersecurity-skills-zh/analyzing-docker-container-forensics
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add killvxk/cybersecurity-skills-zh --skill analyzing-docker-container-forensics
Clone the repo
git clone --depth 1 https://github.com/killvxk/cybersecurity-skills-zh

Made for: Claude Code.

Or install cybersecurity-skills-zh, the plugin that ships this one along with the rest of its 58 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyzing-docker-container-forensics

README.md
[![agentmods](https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-docker-container-forensics/github.svg)](https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-docker-container-forensics)
Your own site
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-docker-container-forensics"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-docker-container-forensics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyzing-docker-container-forensics

Your own site · 80×15
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-docker-container-forensics"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-docker-container-forensics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,642 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.03642
Opus 5 $0.00022 $0.01821
Sonnet 5 $0.00009 $0.00728
Haiku 4.5 $0.00004 $0.00364

Measured 9d ago against content hash 92bdc99ce1bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade D, and why

analyzing-docker-container-forensics scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo dpkg -i dive_linux_amd64.deb

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

/root/.ssh/authorized_keys - 已修改(添加了未授权密钥)

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

wget https://github.com/wagoodman/dive/releases/latest/download/dive_linux_amd64.deb
skills/analyzing-docker-container-forensics/SKILL.md · 330 lines

How it starts

The opening of the file, as written. The whole thing — 330 lines — stays where its author put it; the contents beside it link to each section on GitHub.

分析 Docker 容器取证

适用场景

  • 调查受损的 Docker 容器或容器主机时
  • 分析从注册表拉取的恶意 Docker 镜像时
  • 涉及容器化应用程序漏洞的事件响应(Incident Response)期间
  • 检查容器逃逸尝试或权限提升(Privilege Escalation)时
  • 审计容器配置并识别错误配置时

前置条件

  • 取证工作站上的 Docker CLI 访问权限
  • 访问 Docker 主机文件系统(取证镜像或实时系统)
  • 了解 Docker 分层文件系统(overlay2、aufs)
  • 用于镜像分析的 dive、docker-explorer 或 container-diff
  • 了解 Docker 守护进程配置和 socket 安全
  • 用于容器镜像漏洞扫描的 Trivy 或 Grype

工作流程

步骤 1:保全容器状态和证据

# 列出所有容器(包括已停止的)
docker ps -a --no-trunc > /cases/case-2024-001/docker/container_list.txt

# 检查受损容器
CONTAINER_ID="abc123def456"
docker inspect $CONTAINER_ID > /cases/case-2024-001/docker/container_inspect.json

# 将容器文件系统导出为 tarball(保留当前状态)
docker export $CONTAINER_ID > /cases/case-2024-001/docker/container_export.tar

# 从容器当前状态创建镜像
docker commit $CONTAINER_ID forensic-evidence:case-2024-001
docker save forensic-evidence:case-2024-001 > /cases/case-2024-001/docker/container_image.tar

# 捕获容器日志
docker logs $CONTAINER_ID --timestamps > /cases/case-2024-001/docker/container_logs.txt 2>&1

# 捕获运行中的进程(如果容器仍在运行)
docker top $CONTAINER_ID > /cases/case-2024-001/docker/container_processes.txt

# 捕获网络连接
docker exec $CONTAINER_ID netstat -tlnp 2>/dev/null > /cases/case-2024-001/docker/container_network.txt

# 从容器复制特定文件
docker cp $CONTAINER_ID:/var/log/ /cases/case-2024-001/docker/container_var_log/
docker cp $CONTAINER_ID:/tmp/ /cases/case-2024-001/docker/container_tmp/
docker cp $CONTAINER_ID:/etc/passwd /cases/case-2024-001/docker/container_passwd

# 对所有导出证据进行哈希计算
sha256sum /cases/case-2024-001/docker/*.tar > /cases/case-2024-001/docker/evidence_hashes.txt

步骤 2:分析容器镜像层

# 安装 dive 用于镜像层分析
wget https://github.com/wagoodman/dive/releases/latest/download/dive_linux_amd64.deb
sudo dpkg -i dive_linux_amd64.deb

# 交互式分析镜像层
dive forensic-evidence:case-2024-001

# 非交互式层分析
dive forensic-evidence:case-2024-001 --ci --json /cases/case-2024-001/docker/dive_analysis.json

# 提取并检查单个层
mkdir -p /cases/case-2024-001/docker/layers/
tar -xf /cases/case-2024-001/docker/container_image.tar -C /cases/case-2024-001/docker/layers/

# 列出镜像清单和层顺序
cat /cases/case-2024-001/docker/layers/manifest.json | python3 -m json.tool

# 检查每一层的变更
for layer in /cases/case-2024-001/docker/layers/*/layer.tar; do
    echo "=== 层: $(dirname $layer | xargs basename) ==="
    tar -tf "$layer" | head -20
    echo "..."
done

# 使用 container-diff 与原始基础镜像进行比较
# 安装 container-diff
curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64
chmod +x container-diff-linux-amd64

# 将提交的镜像与原始镜像进行比较
./container-diff-linux-amd64 diff daemon://nginx:latest daemon://forensic-evidence:case-2024-001 \
   --type=file --type=apt --type=history --json \
   > /cases/case-2024-001/docker/container_diff.json

Read the full file on GitHub · 330 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 330 lines · 44 tokens per session scan D 92bdc99ce1bb

Subscribe to this mod's changes

analyzing-docker-container-forensics is a skill published in the GitHub repository killvxk/cybersecurity-skills-zh (44 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 3,642 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, reaches for credential files, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.