DROPDOWN QUAKE HUD // TACTICAL SHELL
AUKA CTF Writeup Vault — Quake HUD Shell v3.1
Type 'help' for tactical commands or 'ls' to list catalog.
studio@vault:~$
AUKACTFVAULT._.
MISSION WRITEUP ID: cylab-mind-your-ps-and-qsPublished: 2026-08-10 by AUKA

Mind your Ps and Qs: RSA Small Modulus Factorization

Factorizing a small RSA modulus N to recover prime factors p and q, computing the private exponent d, and decrypting the ciphertext.

Target Mission Dossier
CryptoMedium
Target Host / IP
Offline Challenge File
Operating System
N/A
Architecture
N/A
Primary Vulnerability
Insufficient Key Size (RSA Small Modulus)
Exposed Services:Mathematical Analysis
Attack Kill Chain Progress1 / 4 Steps
01

Phase 1: RSA Parameter Extraction

We are provided with a text file `values` containing the standard RSA public parameters and ciphertext:

studio@pwnbox:~/cylab-mind-your-ps-and-qs$
# View the challenge values:
cat values

# c: 15341890103764929939105506004034128738090325640037083301857608662849501626260517
# n: 948406957756830799684818171639547165784816468744946013083947881743680617123566349
# e: 65537
02

Phase 2: Modulus Factorization via FactorDB

The modulus `n` is approximately 81 digits (around 270 bits), which is trivial to factor using public databases like FactorDB or Pollard's rho algorithm. Querying FactorDB yields the two prime factors `p` and `q`.

studio@pwnbox:~/cylab-mind-your-ps-and-qs$
#!/usr/bin/env python3
import gmpy2
from Crypto.Util.number import long_to_bytes

# Given parameters:
c = 15341890103764929939105506004034128738090325640037083301857608662849501626260517
n = 948406957756830799684818171639547165784816468744946013083947881743680617123566349
e = 65537

# Factoring n into p and q:
# FactorDB gives:
# p = 3058514107386047717478058223681474982687
# q = 3100874999127211910246369701449601283767
03

Phase 3: Private Key Derivation & Decryption

Using `p` and `q`, we compute Euler's totient `phi = (p-1)*(q-1)`, find the modular multiplicative inverse `d = pow(e, -1, phi)`, and decrypt `m = pow(c, d, n)`.

studio@pwnbox:~/cylab-mind-your-ps-and-qs$
#!/usr/bin/env python3
from Crypto.Util.number import inverse, long_to_bytes

p = 3058514107386047717478058223681474982687
q = 3100874999127211910246369701449601283767
c = 15341890103764929939105506004034128738090325640037083301857608662849501626260517
e = 65537
n = p * q

phi = (p - 1) * (q - 1)
d = inverse(e, phi)
m = pow(c, d, n)

flag = long_to_bytes(m)
print("[+] Decrypted Flag:", flag.decode('utf-8', errors='ignore'))
04

Phase 4: Flag Verification

Executing the script recovers the plaintext flag:

studio@pwnbox:~/cylab-mind-your-ps-and-qs$
Flag: [REDACTED - Click "Reveal Flag" below]

Final Target Proof of Compromise

Target Root Capture Flag
STUDIO{pwn3d_fl4g_h1dd3n_h3x_00000}
AUKA CTF Writeup Vault — Official Field Handbook
[ Open Terminal Shell ]•[ Back to Top ]