$ cat writeup.md…
$ cat writeup.md…
uiuctf2026
Task: paste a Java class over ncat --ssl; a CNN malicious-code classifier must score <0.1, then the code runs under a strict Java 8 SecurityManager. Solution: evade the max-pool CNN by Base64-chunking and whitespace-spreading all sensitive tokens, then escape the sandbox by nulling java.lang.System.security via the reflection-field-filter bypass Class.getDeclaredFields0.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Java Sandbox Runner. Paste a Java class over
ncat --ssl <host> 1337, terminated by a lineDONE. The server runs the source through an ML "malicious code detector" before compiling and running it under a SecurityManager. Read/flag.
Two independent gates must be beaten in a single submission:
sigmoid(logit) < 0.1.UserClass.run() under a restrictive Java 8 SecurityManager that blocks every direct file read. Goal: read /flag (root-owned).Connection: ncat --ssl jail-<id>.chal.uiuc.tf 1337 (kCTF/nsjail instance, PoW disabled, per-session hostname).
main.py + model.py)main.py reads source lines until DONE, then:
source_tensor = torch.tensor(list(source.encode("utf8"))).unsqueeze(0) logits = model(source_tensor) if torch.sigmoid(logits) >= 0.1: print("malicious code detected"); exit()
MaliciousDetection architecture (model.py):
nn.Embedding(257, 32, padding_idx=256) — each source byte becomes a 32-dim vector.Conv1d over the embedding, kernel sizes 3, 5, 10, 20 → ReLU.AdaptiveMaxPool1d(1) on each — a global max over all sequence positions.Dropout → Linear(256, 1) → logit.Critical property: because of the global AdaptiveMaxPool1d(1), the score is driven by the single strongest n-gram activation anywhere in the source. Adding benign padding or comments cannot lower the peak. To reduce the score you must physically remove the triggering byte n-grams.
Empirical scoring (via score.py / ablate2.py):
...
$ grep --similar