dongxiaoyan/gap_tsg_ui is a Robot-Framework QA automation suite for the TSG admin UI that validates a "Hijack Files" feature using uploaded test payloads of type .apk, .exe, .gif, .html, .jpeg, .png and .svg — confirming the live product can serve/substitute arbitrary file types, including Android APKs and Windows executables, as part of an intercepted-connection hijack action — alongside test cases for GTP-C records (mobile-core signaling) and first-class "subscriber_ids" and "mobile_identites" policy objects.
other/data/scriptfile/hijackfiles/Create-Hijack Files-test.apk, .exe, .gif, .html, .jpeg, .png, .svg ; case/logs/gtpc_records.robot, case/logs/radius_records.robot; commit 86ddb495 '修改 subscriber_ids 测试数据 调整keywords格式' (modify subscriber_ids test data, adjust keywords format)
Defense implications
- Hijack Files supporting .apk/.exe substitution means intercepted download traffic can be tampered with to deliver a different (potentially malicious) binary to the end user, not just blocked or redirected — a materially higher-severity capability than content blocking; worth flagging distinctly from generic 'HTTP hijack' in threat modeling.
- First-class GTP-C and subscriber_id/mobile_identity policy objects confirm mobile-core (cellular) signaling correlation is a designed, tested feature of the base product UI, independent of the Pakistan/Kazakhstan RADIUS evidence found elsewhere — treat subscriber correlation as core product functionality, not a bespoke per-customer add-on.
Related findings
TSG/CM ships with pre-built, first-class 'Learning Object' entries specifically for Freegate (Object ID 18) and Psiphon3 (Object ID 19), plus a generic 'Top Server IP' object (ID 20) -- default product features, not customer-commissioned custom signatures. The Psiphon3 object auto-learns and dynamically updates a live blocklist that reached roughly 70,000 IPs at one deployment before a database issue temporarily dropped it to ~50,000.
Crash-dump stack traces reveal TSG's core packet-processing engine (sapp) architecture: a custom multi-threaded C engine using 'marsio' as the DPDK-style packet-I/O driver, a plugin system for protocol handlers (confirmed: plug/protocol/http/http.so), and a libdocumentanalyze component that actively decompresses gzip content and parses ZIP/document formats found inside HTTP bodies -- i.e. inspection goes beyond headers into reconstructed application content.
certstore's own commit history documents its transparent-TLS-MITM mechanics directly: it writes the client's observed SNI into the SAN field of the leaf certificate it mints on the fly, supports ECC issuance (secp192r1/secp256r1) for those forged certs, and reads its Trusted/Untrusted decryption-keyring configuration from MAAT's DECRYPTION_KEYRING table -- confirming the interception pipeline end-to-end: client SNI in, matching forged certificate out, gated by MAAT-synced keyring policy.
TSG implements heuristic tunnel-protocol detection distinguishing Teredo (IPv6-over-UDP, default port 3544) from GTP tunneling based on UDP payload inspection, used to decide 'innermost' session attribution for firewall matching.
A 2020 MESA Lab monthly report describes building an encrypted-DNS gateway device and a self-hosted DoH server that was wired directly into a live "TSG platform WAN net interface", alongside a passive DoH-service-discovery pipeline that found 39 new DoH-serving domains in a single day of backbone ("科技网") traffic; a related note documents actively probing known DoH-serving IPs' upstream resolvers via a proxy network across 196 countries to check which still function.
A production feature spec ("加密协议JG") requires detection-and-control capability for QUIC, ESNI, and ECH, with a per-connection log field c_encrypt_type explicitly distinguishing ClientHello encryption (0=unencrypted, 1=ESNI, 2=ECH) and a DF_QUIC_REGION rule table matching QUIC by SNI. The system computes a per-rule "CT" (穿透/penetration) rate from paired mirror-vs-functional RST-packet logs (TF-RST-LOG / TF-MIRROR-RST-LOG) to grade each block rule's effectiveness, and runs continuous active-verification probes against its own rules, deliberately varying the probe 4-tuple each run "to ensure it doesn't hit the blacklist" so the verification traffic itself reaches the target.