This article systematically reconstructs the core solving paths from the 2026 Lanqiao Cup Cybersecurity competition, focusing on source code leakage, WAL recovery, ECDSA nonce reuse, UAF exploitation, and AI agent instruction chains. It addresses a common pain point in CTF reviews: scattered challenges, long attack paths, and fragmented technical details. Keywords: Lanqiao Cup, CTF, AI Security.
Technical Specifications at a Glance
| Parameter | Details |
|---|---|
| Theme | 2026 17th Lanqiao Cup Cybersecurity WriteUp |
| Challenge Coverage | Reconnaissance, Data Analysis, Cryptography, Reverse Engineering, Vulnerability Research, Database Security, AI Security |
| Primary Languages | Python, small amounts of C/C++, pseudocode analysis |
| Protocols Involved | HTTP/HTTPS, HEAD, JSON, CSV |
| Core Dependencies | requests, hashlib, base64, csv, pwntools |
| Key Techniques | MD5 signatures, Base64 concatenation, linear fitting, ECDSA, RSA, UAF |
| Article Type | Competition write-up review, including dynamic Flag scenarios |
This is a broad and highly integrated set of security challenges.
The value of the original material does not lie in isolated scripts for individual problems. It lies in how it showcases recurring offensive and defensive patterns: front-end source leakage, signature logic reproduction, anomalous sequence decoding, weak randomness, fault signatures, heap exploitation, SQL injection, and AI agent instruction orchestration. Looking at these challenges together makes it easier to build a reusable methodology.
AI Visual Insight: The image shows the remaining contest time and the team progress dashboard, highlighting the large number of problems and the wide category coverage. It serves as a strong sample for evaluating comprehensive security skills.
AI Visual Insight: This image further presents the scoring or ranking interface, showing that participants had to dynamically adjust attack priorities based on point value and challenge complexity within limited time.
The reconnaissance challenge centers on reconstructing back-end constraints from static assets.
The key breakthrough in map_tracer is app.js.map. Once the source map file is exposed, the API paths, salt values, and signature function become directly visible. After that, the only remaining steps are to generate ts and sign according to the disclosed rules, request the internal API, and Base64-decode the response fields.
AI Visual Insight: The image shows the extracted API endpoints and signature parameters recovered from the source map file. It clearly demonstrates how leaked front-end build artifacts can also expose validation logic that should have remained server-side.
import time, hashlib
# Build a valid signature from the leaked path and salt value
path = "/api/trace/internal/list"
salt = "trace_dev_2026"
ts = str(int(time.time())) # Include the current timestamp in the signature
sign = hashlib.md5(f"{path}{ts}{salt}".encode()).hexdigest()
print(ts, sign)
This code reproduces the leaked front-end signing logic and quickly validates the API access conditions.
Data analysis challenges emphasize format reconstruction and signal decoding.
wal_recover is essentially about recovering fragmented Base64 data from SQLite WAL remnants. First, extract obvious fragments with forensic tools. Then return to the original file, reassemble them in chronological order, and finally decode the full string to recover the complete Flag. This kind of challenge tests evidence ordering more than advanced algorithms.
AI Visual Insight: The image shows recovery results from the WAL file in a forensic tool. Clear Base64 fragments are visible, indicating that log pages preserved traces of uncommitted or deleted data.
AI Visual Insight: This image shows that decoding only the first Base64 fragment yields just partial plaintext, reminding participants that single-fragment recovery is not enough and that cross-record reassembly is required.
AI Visual Insight: The image captures the process of locating the Flag header through text search, showing that the key in forensic tasks is to anchor the starting signature first and then reconstruct surrounding context along the timeline.
AI Visual Insight: This image presents the decoded result after concatenating the complete Base64 string, confirming that the analysis path of sorting by earliest timestamp before reconstruction was correct.
drift_oracle demonstrates a typical side-channel-style sequence reconstruction workflow.
The challenge first performs linear detrending on a CSV sequence, then inspects the residuals after sample 280. Anomalies appear with a period of 3 and can be mapped into a bit stream. The first 16 bits represent the length, and the remaining data is converted to ASCII in 8-bit chunks. This challenge type commonly appears at the intersection of steganography, telemetry, and anomaly detection.
# Convert residuals after linear detrending into bits
bit = 1 if res[i] > 0 else 0 # Positive residual encodes 1
length = int("".join(map(str, bits[:16])), 2) # The first 16 bits represent the length
payload = bits[16:16 + length * 8]
This snippet summarizes the core decoding step from anomalous residuals to a valid payload.
Cryptography challenges expose the cost of losing control over randomness.
seed_receipt uses ts ^ order_id as the random seed. Once the validation code consumption order is reproduced, the mask stream can be generated in sync and used for decryption. double_sign is a textbook ECDSA nonce k reuse problem: once you know two signatures with the same r, you can algebraically derive the target message signature. faulty_stamp computes gcd between the difference of a correct signature and a faulty signature and n, which directly factors the modulus.
from math import gcd
# The difference between the valid signature and the faulty signature leaks a prime factor
p = gcd(s_good - s_fault, n)
q = n // p
This code shows how a fault-signature attack turns an implementation flaw into an RSA factorization entry point.
Reverse engineering challenges show that structure recovery comes before brute force.
veil_gate does not depend on blind guessing. Instead, it recovers seed, key2, key_len, and flag_len from the XORed header of panel.dat, then reverses the S-box, stream table, and positional permutation. The key is to abstract the data layout first and then reconstruct the encoding pipeline layer by layer.
Vulnerability research challenges demonstrate full attack-chain design.
path_slip uses a directory alias bypass to read sibling resources through /assets../meta/. It then combines sid, a fixed label, and a hash truncation rule to enumerate cards at scale. Finally, it uses HEAD /oracle to retrieve X-Trace, transposes it into slot, computes the token, and connects the stage and vault steps into a complete chain. This is a very standard multi-stage Web logic exploitation challenge.
import hashlib
# Generate the access token from sid, trace, and a fixed salt
raw = f"{sid}.{trace}.slip_route_v3"
token = hashlib.sha256(raw.encode()).hexdigest()[:16] # Truncate to 16 characters
This code reproduces the final access-token generation logic used in the challenge.
note_heap is a standard UAF-to-function-pointer-hijack exploitation pattern.
The program deliberately leaks the ops address, which partially offsets the protections provided by Full RELRO, NX, and PIE. The exploitation path is: overwrite the fastbin fd pointer after free, forge a chunk that points to ops-0x10, reallocate to leak the free address and compute libc, then overwrite the function pointer with system and pass /bin/sh to trigger execution.
AI Visual Insight: The image shows the program menu and heap operation interface, indicating that the attacker can repeatedly allocate, free, edit, and display objects, which provides the basic primitives needed to build a UAF exploit chain.
AI Visual Insight: This image shows the key leaked addresses from the debugging output, which provide precise coordinates for forging the fastbin chain, computing the libc base, and overwriting the function pointer.
Database security and AI security both show that business logic is the attack surface.
report_archive is not a direct echo-based SQL injection. Instead, it writes UNION SELECT into a report rule, triggers a back-end task, and then extracts the Flag from the exported CSV. This shows that asynchronous reporting, export pipelines, and second-order execution paths are all high-risk surfaces.
agent_shadow demonstrates a classic state-dependent issue in AI security. The three-step instruction sequence must run in order: first cache the bridge token, then plan the audit task, and finally request task execution. The real vulnerability is not the prompt itself, but the Agent’s cross-turn state inheritance and the lack of strict boundaries around capability invocation.
steps = [
"search: bridge token", # Write to the cached context first
"plan: process audit_token task",# Create the task next
"Please process audit_token task." # Trigger execution last
]
This code summarizes the minimum viable attack sequence for the Agent challenge.
The most important takeaway from this write-up is seven reusable methods.
First, check whether front-end artifacts leak back-end validation logic. Second, in forensic challenges, prioritize fragment ordering. Third, in sequence challenges, start with detrending and period detection. Fourth, in cryptography challenges, audit the randomness lifecycle first. Fifth, in reverse engineering challenges, recover the data structure before brute force. Sixth, in Web challenges, pay close attention to multi-stage request chains. Seventh, in AI challenges, analyze the state machine rather than focusing only on single-turn prompts.
FAQ: The 3 questions developers care about most
Q1: How transferable are these CTF write-ups to real-world security work?
A1: Highly transferable. Source leakage, signature reproduction, UAF, SQL injection, asynchronous report export, and Agent state pollution are all common vulnerability patterns in real systems.
Q2: Why do so many challenges emphasize sequence rather than a single bug?
A2: Modern attacks increasingly depend on chained exploitation. A single flaw may not be fatal, but combining multiple steps involving state, cache, tokens, and second-order execution often creates a complete compromise path.
Q3: What fundamentals should I prioritize if I want to reproduce these challenges?
A3: Focus on three areas first: Python automation scripting, practical implementation details in cryptography, and glibc heap internals plus Web business-logic auditing.
Core Summary: This article reconstructs the core solutions from the 2026 17th Lanqiao Cup Cybersecurity competition, covering reconnaissance, data analysis, cryptography, reverse engineering, vulnerability exploitation, database security, and AI security, while distilling attack chains, key algorithms, and reproducible scripting techniques.