Back to skill

Security audit

Ctf Crypto

Security checks for vulnerabilities and agentic risk

Overview

This is a transparent CTF cryptography reference, but it includes directly reusable account-token, password-cracking, request-flooding, and unsafe install/code examples without enough authorization or isolation boundaries.

Install only if you intend to use it for authorized CTFs, labs, or systems you own or are explicitly allowed to test. Run its tools in a disposable virtual environment or container, review any target-facing requests before execution, avoid using it against real accounts or services without permission, and pin or verify external dependencies 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
prng.md:94
Finding

Arbitrary Code Execution Through Unsafe Evaluation of External Data

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:17
Finding

Unpinned Python Dependencies Installed From Mutable Package Releases

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:32
Finding

RsaCtfTool Retrieved From an Unpinned Git Repository

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
modern-ciphers-2.md:503
Finding

HashClash Retrieved From an Unpinned Git Repository

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

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 78)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
80% confidence
Finding

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

Content

Scanner excerpt · classic-ciphers.md (reported line 312)May include surrounding context.

bc.so.6') for system libc

Seed at the same second as the binary starts

libc.srand(int(time()))

Generate the same sequence as the binary's rand() calls

for i in range(16): value = libc.rand() & 0xff # match binary's truncation (e.g., & 0xff for byte) print(value)

text

**Decrypting XOR-encrypted data (L3akCTF 2024 chonccfile):**
```python
from ctypes import CDLL
from time import time
from pwn import u32, p32

libc_imp = CDLL('./libc.so.6')
libc_imp.srand(int(time()))

# Binary XORs each 4-byte block with rand() output
encrypted_data = b'...'  # read from heap/memory
result = b''
for i in range(0, len(encrypted_data), 4):
    block = u32(encrypted_data[i:i+4])
    libc_imp.rand()       # skip delay-related rand() call if binary does extra calls
    key = libc_imp.rand()
    block ^= key
    result += p32(block)

Timing considerations:

  • time(NULL) has 1-second granularity — start the exploit within the same second as the binary
  • Remote targets may have startup

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 · modern-ciphers-2.md (reported line 339)May include surrounding context.

bc.so.6') for system libc

Seed at the same second as the binary starts

libc.srand(int(time()))

Generate the same sequence as the binary's rand() calls

for i in range(16): value = libc.rand() & 0xff # match binary's truncation (e.g., & 0xff for byte) print(value)

text

**Decrypting XOR-encrypted data (L3akCTF 2024 chonccfile):**
```python
from ctypes import CDLL
from time import time
from pwn import u32, p32

libc_imp = CDLL('./libc.so.6')
libc_imp.srand(int(time()))

# Binary XORs each 4-byte block with rand() output
encrypted_data = b'...'  # read from heap/memory
result = b''
for i in range(0, len(encrypted_data), 4):
    block = u32(encrypted_data[i:i+4])
    libc_imp.rand()       # skip delay-related rand() call if binary does extra calls
    key = libc_imp.rand()
    block ^= key
    result += p32(block)

Timing considerations:

  • time(NULL) has 1-second granularity — start the exploit within the same second as the binary
  • Remote targets may have startup

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 · modern-ciphers.md (reported line 288)May include surrounding context.

bc.so.6') for system libc

Seed at the same second as the binary starts

libc.srand(int(time()))

Generate the same sequence as the binary's rand() calls

for i in range(16): value = libc.rand() & 0xff # match binary's truncation (e.g., & 0xff for byte) print(value)

text

**Decrypting XOR-encrypted data (L3akCTF 2024 chonccfile):**
```python
from ctypes import CDLL
from time import time
from pwn import u32, p32

libc_imp = CDLL('./libc.so.6')
libc_imp.srand(int(time()))

# Binary XORs each 4-byte block with rand() output
encrypted_data = b'...'  # read from heap/memory
result = b''
for i in range(0, len(encrypted_data), 4):
    block = u32(encrypted_data[i:i+4])
    libc_imp.rand()       # skip delay-related rand() call if binary does extra calls
    key = libc_imp.rand()
    block ^= key
    result += p32(block)

Timing considerations:

  • time(NULL) has 1-second granularity — start the exploit within the same second as the binary
  • Remote targets may have startup

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 · prng.md (reported line 213)May include surrounding context.

bc.so.6') for system libc

Seed at the same second as the binary starts

libc.srand(int(time()))

Generate the same sequence as the binary's rand() calls

for i in range(16): value = libc.rand() & 0xff # match binary's truncation (e.g., & 0xff for byte) print(value)

text

**Decrypting XOR-encrypted data (L3akCTF 2024 chonccfile):**
```python
from ctypes import CDLL
from time import time
from pwn import u32, p32

libc_imp = CDLL('./libc.so.6')
libc_imp.srand(int(time()))

# Binary XORs each 4-byte block with rand() output
encrypted_data = b'...'  # read from heap/memory
result = b''
for i in range(0, len(encrypted_data), 4):
    block = u32(encrypted_data[i:i+4])
    libc_imp.rand()       # skip delay-related rand() call if binary does extra calls
    key = libc_imp.rand()
    block ^= key
    result += p32(block)

Timing considerations:

  • time(NULL) has 1-second granularity — start the exploit within the same second as the binary
  • Remote targets may have startup

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent/user to run package-manager and system installation commands (pip, apt, brew, git clone) that modify the local environment, but it provides no warning, consent gate, or safer alternative. In an agent context with Bash and internet access, this can lead to unreviewed software installation, dependency drift, and execution of third-party code, increasing supply-chain and environment-integrity risk.

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.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The heading and prose claim an ECC public-key weakness, but the code operates on key.n, factors moduli into p and q, and describes decryption with recovered factors—behavior characteristic of RSA modulus compromise, not standard ECC public keys. This is an active contradiction between the documentation and what the example code does.

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
98% confidence
Finding

This section gives concrete instructions for predicting password reset tokens on a live server by recovering Python MT state from exposed random outputs and forging a reset URL. Even though framed as CTF content, it is directly transferable to real systems and lacks any warning that such actions must be limited to authorized environments, increasing misuse risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The password cracking section provides practical attack sequencing, candidate patterns, and Hashcat modes without any boundary-setting on authorization or the risk of exposing real user credentials. In a skill intended for operational use, this lowers friction for credential attacks outside sanctioned challenge environments.

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 · rsa-attacks-2.md (reported line 46)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.

---

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · 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)]

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This document is titled and organized as an elliptic-curve attacks reference, but substantial sections cover plain DSA nonce-reuse, DSA limited-k brute force, and MD5-collision-based DSA key recovery, which are not elliptic-curve attacks. While still broadly cryptographic and arguably within the overall skill manifest, they do not match this file's claimed ECC-specific scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Most of the file is explanatory text and mathematical example code, but this section introduces direct local process execution via subprocess.run to invoke fastcoll. Spawning external binaries is a materially different capability than documenting or illustrating crypto attack techniques, and it is not clearly warranted by the skill's stated reference-style purpose.

Content

No source excerpt is available for this finding.