Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/yoraexe-ctf-crypto-prng
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: finance
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/ctf-crypto-prng
What's inside
- Skill name
ctf-crypto-prng- Description
- CTF PRNG attacks. Mersenne Twister state recovery, time-seeded PRNG brute force, LCG parameter recovery, V8 Math.random XorShift128+ Z3 solver, GF(2) matrix approach. Triggers: 'prng attack', 'mersenne twister', 'random seed', 'predictable random', 'lcg attack', 'math.random crack', 'random state recovery', 'prng prediction', 'twister untemper'.
- License
- MIT
- Instructions
- 250 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# CTF Crypto — PRNG Attacks
Mersenne Twister state recovery, time-seeded brute force, LCG, V8 Math.random.
---
## Phase 1: Identify PRNG Type
```python
# Python random (Mersenne Twister):
import random
# Generated: random.random(), random.randint(), random.choice()
# Internal state: 624 32-bit integers
# C rand() (LCG):
# state = state * 1103515245 + 12345
# output = (state >> 16) & 0x7fff
# JavaScript Math.random (V8 XorShift128+):
# 128-bit state, outputs doubles
# Custom PRNG (identify from source):
# LCG: x[n+1] = (a*x[n] + c) mod m
# LFSR: shift register with XOR taps
```
---
## Phase 2: Mersenne Twister State Recovery
```python
# Need: 624 consecutive 32-bit outputs (from random.getrandbits(32))
def untemper(y):
"""Reverse the Mersenne Twister temper operation."""
# Inverse of y ^= y >> 18:
y ^= y >> 18
# Inverse of y ^= (y << 15) & 0xefc60000:
y ^= (y << 15) & 0xefc60000
# Inverse of y ^= (y << 7) & 0x9d2c5680:
y ^= (y << 7) & 0x9d2c5680
y ^= (y << 14) & (0x9d2c5680 & (0x9d2c5680 << 7))
# Inverse of y ^= y >> 11:
y ^= y >> 11
y ^= y >> 22
return y & 0xFFFFFFFF
# Collect 624 outputs from target:
outputs = [int(input(f"Output {i}: "), 16) for i in range(624)]
# Recover internal state:
state = [untemper(y) for y in outputs]
# Reconstruct random module state:
import random
# Inject recovered state:
state_formatted = [3, *state, 624]
random.setstate((3, tuple(state_formatted), None))
# Now predict all future outputs:
print("Next:", random.getrandbits(32))
print("Next:", random.getrandbits(32))
```
---
## Phase 3: Time-Seeded PRNG Brute Force
```python
import random, time, ctypes
# UNIX timestamp seeded:
TARGET_TOKENS = [...] # observed tokens from target
def crack_seed_unix(tokens, window=3600):
"""Try timestamps in a window around now."""
now = int(time.time())
for seed in range(now - window, now + 1):
random.seed(seed)
candidate_tokens = [random.randint(0, 2**32) for _ in range(len(tokens))]
if candidate_tokens == tokens:
print(f"Seed: {seed} (unix timestamp)")
return seed
return None
# C rand() seeded (use ctypes to sync with libc):
libc = ctypes.CDLL("libc.so.6")
def crack_c_rand(target_values, window=3600):
now = int(time.time())
for seed in range(now - window, now + 1):
libc.srand(seed)
candidates = [libc.rand() for _ in range(len(target_values))]
if candidates == target_values:
print(f"C rand() seed: {seed}")
return seed
# Millisecond precision from file metadata:
import os
stat = os.stat("generated_file.txt")
mtime_ms = int(stat.st_mtime * 1000)
for seed in range(mtime_ms - 100, mtime_ms + 100):
random.seed(seed)
# test...
```
---
## Phase 4: LCG Parameter Recovery
```python
# LCG: x[n+1] = (a * x[n] + c) mod m
# Given several consecutive outputs, recover a, c, m
def recover_lcg(outputs):From Yoraexe/ceobe, MIT.
More from Yoraexe/ceobe
- 0.502score
codex-qa
Yoraexe
QA the omo Codex Light edition (lazycodex / packages/omop-codex) itself, in strict isolation so ONLY our plugin is exercised, never the user's real ~/.codex.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-android
Yoraexe
CTF Android challenge analysis.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-advanced-math
Yoraexe
CTF advanced math crypto.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-classic
Yoraexe
CTF classic cipher attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-ecc
Yoraexe
CTF ECC attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-modern
Yoraexe
CTF modern cipher attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-rsa
Yoraexe
CTF RSA cryptography attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ad-attacks
Yoraexe
Active Directory credential attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-exotic
Yoraexe
CTF exotic cryptography attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
blue-ir
Yoraexe
Blue team incident response skill.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
blue-detect
Yoraexe
Blue team detection skill.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
blue-forensics
Yoraexe
Blue team forensics skill.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Jul 17, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Yoraexe/ceobe
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Yoraexe
- 0.502score
codex-qa
Yoraexe
QA the omo Codex Light edition (lazycodex / packages/omop-codex) itself, in strict isolation so ONLY our plugin is exercised, never the user's real ~/.codex.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-classic
Yoraexe
CTF classic cipher attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-advanced-math
Yoraexe
CTF advanced math crypto.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-android
Yoraexe
CTF Android challenge analysis.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ad-attacks
Yoraexe
Active Directory credential attacks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
ctf-crypto-ecc
Yoraexe
CTF ECC attacks.
SkillCFreshness: C★ 1Claude Code +9
Cite this page
ctf-crypto-prng skill. Agent Mart. https://agentmart.dev/skills/yoraexe-ctf-crypto-prng (last updated 2026-10-24)