MQL for Email APT Hunting
Bryan Campbell (Sublime Security)
Overview
In the evolving landscape of cyber threats, email remains a primary vector for sophisticated adversaries, particularly Advanced Persistent Threat (APT) groups. Bryan Campbell of Sublime Security delivered a compelling talk at Wild West Hackin' Fest @ Mile High, introducing the Message Query Language (MQL) and Sublime's innovative platform designed to empower security analysts in hunting these elusive threats within email environments. The presentation highlighted MQL's unparalleled flexibility and contextual awareness, showcasing its ability to describe and detect complex attacker behaviors that often bypass traditional email security solutions.

Key moments
- 0:45 Core Components: MQL, ASA, ADE Architecture
- 7:00 File Explode: Deep Analysis of Attachments
- 9:00 APT29 (Cozy Bear) Tactics & HTML Smuggling Detection
- 20:00 APT28 (Fancy Bear) & CVE-2023-21509 Rapid Detection
- 22:30 Autonomous Detection Engineer (ADE): Automated Rule Generation
- 23:50 Autonomous Security Analyst (ASA): Explainable AI Verdicts
MQL for Email APT Hunting
Speakers: Bryan Campbell (Sublime Security)
Conference: Wild West Hackin' Fest @ Mile High
YouTube: https://www.youtube.com/watch?v=_39gBdeSwSY
Overview
In the evolving landscape of cyber threats, email remains a primary vector for sophisticated adversaries, particularly Advanced Persistent Threat (APT) groups. Bryan Campbell of Sublime Security delivered a compelling talk at Wild West Hackin' Fest @ Mile High, introducing the Message Query Language (MQL) and Sublime's innovative platform designed to empower security analysts in hunting these elusive threats within email environments. The presentation highlighted MQL's unparalleled flexibility and contextual awareness, showcasing its ability to describe and detect complex attacker behaviors that often bypass traditional email security solutions.
Campbell, drawing on his extensive experience in threat intelligence at companies like CrowdStrike and Proofpoint, emphasized the limitations of existing tools in addressing the nuanced tactics, techniques, and procedures (TTPs) employed by APTs. Sublime's MQL, coupled with its autonomous security analyst (ASA) and detection engineer (ADE), offers a multi-layered defense strategy. This talk is crucial for any security professional grappling with advanced email-borne threats, providing a deep dive into how a purpose-built language and an intelligent platform can revolutionize detection capabilities against state-sponsored espionage and financially motivated cybercrime. It underscores a fundamental shift from static, signature-based defenses to dynamic, behavior-driven detection, equipped to handle the creativity and persistence of top-tier adversaries.
Background
▶ Watch: Core Components: MQL, ASA, ADE Architecture (0:45)
The genesis of MQL and the Sublime platform stems from a critical gap in the cyber security industry: existing email security tools often lack the flexibility and contextual understanding required to effectively counter sophisticated, evasive attacks. Traditional solutions frequently rely on static indicators like file hashes, sender reputation, or simple keyword matching, which are easily circumvented by well-resourced APT groups. These groups constantly rotate infrastructure, obfuscate payloads, and employ social engineering tactics that exploit human trust rather than technical vulnerabilities alone.
Sublime Security addresses this challenge with a core architecture built around three distinct components: the Message Query Language (MQL), the Autonomous Security Analyst (ASA), and the Autonomous Detection Engineer (ADE). MQL is a purpose-built, highly descriptive language designed to express complex attack behaviors and TTPs specifically within the email context. Unlike generic query languages, MQL is context-aware, meaning it can leverage organizational data like sender history and integrate powerful capabilities such as Natural Language Understanding (NLU) and computer vision models in real-time. This allows for detection logic that goes far beyond simple field matching, analyzing intricate signals from email content, attachments, links, and domains.
The platform's robust enrichment functions are key to this deep analysis. These utilities extract critical context, enabling the creation of high-fidelity detection and response rules. Enrichments encompass a wide array of analyses, including deep file inspection (e.g., recursive unpacking of archives, macro analysis), visual rendering of emails and web pages, network WHOIS lookups, and machine learning-driven insights. By combining these technical, behavioral, and semantic signals, Sublime aims to improve accuracy and reduce false positives, which are prevalent issues in traditional email security. The platform's risk scoring mechanism aggregates these multiple signals from rules, enrichments, and ML models into a single, interpretable assessment of threat severity, weighing contextual factors to surface sophisticated threats that evade conventional boundary rules. This holistic approach provides a foundational shift in how email-borne threats are identified and prioritized.
Key Findings
▶ Watch: APT29 (Cozy Bear) Tactics & HTML Smuggling Detection (9:00)
The talk unveiled several pivotal findings regarding MQL and Sublime's efficacy in combating advanced email threats. Firstly, MQL's design as a purpose-built, highly descriptive, and context-aware language fundamentally transforms the ability to define and detect complex attacker behaviors in email. It moves beyond simplistic pattern matching, allowing for rules that incorporate NLU, computer vision, and historical context for unprecedented detection fidelity.
Secondly, Sublime's multi-layered detection approach, powered by a comprehensive suite of enrichments, significantly elevates the platform's capability. Features like OCR for image-only content, URL analysis using headless browsers and object detection (e.g., Fishapedia), and File Explode for recursive deep inspection of attachments (leveraging Strelka and YARA) enable the platform to "see inside" obfuscated and nested payloads that bypass traditional scanning methods. This allows for content-based detections instead of sole reliance on hashes or sender reputation.
A critical finding was the platform's demonstrated ability to detect specific TTPs associated with prominent APT groups. Campbell provided concrete examples for:
- APT29 (Cozy Bear): Detection of HTML smuggling, a technique used to drop payloads like Root Soar, by identifying specific strings within HTML file attachments.
- APT1 (Zirconium): Identification of web beacons or tracking pixels, often used in phishing frameworks like GoFish, by detecting invisible image tags with specific tracking paths (
track?rid=). This highlights content-based detection that remains effective even when attackers rotate domains. - APT38 (Lazarus Group sub-cluster): Detection of sophisticated impersonation campaigns, such as fake OneDrive invoice notifications, by combining display name spoofing, email spoofing, and confusable character detection (using
strings.replace_confusablesin MQL). - APT28 (Fancy Bear): Rapid detection of zero-day exploits like CVE-2023-21509, a Microsoft Office bypass vulnerability, by targeting weaponized Office/RTF attachments abusing embedded shell explorer, hidden LNK payloads, and YARA signatures.
Finally, the introduction of Autonomous Detection Engineer (ADE) and Autonomous Security Analyst (ASA) underscores a significant finding in automation. ADE can automatically generate new MQL detection logic, backtest it against historical data, and deploy it, drastically reducing the traditional bottleneck of vendor-pushed detections for new evasive attacks. ASA, acting as an AI-driven Tier 1/Tier 2 SOC analyst, provides fully explainable verdicts with natural language reports, reasoning, and oversight, addressing the "black box" criticism often leveled at AI in security. These findings collectively demonstrate a powerful, flexible, and automated approach to email threat hunting, capable of adapting to the rapid evolution of APT tactics.
Technical Deep Dive
▶ Watch: APT28 (Fancy Bear) & CVE-2023-21509 Rapid Detection (20:00)
Sublime's architecture is a sophisticated fusion of a custom query language, advanced analytical engines, and AI-driven automation, all geared towards deep email threat detection. At its heart is the Message Query Language (MQL), a domain-specific language purpose-built for expressing complex attack behaviors and TTPs within email. MQL is designed for flexibility and context-awareness, capable of querying not just basic headers or sender addresses, but also leveraging insights from Natural Language Understanding (NLU) and computer vision models. This allows analysts to write rules that go beyond simple string matches, incorporating semantic meaning, visual cues, and historical sender behavior.
The core of MQL's power lies in its enrichment functions. These are built-in utilities that extend MQL's capabilities, allowing deep inspection of various email components:
- File Analysis: Deeply inspects attachments, recursively unpacking archives (ZIPs, RARs), documents (PDFs, DOCX), and HTML files. It extracts rich signals like JavaScript identifiers, macros, OCR text strings, and YARA matches. This functionality is powered by Strelka, an open-source file scanning framework designed for modern email attacks like HTML smuggling and weaponized documents.
- Visual Rendering: For URL analysis and email content, Sublime uses a headless browser to fetch and render destinations, collecting screenshots. This enables detection of phishing or impersonation based on visual indicators, page structure, and embedded scripts, rather than just static reputation.
- Network WHOIS: Gathers information about domains, including age and registration details, adding critical context to link analysis.
- ML-driven Insights: Integrates machine learning models for tasks such as logo detection, language classification, and semantic intent analysis. For URL analysis, the platform uses Fishapedia, an open-source object detection project, to identify brands, buttons, and input forms in rendered web pages.
Risk scoring aggregates these diverse signals. Instead of relying on a single indicator, Sublime weights multiple low-confidence signals from rules, enrichments, and ML models. This approach incorporates contextual factors like sender history, link behavior, and semantic intent to produce a single, explainable threat severity score, reducing false positives and prioritizing alerts effectively.
Optical Character Recognition (OCR) is applied implicitly within enrichments. When emails, HTML files, or web pages are rendered into images, OCR automatically extracts visible text. This is crucial for detecting image-only or obfuscated phishing content, where brand names, credential prompts, or Calls to Action (CTAs) are hidden within images to evade traditional text-based parsing.
Campbell provided concrete MQL rule examples demonstrating these capabilities against specific APT groups:
- APT29 (HTML Smuggling): A rule example focused on
html.fileattachments and searching for specific strings withinhtml.bodyindicative of smuggling techniques. This targets the delivery of payloads like Root Soar via HTML droppers, which then use HTML smuggling to write ISO or IMG files to disk containing malicious LNKs and DLLs. - APT1 (Web Beacons): An MQL rule to detect tracking pixels (
type.inbound and image.tag.display.none and url.path.contains('track?rid=')). This rule specifically flags inbound emails containing invisible image tags where the URL path includestrack?rid=, a common pattern used by phishing kits like GoFish to confirm recipient engagement. This exemplifies content-based detection that bypasses domain rotation. - APT38 (Impersonation): A highly targeted MQL rule (
envelope.from.address == '[email protected]') combined with display name spoofing detection andstrings.replace_confusables. This leverages confusable character detection to identify subject line manipulation (e.g., "invoice" with a lowercase 'L') and multiple impersonation techniques, resulting in a high-severity alert. - APT28 (CVE-2023-21509): The rule targets weaponized Office and RTF attachments that abuse the embedded shell explorer. It specifically looks for hidden LNK payloads embedded within documents, a key technique in APT28's "Operation New Split." The rule incorporates YARA signatures to further identify these alongside valid LNK headers and supports multiple container formats (OLE, RTF, OOXML), including RTF hex-encoded and binary object embedding to counter obfuscation.
Finally, the platform's automation layers, Autonomous Detection Engineer (ADE) and Autonomous Security Analyst (ASA), are crucial. ADE automates the generation of new MQL detection logic, backtests it against historical data for accuracy, and deploys it, providing near real-time adaptation to new threats. ASA, a purpose-built AI agent, acts as a Tier 1/Tier 2 SOC analyst, performing deep investigations and providing fully explainable verdicts. For example, in an ICANN impersonation email, ASA can identify identity mismatches, deceptive link language (URL differing from destination), and workflow inconsistencies, providing a natural language report on why a message is malicious. This explainability is vital for human oversight and trust in AI-driven security.
Demo / Proof of Concept
▶ Watch: Autonomous Detection Engineer (ADE): Automated Rule Generation (22:30)
While the talk did not feature a live, interactive demonstration of the Sublime platform, Bryan Campbell effectively presented several MQL rules as concrete proofs of concept, illustrating how the language and underlying technology directly address the detection of sophisticated APT tactics. Each MQL rule was displayed alongside an example of the malicious email it was designed to detect, providing a clear, static demonstration of the platform's capabilities.
For instance, the detection of APT29's HTML smuggling technique was showcased with an MQL snippet targeting HTML files containing specific string patterns related to the smuggling mechanism. This visually demonstrated how Sublime's File Explode enrichment, powered by Strelka, could unpack the HTML attachment and expose the hidden logic, which traditional email gateways might miss. The rule effectively served as a blueprint for identifying the Root Soar HTML dropper.
Similarly, the concept of APT1's web beacons was proven through an MQL rule (type.inbound and image.tag.display.none and url.path.contains('track?rid=')) that flags invisible tracking pixels. This illustrated how the platform's ability to analyze HTML structure and URL paths, even for seemingly benign elements, could uncover a "sign of life" indicator used by phishing frameworks like GoFish. The visual representation of the rule highlighted its content-based nature, emphasizing its resilience against domain rotation.
The APT38 impersonation campaign was demonstrated with a highly specific MQL rule that combined multiple detection techniques, including envelope.from.address matching, display name spoofing, and the crucial strings.replace_confusables function. This showcased Sublime's ability to perform confusable character detection to identify subtle obfuscation in subject lines (e.g., 'invoice' with a lowercase 'L'), a technique designed to bypass both human scrutiny and less advanced security systems. The rule's high severity score, derived from the aggregation of multiple impersonation signals, underscored the platform's risk scoring efficacy.
Finally, the rapid response to APT28's exploitation of CVE-2023-21509 was presented with an MQL rule designed to detect weaponized Office and RTF attachments. This rule, leveraging YARA signatures and deep inspection for hidden LNK payloads within document objects, served as a powerful proof of concept for Sublime's ability to quickly develop and deploy specific detections for zero-day exploits and highly evasive payloads. These examples collectively functioned as a robust technical demonstration, validating MQL's power and the platform's analytical depth in confronting real-world APT threats.
Defensive Implications
▶ Watch: Autonomous Security Analyst (ASA): Explainable AI Verdicts (23:50)
The insights shared by Bryan Campbell offer critical defensive implications for organizations aiming to strengthen their email security posture against sophisticated threats. The primary takeaway is the imperative to move beyond traditional, static email security solutions that are easily bypassed by APT groups. Defenders must embrace dynamic, context-aware, and behavior-driven detection capabilities.
- Adopt Flexible Detection Languages: Organizations should explore and adopt query languages like MQL that allow for highly granular and context-rich rule creation. This enables security teams to precisely describe and hunt for specific TTPs, rather than relying on generic signatures. The ability to integrate NLU, computer vision, and historical context into detection logic is crucial for countering evolving evasion techniques.
- Prioritize Deep Content Inspection: Invest in solutions that offer recursive deep inspection of email attachments (e.g., File Explode powered by Strelka) and comprehensive URL analysis (e.g., headless browsers, object detection via Fishapedia). This capability is vital for uncovering obfuscated payloads, HTML smuggling, weaponized documents, and deceptive phishing links hidden multiple layers deep.
- Leverage Multi-Signal Risk Scoring: Shift from single-indicator alerts to systems that aggregate and weigh multiple contextual signals. This approach, exemplified by Sublime's risk scoring, significantly reduces false positives by requiring meaningful signal correlation, allowing security teams to prioritize threats based on true severity.
- Monitor Identity and Mailbox Changes: As demonstrated with APT29, adversaries frequently abuse legitimate infrastructure. Defenders must actively monitor for anomalies such as new OAuth grants, changes to mailbox forwarding rules, and unusual IP/device access. These "minor anomalies" can be critical indicators of compromise.
- Embrace Automation and Explainable AI: Solutions like Sublime's ADE and ASA highlight the future of security operations. Automated detection engineering (ADE) can drastically reduce the time to create and deploy new detections for emerging threats. Explainable AI (ASA) provides transparent, natural language verdicts, empowering SOC analysts with crucial context and reasoning, fostering trust and improving triage efficiency.
- Engage with Community-Driven Detections: Utilize and contribute to open-source rule repositories (like the Sublime rules GitHub) to benefit from collective intelligence and continuously improve detection coverage without manual updates. This collaborative approach enhances the defensive posture for all participants.
- Focus on Behavioral and Semantic Cues: Attackers are adept at rotating infrastructure. Focusing on the "what the email does" and user-visible behaviors (e.g., impersonation, deceptive CTAs, confusable characters) provides more resilient detection than solely relying on domain reputation or static hashes.
By integrating these defensive implications, organizations can build a more robust, adaptive, and intelligent email security framework capable of standing against the most sophisticated APT groups.
Key Takeaways
- MQL Revolutionizes Email Threat Detection: The Message Query Language provides an unprecedented level of flexibility and contextual awareness, enabling security analysts to write precise rules for complex, evasive APT tactics that traditional tools miss.
- Multi-Layered Defense is Essential: Sublime's platform combines advanced enrichments (NLU, computer vision, OCR, deep file/URL analysis) with intelligent risk scoring to aggregate diverse signals, delivering high-fidelity detection and significantly reducing false positives.
- Deep Content Inspection is Non-Negotiable: Features like File Explode (powered by Strelka) and URL analysis (with headless browsers and Fishapedia) are critical for "seeing inside" obfuscated attachments and links, uncovering hidden payloads and deceptive visual cues.
- Automation Enhances Agility and Explainability: The Autonomous Detection Engineer (ADE) rapidly generates and deploys new MQL rules, while the Autonomous Security Analyst (ASA) provides AI-driven, explainable verdicts with detailed natural language reports, streamlining SOC operations and improving incident response.
- Behavioral and Contextual Detections Outperform Static Indicators: Effective defense against APTs requires moving beyond static hashes and sender reputation to focus on behavioral anomalies, impersonation techniques, confusable characters, and specific TTPs that persist even when attackers rotate infrastructure.
- Community Collaboration Strengthens Defense: Leveraging and contributing to open-source rule repositories, such as the Sublime rules GitHub, allows organizations to continuously improve their detection coverage and benefit from collective threat intelligence.
About the Speaker(s)
Bryan Campbell is a security professional with a significant background in threat intelligence. At the time of this talk, he had been with Sublime Security for almost a year, contributing to their innovative email security solutions. His career has also included impactful roles at prominent cybersecurity companies such as CrowdStrike and Proofpoint, where he gained extensive first-hand experience in detecting and analyzing the activities of various APT groups. Campbell's expertise lies in understanding complex adversary behaviors and translating that knowledge into actionable detection strategies, making him a credible voice in the realm of advanced email threat hunting.
Reviews
Dr. Zero (Offensive Security Researcher) — WEAK
Sublime Security sent an intel guy to give a product pitch dressed up as a threat hunting talk. Strip away the 'Autonomous Detection Engineer' marketing fluff, and you get a few decent nuggets about catching HTML smuggling, but don't pretend this is novel research.
Heather Calloway (CISO) — WEAK
A competent but vendor-heavy look at applying detection-as-code principles to email security. Worth sending to your detection engineering lead, provided they understand this is effectively a pitch for a specific platform.
→ Top-rated talks at Wild West Hackin' Fest @ Mile High 2026