/cybersec-toolkit:ctf-cryptofrom cybersec-toolkit
Provides a decision tree, attack catalog, and tool ordering for solving CTF cryptography challenges including RSA, AES, classical ciphers, ECC, hash crypto, PRNGs, and unknown ciphertext.
Ships in cybersec-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Pre-flight. Confirm the event rules allow AI assistance (
authorization-gate). Start withsuggest_for_ctforguided_assessment. Commands below are CLI notation: run them withrun_tool/run_pipelineusing registry names (list_tools), andrun_scriptonly for real logic. If policy blocks a command, tell the operator; do not fall back to the client shell. A tool that is not in the registry is a recommendation to the user (approval-gated install), not a bare command.
Tool-first: use suggest_for_ctf("crypto") first, then this checklist for depth.
Crypto work runs out of tools and into arithmetic fast. The installer puts the Python side in a venv the server can hand to scripts:
run_script(code, venv="crypto") # ~/.ctf-venvs/crypto
Contents: pycryptodome (from Crypto...), sympy, gmpy2, numpy, z3,
fpylll (+cysignals), cypari2. Install with
./install.sh --module crypto; check with check_installed("ctf-crypto-venv").
run_script is gated behind CYBERSEC_MCP_ALLOW_SCRIPTS=1 and is off by
default. If a challenge needs solver code, say so and let the user enable it and
restart the server — do not route around the gate with a shell.
SageMath is not installed by default — it is packaged on Debian and Arch but
not in current Ubuntu, Fedora or openSUSE, and the image is 1.4 GB.
--enable-docker pulls sagemath/sagemath:latest. Reach for it only for what the venv cannot do:
Coppersmith with small_roots, Groebner bases, generic curve arithmetic.
run_tool("file", "<input>")
run_pipeline([{"tool": "xxd", "args": "<input>"}, {"tool": "head", "args": "-50"}])
run_pipeline([{"tool": "strings", "args": "<input>"}, {"tool": "head", "args": "-50"}])
.pem, .pub → public key crypto (RSA/ECC)BEGIN CERTIFICATE → x509 — extract pubkey with openssl x509 -in cert -pubkey -nooutExtract n, e, c:
openssl rsa -in pubkey.pem -pubin -text -noout
Then route by what n and e look like:
| Symptom | Attack | Tool |
|---|---|---|
Small e (3, 5), small message | Cube root attack | RsaCtfTool, python3 -c "from gmpy2 import iroot..." |
n factorable on FactorDB | Factor + decrypt | RsaCtfTool --uncipher c -n n -e e |
Two ciphertexts, same n, coprime e | Common modulus | RsaCtfTool --attack commonmodulus |
Multiple users, small e=k, k pubkeys | Håstad broadcast | RsaCtfTool --attack hastads |
Close p and q | Fermat factorization | RsaCtfTool --attack fermat |
Wiener-applicable (d small) | Wiener's | RsaCtfTool --attack wiener |
Partial p known | Coppersmith | sage / RsaCtfTool --attack boneh_durfee |
Same m, two keys | Common plaintext | manual gcd |
Default first move: throw n at FactorDB (run_tool("curl", "http://factordb.com/api?query=<n>")) and at RsaCtfTool with all attacks enabled.
| Symptom | Attack | Tool |
|---|---|---|
| ECB mode (identical blocks) | Block-shuffle / chosen plaintext | manual python with Crypto.Cipher |
| CBC + bit-flipping with padding oracle | Padding oracle | padbuster, custom python |
| CTR/OFB with key reuse | XOR streams (crib drag) | xortool |
| Stream cipher reused key | Crib drag | xortool -l <len> |
| AES-GCM nonce reuse | Forbidden attack | nonce-disrespect (clone if not in registry) |
Candidate tools (not in the registry; recommend an install with approval): ciphey (auto-decode), quipqiup (substitution), dcode.fr (web), cryptii.com (web). For classical/Caesar/Vigenère: try ciphey first.
| Symptom | Attack |
|---|---|
| Length-extension on MD5/SHA1/SHA256 | hash_extender, hashpump |
| Hash with collision (MD5 chosen-prefix) | hashclash |
| Weak hash + known structure | hashcat with mask |
sympy.ntheory for the
factorization, manual CRT recombination)cypari2 for point counting: pari.ellsea(E) runs SEA
in seconds where a generic order algorithm will not finishsmall_roots and Groebner bases have no venv equivalent — that
is the case for the SageMath imageIf you see modular linear equations, low-density knapsacks, or HNP-shaped
problems — build the basis and reduce with fpylll. The pattern: small
unknowns, lots of equations, modular constraint.
from fpylll import IntegerMatrix, LLL
B = IntegerMatrix.from_matrix(rows)
LLL.reduction(B)
Two things that cost hours if you hit them blind:
import fpylll raises ModuleNotFoundError: cysignals unless cysignals is
installed alongside it. fpylll declares no dependencies at all, so pip will
not pull it in. The crypto venv installs both.fractions.Fraction
over the Gram-Schmidt coefficients.<comp>{...} or platform-specific formatUse the writeup-template skill.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub 26zl/cybersec-toolkit --plugin cybersec-toolkit880 skills in this plugin
/acquiring-disk-image-with-dd-and-dcflddCreate forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis./add-toolUse when adding a new cybersecurity tool to this installer. Walks through editing the right module file, adding to tools_config.json, running validators, and syncing MCP server data if needed. Triggers on phrases like "add tool", "add <toolname>", "register a new tool", "include X in the installer"./Other plugins' skills for the same job