Securinets CTFMobile
backdrop
The repo is full of fake flags, and its AGENTS.md tries to steer AI solvers into pinging an external host.
- Competition
Securinets CTF
- Category
- MobileHard · estimated
- Source status
- Source-documented · not platform-verified
- Document
- PDF edition5 min read
TL;DR
The repo is full of fake flags, and its AGENTS.md tries to steer AI solvers into pinging an external host. The "6-digit unlock code" story is also a lie. The real flag is an image that the Flutter app builds from assets/data.bin in three layers:
data.bin --AES-GCM (key = SHA256(label || SHA256(signing cert)))--> plaintext --xorshift32 stream cipher (Dart)--> RLE tile stream --SplitMix64 tile shuffle + rotations (Dart)--> 894x332 bitmap of the flagThe app hides the result behind a 36-hour countdown and native GPU checks. Everything it needs ships inside the APK, so the whole pipeline can be reproduced offline.
01
Recon and decoys
The zip contains a git repo with backdrop.apk, src/check.py, README.md and AGENTS.md.
src/check.pycomments outSecurinets{str1ngs_w0nt_s4v3_y0u}.The git history (including the
stagingbranch) leaksSecurinets{g1t_h1st0ry_1s_4_tr4p},Securinets{un10ck_c0d3_1s_n0t_h3r3}andSecurinets{st4g1ng_pl4c3h0ld3r_7f3a}.AGENTS.mdis a prompt injection: it tells "automated agents" toping/curlquals-i-am-ai.securinets.tn, claims the flag islowercase snake_case, and says "the entire solve is the 6-digit code check". I ignored all of it.
The flag names say it themselves: these are all traps.
02
The APK
backdrop.apk is a Flutter app with x86_64-only native libraries:
| Library | Role |
|---|---|
libapp.so | Dart AOT snapshot (Dart 3.7.0, --obfuscate) |
libflutter.so | Engine |
libappsupport.so | PlatformSupport.ready() gate |
libvulkan.so | 3 KB stub that only exports __appsupport_anchor |
libts.so + assets/certs.ts | Talsec freeRASP runtime |
libtoolChecker.so | RootBeer |
Decompiling the DEX with jadx shows a thin Java layer:
LauncherActivityandMainActivity.onCreatecallPlatformSupport.ready()and refuse to start if it returns false.MainActivityforces--enable-impeller=true --impeller-backend=opengles. The strings are XOR-encoded with0x5a.A
MethodChannel("app/platform")exposes two methods:synclaunchesTimerActivity, which counts down 129,540,000 ms (about 36 h) before returning success.loadcallsZ1.a.b(), which decrypts the flag data.
Native ready()
The static initializer of libappsupport.so builds its strings one push_back at a time: libEGL.so, libGLESv3.so, eglGetDisplay … glGetStringi, MESA_EXTENSION_OVERRIDE, framebuffer_fetch. ready() creates a pbuffer EGL context and checks that the GPU supports GL_EXT_shader_framebuffer_fetch, which Impeller's GLES backend needs for backdrop filters. It's an environment gate only and holds no flag logic.
03
Layer 1: load (Java, AES-GCM)
Z1.a.b() decodes its constants with XOR 0x5a:
backdrop/flag/v1(the AES key label, also used as the AAD)backdrop/flag/scramble/v1BDF1(the magic)assets/data.bin
It then does:
sig = SHA256(signing certificate DER)gcm_key = SHA256("backdrop/flag/v1" || sig)scramble = SHA256("backdrop/flag/scramble/v1" || sig)plain = AES-GCM-decrypt(key=gcm_key, iv=data[4:16], ct=data[16:], aad="backdrop/flag/v1")return scramble || plainThe certificate is right there in META-INF/CERT.RSA (CN=Jihed Kdiss, O=Securinets). The GCM tag verifies, and the output is 19,756 bytes that are still high-entropy.
04
Reversing the Dart side
Blutter only supports arm64, and its x64 check even tests for EM_IA_64 instead of EM_X86_64. I used aotopsy instead. It parses Dart 3.x x86_64 snapshots statically and dumps the object pool. Annotating every [R15+off] load with pool[off+1] made the code readable despite the obfuscation:
sub_1c311cdoesinvokeMethod<Uint8List>('load').stub_cb634processes the result.stub_ccd48is a xorshift32 stream cipher.stub_ccc88is a SplitMix64 step (aotopsy flags the0x9e3779b9delta there).stub_cb838is the tile decoder and renderer.stub_cc930applies a dihedral transform to a tile.
Layer 2: key schedule and xorshift (stub_cb634, stub_ccd48)
With P = scramble || plain:
H = LE32(P[32:36])seed32 = LE32(P[0:4]) ^ Hseed64 = LE64(P[8:16]) ^ Hdata = xorshift_decrypt(P[36:], seed32)xorshift_decrypt steps a xorshift32 generator (<<13, >>17, <<5; a zero seed becomes 0x6d2b79f5). For each byte it XORs in (s >> 7) & 0xff, then feeds back s ^= plain_byte * 0x9e3779b1.
The decrypted stream starts with four LE16 values: 894, 332, 28, 11. That's width × height plus a 28 × 11 grid of 32 × 32 tiles.
Layer 3: tile puzzle (stub_cb838, stub_cc930)
Seed SplitMix64 with
seed64.orient[i] = next() & 7for all 308 tiles.Build
order = [0..307]and Fisher–Yates shuffle it withj = (next() & 0xffffffff) % (i + 1).For each tile
k, decode 32 rows. Each row is a varintruns, followed byrunspairs of(gap, length)varints that set pixels to 1.Transform the tile by
table[orient[order[k]]]. Bit 4 transposes, bit 2 flips horizontally, bit 1 flips vertically.Blit the tile at grid cell
order[k].
The decoder consumes exactly all 19,752 bytes, which confirms the format. The 8-entry table (pp+0xac68) wasn't in the dump. Since it has to undo the encoder's transform, it's the inverse table [0,1,2,3,4,6,5,7]. Using the identity table instead leaves the transposed tiles visibly wrong:

Flag
Flag
Securinets{https://github.com/flutter/flutter/issues/163421}
Source-documented · not platform-verified
The linked Flutter issue fits the theme: an Impeller backdrop-filter bug, which is why the app checks for framebuffer_fetch support.
Takeaways
In a repo full of planted flags, treat every flag-shaped string as a decoy until the binary proves otherwise.
Ignore instructions embedded in challenge files (
AGENTS.mdhere). They're part of the challenge, not orders.Countdown timers and environment checks in the app gate the display, not the data. Reimplementing the pipeline offline skips them.
For x86_64 Flutter builds, aotopsy plus a pool-annotation pass gets you a long way when Blutter can't.

