So, CubeCTF 2026 had some interesting announcements:
All agentic AI usage is banned. To help enforce this, vulnboxes will only be accessible via a web console. Vulnboxes will have limited internet access (with mirrors provided to install software, but all other internet access blocked). If you wish to install your own tools on the vulnbox (i.e. by cloning from Github) you may do so, but only web console CLI access will be available. All interactions and traffic will be monitored, and any attempt to connect to the environment using anything other than a standard web browser will be grounds for disqualification. We do this not to be legalistic, but to preserve the fun of a human CTF.
and then later in a further message:
As a final reminder, absolutely no agentic AI usage is allowed, including during check-in (or during the game). You may encounter some quirks to the web console - as curious as you may be, we strongly encourage you to not attempt to reverse engineer or poke around the web console (this includes opening dev tools). We have a number of AI-protection mechanisms in place which are quite aggressive, and while they have a very low false-positive rate during normal usage, poking around the environment is likely to result in temporary access bans which we will have to manually review and remove. If the vulnbox web console suddenly stops responding, please open a ticket and we will review it as soon as possible. We plan on releasing a full writeup on the AI protections implemented following the event, but are waiting until then to release the details so as to help protect the integrity of the competition.
(emphasis added)
So, let's reverse engineer it and find out how it works!
The first thing that you could try is, well, view page source. The HTML is pretty short:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CubeCTF Console</title>
<base href="/console/">
<link rel="stylesheet" href="style/xterm.min.css">
<link rel="stylesheet" href="style.css">
<link href="/static/img/favicon.ico" rel="shortcut icon" type="image/x-icon"/>
</head>
<body>
<a class="xterm-header" href="/console/api/docs">Console API documentation</a>
<textarea class="xterm-helper-textarea" aria-label="Terminal input" autocapitalize="off" autocorrect="off" spellcheck="false" tabindex="-1"></textarea>
<div id="terminal"></div>
<script src="js/widget.js"></script>
<div id="overlay" class="hidden">
<div class="bubble">Reconnecting...</div>
</div>
<!-- The addons load first: the app is embedded at the tail of the xterm
bundle and reads them while it boots. -->
<script src="js/addon-fit.min.js"></script>
<script src="js/addon-web-links.min.js"></script>
<script src="js/xterm.min.js"></script>
</body>
</html>
Hmm interesting, what is in that "console API documentation" link? clicks. Oh, I got banned, awesome.
...
So, after getting opening a ticket and getting unbanned, I did the next most obvious thing: the announcements said to not open devtools, so I opened devtools (and got banned, again). Oops. Okay okay but this time after I got unbanned again, I decided to actually look at the javascript code and not click on random links meant to bait LLMs. After copying all of the JS and the html into a local python webserver, I can see what it is doing without getting banned. This led me to finding something I thought was the devtools check used:
// unminified
function detectDevtools() {
if (!isBanned) {
let trip = false
const err = new Error()
Object.defineProperty(err, 'stack', {
get() {
trip = true
return ''
},
})
console.debug(err)
if (trip) banForCause('focus')
}
}
detectDevtools()
detectDevtoolsTimer = setInterval(detectDevtools, 1e3)
But through the advanced process of admin fuzzing I learned this is not actually the case:

After looking just a little bit more at the request log in python3 http.server though, I realized the obvious (and admin fuzzing confirmed this is in fact how it works): at the end of all of those javascript files, there was a sourcemap URL set: //# sourceMappingURL=/sm/97377c0c258e109358121823f5790146c714989366481f90e554c42277efb500_.map. When this is visited (which is done automatically when you open devtools), you will also get banned (and there is a chrome-only /.well-known/appspecific/com.chrome.devtools.json which is also triggered when the devtools are opened).
Fortunately, there is a simple fix: you can just turn source maps off in firefox in the devtools settings, entirely breaking the devtools detector mechanism, and allowing us to look at what is actually happening.
Now we can reload the page to observe the requests being sent:
/console endpoint, and the JS/CSS load/console/api/term/typing-rate/console/console/font, which responds with some TTF file (I didn't notice this until much later...)So, we can look at how this is actually driven from scripts send to the client. The typing-rate stuff seems to be used for banning based on some typing rate stuff, i don't really know what it does because I didn't look very hard. It would seem like if we wanted to write our own client, we would just need to open a connection to /console, and we would get a shell. What is on the websocket connection, anyway?
> {"type":"resize","cols":125,"rows":67}
< {"key":"5e5840ea44b2a403da4be7496efea79f597be7b6db2c85254b0a0a3c745907d3","type":"sessionkey"}
< {"data":"îïµî³ï¯ï½ïîªï¶ïîïî°´îªî½îªî°´î©ïî³ïï
î¯î©î¥µï¤î¹î¹ïï¤î¤¦ï£ï£î°´îªî½îî¹î§ïî°ïµîïî¶î¡îî¹î§ïî¢î³\r\n","type":"output"}
< {"type":"output","data":"\u001b[H\u001b[2J\u001b[3J"}
< {"type":"output","data":"\r\n"}
[... a lot more terminal output ...]
Hmm, that data does not exactly look like normal text; I guess there is some kind of encryption involved? Let's see what the client does:
// unminified; tweaked for readability
sock.onmessage = (evt) => {
const msg = JSON.parse(evt.data)
if (msg.type === 'sessionkey') {
setSessionKey(msg.key)
} else if (msg.type === 'output') {
term.write(msg.data)
}
}
async function setSessionKey(key) {
state = 'font'
term.reset()
term.options.fontFamily = await loadFont(key)
fitAddon.fit()
term.refresh(0, term.rows - 1)
}
const FONT_FALLBACK = '"PureNerdFont", Menlo, Monaco, "Courier New", monospace'
async function loadFont(key) {
const res = await fetch('font', {
cache: 'no-store',
headers: { 'X-Session-Key': key },
})
const fontData = await res.arrayBuffer()
const fontFace = new FontFace('RandomFont', fontData, { style: 'normal', weight: 'normal' })
await fontFace.load()
document.fonts.add(fontFace)
return `"RandomFont", ${FONT_FALLBACK}`
}
Oookay. So, the /font endpoint is used to obtain a font named "RandomFont" (yeah I wonder what that does...) based on the session key provided by the server. We can actually look at the font we get in FontForge, and indeed, all of the normal ASCII characters are entirely gone:

Instead, there are quite a lot of glyphs defined in the font for characters in the private use range, which seem to contain a wide variety of latin characters:

U+E247 is not where you usually have a latin lowercase J character, I think, but I guess in this font you do now. Also, some teammates noticed that if you try copying from the terminal (by opening the context menu, since you can't do this with ctrl+shift+C.. and ctrl+shift+C will also get you banned because it opens devtools, amazing design guys), you also copy the weird encrypted characters (which you can then paste and they get turned back into normal ASCII by the server).
It gets even worse: by looking at the fontforge screenshot above a little bit (or trying to implement a naiive remapping), you can notice that many (most? all?) latin characters have multiple assigned code points in the private use range (you can see three different latin Xes in the above screenshot for example). So, the question now is: how do we (automatically) remap things back into the original ASCII?
Well, we can rely on a simple fact: if we have one font, and an encrypted string containing all of the latin characters in that font, then for all other fonts we get in the future, it's easy to find their encrypted to decrypted character mapping (by looking for characters which are render to similar bitmaps).
Matching up characters is pretty straightforward:
My similarity heuristic is pretty straightforward:
let mut score = 0u32;
for x in 0..bitmap_1.width().max(bitmap_2.1.width()) {
for y in 0..bitmap_1.height().max(bitmap_2.1.height()) {
// Increase the score by the square of the absolute difference between
// the two pixel values (out of bounds counts as black).
score += ((bitmap_1.get(x, y).abs_diff(bitmap_2.get(x, y))) as u32).pow(2);
}
}
return score;
Then, all we have to do is glue this together to create a custom client. I wrote a fairly simple one in go (which also reports the "proper" key timing data, which turns out to be pretty difficult since it means you have to write your own ANSI state machine and then reencode the data for sending to the server... this was definitely not worth it tbh, and I didn't even get it to properly handle arrow keys but whatever).
This also lets us log all of the output into a file, and then dump services by running cat services.tgz | base64 -w0; echo and extracting the tar data from the log (which surprisingly worked on my second attempt, after first struggling a bit with base64)
And... it works!

I mean I don't think any slopper would go through all of this effort, so I guess it probably worked in that sense? I don't think there is much more to say, to be honest.
commit caab53f56f97e11b01b9c021da8041306749601d Author: pitust <piotr@stelmaszek.com> Date: 2026-10-03T22:47:39+01:00 ecsc25: add