Back to skill

Security audit

CTF Crypto Solver

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent CTF cryptography helper, but it includes highly actionable attack playbooks and live-target examples without clear authorized-use boundaries.

Install only if you intend to use it in authorized CTF, training, or owned lab environments. Do not use its exploit workflows against real services without explicit permission, and run examples in an isolated virtual environment or container; review and pin any packages or repositories before installing them.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/ctf-crypto/prng.md:94
Finding

Arbitrary Code Execution Through Unsafe Deserialization with eval

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/ctf-crypto/SKILL.md:16
Finding

Unpinned Third-Party Package and Repository Installation

Content
View full analysis
**Note:** `gmpy2` requires libgmp — Linux: `apt install libgmp-dev`, macOS: `brew install gmp`. ``` Other affected examples include: ```bash # Python: pip install padding-oracle ``` ```bash # Install: git clone https://github.com/cr-marcstevens/hashclash ``` ```bash pip install roca-detect git clone https://gitlab.com/jix/neca.git ``` ### Technical Analysis The Skill recommends installing Python packages without exact versions or package hashes and cloning repositories without immutable commit identifiers. These commands resolve whatever content the package index, operating-system repository, Homebrew formula, or repository default branch serves at execution time. The named projects and hosts are relevant to CTF cryptanalysis, and the audit found no evidence of deliberate typosquatting or a known malicious package. The risk arises from mutable dependency resolution rather than from a confirmed malicious upstream. A compromised maintainer account, malicious release, repository takeover, dependency confusion event, or ...[truncated 2068 chars]
Remediation
View remediation
--hash=sha256: z3-solver== --hash=sha256: ``` Install with: ```bash python -m pip install --require-hashes -r requirements.txt ``` 2. Pin Git repositories to reviewed commit SHAs: ```bash git clone https://github.com/RsaCtfTool/RsaCtfTool cd RsaCtfTool git checkout --detach ``` Verify signed tags or release checksums where available. 3. Document the exact source, reviewed version, expected checksum, and maintenance date for manually downloaded tools and data files. 4. Install Python dependencies in a dedicated virtual environment and run external CTF tools in a disposable container or virtual machine. 5. Avoid `sudo pip` and minimize privileged package installation. If an operating-system package is necessary, use trusted signed repositories and explicitly document the expected repository origin. 6. Separate required dependencies from optional attack-specific tools. Do not install the entire toolset when only one solver is needed. 7. Add automated dependency scanning and periodic review for pinned releases, repository ownership changes, and known vulnerabilities. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (25)

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · SKILL.md (reported line 26)May include surrounding context.

pylll替代格归约,或装 Sage: Linuxsudo apt install sagemath`;Windows 建议走 WSL。

识别速查

powershell
$PY -c "n=<N>; print('bits=', n.bit_length())"      # RSA 模数位宽
$PY -c "from sympy import factorint; print(factorint(<n>))"  # 小因子?
# 哈希识别:看长度(32=MD5, 40=SHA1, 64=SHA256 hex);hashcat --example-hashes 对照
# XOR 试探
$PY -c "from pwn import xor; print(xor(bytes.fromhex('<hex>'), b'flag{'))"

按体制的攻击清单

RSA(最高频)

  • 小 e + 小消息:直接开 e 次方
  • 共模攻击:同一 m 两个 (n, e) → 扩展欧几里得
  • Wiener:小 d(d < n^0.25 / 3)
  • Fermat:p q 接近
  • Pollard p-1:p-1 光滑
  • Hastad 广播:e 组同明文(含线性填充用 Coppersmith)
  • 已知 phi(n) 的倍数(如 e*d-1):Miller-Rabin 平方根法分解
  • dp/dq/qinv 部分泄露:遍历 k 还原素数
  • 同态性绕过解密预言机:查 c*r^e 再除 r
  • 先跑自动攻击组合:写脚�

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/ctf-crypto/classic-ciphers.md (reported line 317)May include surrounding context.

pylll替代格归约,或装 Sage: Linuxsudo apt install sagemath`;Windows 建议走 WSL。

识别速查

powershell
$PY -c "n=<N>; print('bits=', n.bit_length())"      # RSA 模数位宽
$PY -c "from sympy import factorint; print(factorint(<n>))"  # 小因子?
# 哈希识别:看长度(32=MD5, 40=SHA1, 64=SHA256 hex);hashcat --example-hashes 对照
# XOR 试探
$PY -c "from pwn import xor; print(xor(bytes.fromhex('<hex>'), b'flag{'))"

按体制的攻击清单

RSA(最高频)

  • 小 e + 小消息:直接开 e 次方
  • 共模攻击:同一 m 两个 (n, e) → 扩展欧几里得
  • Wiener:小 d(d < n^0.25 / 3)
  • Fermat:p q 接近
  • Pollard p-1:p-1 光滑
  • Hastad 广播:e 组同明文(含线性填充用 Coppersmith)
  • 已知 phi(n) 的倍数(如 e*d-1):Miller-Rabin 平方根法分解
  • dp/dq/qinv 部分泄露:遍历 k 还原素数
  • 同态性绕过解密预言机:查 c*r^e 再除 r
  • 先跑自动攻击组合:写脚�

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/ctf-crypto/prng.md (reported line 215)May include surrounding context.

pylll替代格归约,或装 Sage: Linuxsudo apt install sagemath`;Windows 建议走 WSL。

识别速查

powershell
$PY -c "n=<N>; print('bits=', n.bit_length())"      # RSA 模数位宽
$PY -c "from sympy import factorint; print(factorint(<n>))"  # 小因子?
# 哈希识别:看长度(32=MD5, 40=SHA1, 64=SHA256 hex);hashcat --example-hashes 对照
# XOR 试探
$PY -c "from pwn import xor; print(xor(bytes.fromhex('<hex>'), b'flag{'))"

按体制的攻击清单

RSA(最高频)

  • 小 e + 小消息:直接开 e 次方
  • 共模攻击:同一 m 两个 (n, e) → 扩展欧几里得
  • Wiener:小 d(d < n^0.25 / 3)
  • Fermat:p q 接近
  • Pollard p-1:p-1 光滑
  • Hastad 广播:e 组同明文(含线性填充用 Coppersmith)
  • 已知 phi(n) 的倍数(如 e*d-1):Miller-Rabin 平方根法分解
  • dp/dq/qinv 部分泄露:遍历 k 还原素数
  • 同态性绕过解密预言机:查 c*r^e 再除 r
  • 先跑自动攻击组合:写脚�

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/ctf-crypto/SKILL.md (reported line 81)May include surrounding context.

nds

bash
# Identify cipher type
python3 -c "from Crypto.Util.number import *; n=<N>; print(f'bits={n.bit_length()}')"

# RSA quick check
python3 -c "from sympy import factorint; print(factorint(<n>))"  # Small factors?
openssl rsa -pubin -in key.pub -text -noout  # Extract n, e from PEM

# Quick factorization tools
python3 RsaCtfTool.py -n <n> -e <e> --uncipher <c>

# XOR analysis
python3 -c "from pwn import xor; print(xor(bytes.fromhex('<hex>'), b'flag{'))"

# Hash identification
hashid '<hash>'
hashcat --identify '<hash>'

# SageMath (for lattice/ECC)
sage -c "print(factor(<n>))"

Classic Ciphers

  • Caesar: Frequency analysis or brute force 26 keys
  • Vigenere: Known plaintext attack with flag format prefix; derive key from (ct - pt) mod 26. Kasiski examination for unknown key length (GCD of repeated sequence distances)
  • Atbash: A<->Z substitution; look for "Abashed" hints in challenge name
  • Substitution wheel: Brute force all rotations of inner/outer al

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
91% confidence
Finding

The snippet imports pwntools and provides a working remote oracle client that automates AES-ECB byte-at-a-time secret extraction against a live service. Even though framed as a CTF technique, this is directly transferable to real-world exploitation of vulnerable encryption oracles and materially lowers the barrier to abuse.

Content

Scanner excerpt · references/ctf-crypto/modern-ciphers-2.md (reported line 335)May include surrounding context.

Byte-at-a-Time Chosen Plaintext (ABCTF 2016)

Pattern (Encryption Service): Server encrypts user_input || secret_suffix under AES-ECB. Recover the secret suffix one byte at a time by controlling the input length.

  1. Send inputs of decreasing length to push one unknown byte into a known block position
  2. For each position, try all 256 byte values and compare the encrypted block:
python
from pwn import *
import cryptanalib as ca  # FeatherDuster's cryptanalib

def oracle(pt):
    """Send plaintext, receive ECB-encrypted ciphertext."""
    r = remote('target', 7765)
    r.recvuntil('Send me some hex-encoded data to encrypt:\n')
    r.sendline(pt.hex())
    r.recvuntil('Here you go:')
    ct = bytes.fromhex(r.recvline().strip().decode())
    r.close()
    return ct

# Automated byte-at-a-time recovery
flag = ca.ecb_cpa_decrypt(oracle, block_size=16, verbose=True)
print(flag)

Manual approach without library:

python
block_size = 16
known = b''

for i in range(len(secr

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
91% confidence
Finding

The from pwn import * import is a strong indicator of exploit-development tooling and appears inside a working padding-oracle exploitation example. While not harmful by itself, in this skill it reinforces that the content is meant to operationalize attacks, making misuse easier when surfaced by an agent to users targeting real systems.

Content

Scanner excerpt · references/ctf-crypto/modern-ciphers.md (reported line 293)May include surrounding context.

signing) makes them trivially forgeable. Always check if the MAC has the property: knowing the secret components lets you compute valid signatures for arbitrary inputs.


CBC Padding Oracle Attack

Pattern: Server reveals whether CBC-mode ciphertext has valid PKCS#7 padding (via error messages, timing, or status codes). Decrypt any ciphertext block-by-block without the key.

python
from pwn import *

def padding_oracle(iv, ct):
    """Returns True if server accepts padding."""
    resp = requests.post(URL, data={'iv': iv.hex(), 'ct': ct.hex()})
    return 'padding' not in resp.text.lower()  # or check status code

def decrypt_block(prev_block, target_block):
    """Decrypt one 16-byte block using padding oracle."""
    intermediate = bytearray(16)
    plaintext = bytearray(16)

    for byte_pos in range(15, -1, -1):
        pad_val = 16 - byte_pos
        # Set already-known bytes to produce correct padding
        crafted = bytearray(16)
        for k in range(byte_pos

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt · references/ctf-crypto/rsa-attacks-2.md (reported line 489)May include surrounding context.

Now pow(signature, 1, n) == PKCS1_pad(message)

text

**Key insight:** When the verifier accepts user-supplied public key parameters without constraints, setting `e=1` makes modular exponentiation trivial. Choose `n` such that `signature mod n` equals the expected padded hash.

---

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 17)May include surrounding context.

md
- **hashcat**:哈希爆破;字典建议 rockyou(Kali 自带 `/usr/share/wordlists/`)。
- **SageMath(可选)**:格攻击与高级数论(Coppersmith、离散对数)。
  本机没有时用 `pip install fpylll` 替代格归约,或装 Sage:
  Linux `sudo apt install sagemath`;Windows 建议走 WSL。

## 识别速查

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is an operational playbook for exploiting cryptographic weaknesses, including padding oracles, nonce reuse, forgery, and decryption-oracle abuse, and it provides no boundary limiting use to authorized CTF environments. In context, this materially increases the chance the skill will be used against real services or to facilitate unauthorized access, not just educational analysis.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown section instructs the user to repeatedly query a server 1000 times to recover protected data, including importing requests, but provides no warning that the technique sends automated requests to an external system. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect privacy or system integrity; high-volume remote interaction should be disclosed.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is a catalog of offensive cryptographic attack patterns with procedural guidance and code snippets, but it lacks any limiting context, warning banner, or authorization-only framing near the top. In a reusable agent skill, this increases the chance the material is operationalized for unauthorized exploitation rather than confined to CTF or defensive research.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file includes actionable exploit instructions that modify encrypted commands to achieve command injection and later forges privileged cookies, but it does not include any warning that these techniques must only be used in authorized CTF or lab contexts. Under the markdown-specific warning rule, the description omits user-facing safety guidance about behaviors that could affect system integrity or unauthorized access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file is an offensive crypto attack playbook containing concrete exploitation steps, forgery techniques, oracle abuse workflows, and tool references across many real attack classes. In the context of an agent skill, packaging this material without clear authorization boundaries, safety constraints, or anti-abuse guidance increases the likelihood the agent will assist with unauthorized exploitation rather than purely educational CTF use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file includes procedural guidance for predicting DSA nonce values and deriving a private key, as well as several other exploitation-oriented PRNG attacks, but it does not warn readers that these actions can compromise accounts, secrets, or remote services. Under the markdown-file criteria for SQP-2, descriptions of behaviors that can affect user data, privacy, or system integrity should include warnings, and none are present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section gives step-by-step instructions to recover PRNG state, predict password reset tokens, and forge a live reset URL. Even though framed as CTF material, the technique directly maps to real-world account takeover scenarios when insecure token generation is used, and the document provides no authorization or safety boundary warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This section provides operational password cracking strategy, wordlist/rules guidance, and target-pattern suggestions without clear authorization constraints. In a general-purpose agent skill, that materially increases misuse potential for credential attacks against real accounts and services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file is an extensive catalog of practical RSA attack techniques, including exploit conditions, code snippets, and operational steps for signature forgery, decryption-oracle abuse, fault attacks, timing attacks, and modulus/key recovery. In the context of an agent skill, this materially increases the chance the agent can generate offensive exploit guidance without any embedded safety framing, authorization boundary, or limitation to defensive/educational use.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/ctf-crypto/rsa-attacks-2.md (reported line 63)May include surrounding context.

flag = pow(c, real_d, n)

text

**Key insight:** `phi(p^2) = p*(p-1)`, NOT `(p-1)^2`. When a server validates RSA parameters but uses `(p-1)*(q-1)` without checking `p != q`, setting `p=q` creates a working key that the server will miscompute the private exponent for, causing decryption failure and error-path data leakage.

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file contains detailed, actionable offensive cryptographic attack procedures, including code and exploitation workflows for RSA weaknesses, padding oracles, timing oracles, signature forgery, and related attacks, but it provides no clear limitation to authorized, educational, or CTF-only use. Although the surrounding skill metadata suggests a CTF helper, the content is directly reusable against real systems, so the absence of scope warnings and guardrails increases misuse risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This section gives concrete, operational instructions for exploiting a race condition against remote endpoints, including cache-busting, synchronization, and parallel request flooding, without any authorization or safety boundary warning. In a reusable agent skill, that materially lowers the barrier to performing active attacks on live services, even if framed as CTF guidance.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The sample code performs live HTTP POST requests and is embedded in an exploitation recipe for sending approximately 80 synchronized requests to a target service. Although presented as an example, it is directly usable for active attack traffic generation against remote systems and therefore increases the operational risk of the skill.

Content

Scanner excerpt · references/ctf-crypto/zkp-and-advanced.md (reported line 190)May include surrounding context.

md
def make_request(barrier, modified_sig):
    barrier.wait()  # Synchronize all processes
    requests.post(url, json={"sig": modified_sig})

# Launch 80 processes with unique signature modifications
processes = [Process(target=make_request, args=(barrier, modify_sig(i))) for i in range(80)]

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes package and system installation commands (pip install, apt install, brew install, git clone) without an explicit warning that they modify the local environment and may fetch untrusted third-party code. In an agent/tooling context, this can lead to unintended environment changes, dependency pollution, or execution of attacker-influenced packages if the commands are followed automatically or without review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file includes an example that reads an encrypted file and writes a decrypted output file (flag.png) to disk. While the behavior is visible in the code snippet, the surrounding documentation does not explicitly warn users that running the example will create or overwrite local files, which is the kind of user disclosure expected for markdown content describing data-affecting operations.

Content

No source excerpt is available for this finding.