
A companion toolkit to the CODE BLUE 2026 talk, giving red teams reconnaissance tools for testing whether VPN/SASE device trust can be transplanted after endpoint compromise, and defenders experimental Sigma and KQL detections.
| Tool | crypt0p3g/pass-the-device — recon tools and experimental Sigma/KQL detections from the CODE BLUE 2026 talk on transplanting SASE/VPN device trust |
| Category | Remote-access reconnaissance and detection engineering (Python) |
| Primary Use | Fingerprinting VPN/SASE front doors (vpn_fingerprint, gp_recon, netskope_scout, cisco_profile_lens) during authorized assessments, and detecting trust-state tampering with Sigma/KQL |
| Safe Use | Authorized security assessments of tenants, gateways, and accounts you own or are explicitly permitted to test; lab use of saml_bridge; blue-team baselining of the detections in your own environment |
| Telemetry Note | Detections watch Kernel-File ETW and Security event 4663 (via a SACL set by Set-PtdAuditSacl.ps1) for non-vendor processes reading client trust state, plus gateway and PAN-OS GlobalProtect logs for stock OpenConnect User-Agent strings and empty HIP serials |
pass-the-device is the artifact repository for a CODE BLUE 2026 talk titled *Pass-the-Device: Transplanting SASE/VPN Trust After Endpoint Compromise*, and it is unusual in that it deliberately serves two audiences at once. Red teams get a set of reconnaissance-focused tools for inspecting the trust boundary of commercial VPN and SASE remote-access products; blue teams get experimental Sigma rules and Microsoft Sentinel KQL queries designed to catch exactly the behavior the red-team side exercises. The repository, written in Python and MIT-licensed, also ships the conference slides in both English and Japanese — 50 talk slides plus a 24-page reference appendix (A01-A24) with bookmarks. A companion DPAPI toolkit lives in a separate repository, crypt0p3g/dpapi-toolkit, and the detection logic here leans on it conceptually for the master-key access signals.
The central idea worth understanding before touching any of the tools is that modern remote-access products bind trust to a device, not just to a user password. Once an endpoint is compromised, the question the talk poses is whether that device trust — client state files, device IDs, software-backed certificate keys, posture reports — can be picked up and transplanted to an attacker-controlled machine. The tools here are scoped strictly to the reconnaissance phase of that question: what a gateway exposes before login, how it authenticates, which IdP fronts it, and what posture it demands. The README is explicit that no tool establishes a tunnel, requests an enrollment certificate, or fabricates posture data on its own, which is a refreshingly restrained design posture for this genre of repository.
The entry point is vpn_fingerprint, which the README calls the front door for everything else. Given a VPN hostname, it identifies whether the endpoint is GlobalProtect, a Cisco ASA, or a FortiGate SSL VPN, how it authenticates (SAML, password, or certificate), which identity provider is involved, and what is exposed pre-authentication. Notably, it also parses the TLS client-certificate request to determine whether a certificate is required and which CAs the server claims to accept — a detail that immediately tells an assessor whether PKI-based device identity is in play. It can additionally query a Zscaler cloud to see whether a company domain is registered and which IdP it uses. The intended workflow is linear: fingerprint the hostname, then run whichever specialized tool the fingerprint names.
netskope_scout handles the one product in the set with no customer-hosted gateway to fingerprint, so it starts from the tenant name instead. It performs anonymous OrgKey discovery and read-only enumeration of tenant configuration — steering exceptions, pinned apps, tunnel policy, and compliance checks. For an authorized assessor, this is the difference between guessing at a tenant's posture model and reading its actual policy surface. For defenders, it is a useful map of what an unauthenticated observer can infer about their SASE configuration, which is exactly the kind of exposure review that should happen in a lab before it happens in an incident.
The Cisco side is covered by cisco_profile_lens, which parses the pre-auth SDesktop/HostScan data.xml file into a readable and editable posture profile. In its second mode it acts as an OpenConnect CSD wrapper — the role the stock csd-post.sh script plays — and can report either the real machine state or the edited profile you supply. This is one of only three tools that goes beyond passive reading, and the README is careful to note it only submits values you explicitly edited rather than synthesizing posture from nothing. It also carries the lightest dependency footprint: standard library only, plus curl 7.39+ on PATH.
gp_recon is the GlobalProtect counterpart. Given a portal, it reports what sign-in requires (password, certificate, or SAML), completes the sign-in with credentials you supply, and enumerates the gateways plus the CSC/HIP requirements. Two operational details stand out from the README: it identifies itself exactly as stock OpenConnect does, so it is not obfuscating its User-Agent, and it never connects to a gateway — it stops at the portal reconnaissance stage. Its posture submission is also deliberately gated: it will only send a CSC report built from a template you reviewed and selected, and it exits with status 2 rather than submit generated placeholder data. The --proxy flag can route its browser sign-in through saml_bridge for lab scenarios.
saml_bridge is the most sensitive component and the README labels it accordingly: a lab-only TLS-intercepting proxy that injects a PRT cookie into the IdP sign-in flow, using a per-install name-constrained CA. This is a research instrument for studying how primary refresh token material interacts with SAML-based VPN authentication, not something to point at production infrastructure. The name-constrained CA design is a good touch — it limits the blast radius of the generated CA to names within a constraint rather than producing a general-purpose MITM certificate. Everything about the tool's framing says it belongs in a test tenant with test identities.
The blue-team half of the repository lives in detections/ and targets two signal families that the author notes need little infrastructure to collect. The first watches client trust state: a non-vendor process reading GlobalProtect, Zscaler, Netskope, or Cisco client state, the Zscaler/Netskope device ID, software-backed certificate private keys, or DPAPI master keys. Telemetry comes from Kernel-File ETW or Security event 4663 with a SACL applied by Set-PtdAuditSacl.ps1, and there is a hunting query for live DPAPI decryption using the Crypto-DPAPI Debug channel. The second family catches stock OpenConnect defaults — the vanilla User-Agent string and placeholder values in its bundled HIP/CSD scripts — plus GlobalProtect sessions reporting client version 0.0.x or an empty HIP serial, sourced from gateway, web front-end, and PAN-OS GlobalProtect logs.
The detections are explicitly experimental, and the README directs defenders to detections/docs/validation.md with the instruction to baseline in their own environment before enabling alerting — advice that should be followed literally, since ETW file-read telemetry on client state directories will need tuning per estate. Credit is given where due: the GlobalProtect signals build on rotarydrone's GlobalUnProtect countermeasures, documented in detections/docs/credits.md. The DPAPI-focused queries are the most interesting of the set conceptually, because they target the moment master keys are consumed rather than the later, noisier moment of credential reuse.
Security hygiene throughout the codebase is better than most talk-ware. The README states that no vendor keys, CA private keys, or real tenant data ship in the repository — wherever a key is required, you supply or generate it. Secrets never appear on the command line; tools prompt for them or read them from files, which keeps them out of shell history and process listings. Output is treated as sensitive by default: recon output, saved cookies, and generated templates all contain tenant and session data, and the .gitignore covers the default output filenames to reduce the chance of an accidental commit. These are small things individually, but they signal a codebase written by someone who has thought about operational safety.
Getting started is straightforward for a Python shop: you need Python 3.9+, and each tool carries its own requirements.txt — vpn_fingerprint wants requests and cryptography, netskope_scout just requests, gp_recon adds playwright with Chromium for the browser sign-in flow, and saml_bridge needs cryptography. A typical clone looks like git clone https://github.com/crypt0p3g/pass-the-device, followed by installing the requirements for the specific tool you intend to use. At 39 stars the project is early in its lifecycle, which cuts both ways: the author is responsive to the talk circuit feedback loop, but the detection rules in particular should be treated as drafts to validate rather than drop-in content.
Where this fits in an authorized workflow is as a structured way to answer a governance question that most SASE/VPN deployments have never formally tested: how much of our device trust survives endpoint compromise, and would we see it move? The recon tools let an assessment team characterize the pre-auth exposure of each vendor's front door without crossing into tunnel establishment, and the detections give the blue team a concrete starting point for the file-access and telemetry baselines that question demands. Read alongside the slide deck — the English PDF is in slides/pass-the-device-en.pdf — the repository functions less like a loose tool dump and more like a documented methodology, which is exactly what the CODE BLUE format rewards. Treat the MIT license and the authorized-use warning as the operating envelope, and start with vpn_fingerprint before anything else.
crypt0p3g/pass-the-device.Educational analysis for authorized security professionals. Use only in controlled, authorized environments.
Related coverage
0 comentários:
Post a Comment
Note: Only a member of this blog may post a comment.