mcpField
C
ctf-ai-ml

ctf-ai-ml

github.com/wgpsecSecurity1.8k46 installsUpdated 5d ago
Repository

About ctf-ai-ml

A CTF guide for AI and ML attack techniques, aimed at security challengers. It organizes approaches by model files, classifiers, and LLM targets, and indicates when to switch to other CTF topics.

Key features

  1. 01Model weight analysis and manipulation
  2. 02Adversarial image classifier attacks
  3. 03LLM prompt injection and jailbreaking
  4. 04Decision tree by target type
  5. 05Pointers to related CTF topics

Use cases

  1. 01Analyzing .pt or .safetensors model files
  2. 02Crafting adversarial images
  3. 03Testing chatbot security weaknesses

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wgpsec/aboutsecurity --skill ctf-ai-ml

After installing, type/ctf-ai-mlin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
adversarial-ml.md
llm-attacks.md
model-attacks.md

Details

From the project README

CTF AI/ML Attack Techniques

When to Use

  • Challenge involves ML model files (.pt, .pth, .safetensors, .onnx, .h5)
  • Target is an AI chatbot, LLM-based application, or ML classifier
  • Need to craft adversarial examples to fool image/text classifiers
  • Challenge provides model weights for analysis or manipulation
  • AI/ML platform security testing (model extraction, membership inference)

Quick Start

pip install torch transformers numpy scipy Pillow safetensors scikit-learn
file model.*
python3 -c "import torch; m=torch.load('model.pt'); print(type(m), m.keys() if hasattr(m,'keys') else '')"

Decision Tree

  1. Model weight file (.pt/.safetensors) → model-attacks.md
    • Weight perturbation negation, model inversion, LoRA merging, encoder collision
  2. Image classifier to fool → adversarial-ml.md
    • FGSM, PGD, C&W attacks, adversarial patches, evasion, data poisoning
  3. LLM/chatbot target → llm-attacks.md
    • Prompt injection, jailbreaking, token smuggling, tool use exploitation
  4. Pure math/crypto inside ML → Switch to ctf-crypto
  5. Compiled model binary → Switch to ctf-reverse
  6. Python jail wrapped in chatbot → Switch to ctf-misc

Pivot Signals

  • If challenge is pure cryptography/number theory with no ML → /ctf-crypto
  • If reverse engineering compiled inference binary → /ctf-reverse
  • If Python sandbox escape inside chatbot wrapper → /ctf-misc
  • If web app with AI features (prompt injection via web) → /ai-security/prompt-injection

Comments

Markdown supported