Game of Codes: QR Thrones, Image Battles, and the Quest for Initial Access
Josh Kamdjou (Founder and CEO · Sublime Security)
Security BSides London 2023 · Day 1 · Clappy Monkey Track
Overview
In "Game of Codes: QR Thrones, Image Battles, and the Quest for Initial Access," Josh Kamdjou, CEO and Founder of Sublime Security, dissects the alarming rise of QR code phishing, a sophisticated and increasingly prevalent threat vector for initial access. The talk comprehensively explores why QR code phishing has become such an effective tool for attackers, bypassing traditional email security measures and leveraging user conditioning to achieve its malicious goals. Kamdjou, drawing from his extensive background in both offensive and defensive cyber security, provides a deep dive into the technical intricacies of these attacks, showcasing numerous real-world examples and detailing the subtle yet critical signals that can be leveraged for detection and prevention.

Key moments
- 0:00 Introduction and talk agenda
- 4:30 QR code phishing: Why it's effective for attackers
- 10:00 Microsoft impersonation: Analyzing attack signals
- 24:00 DocuSign attacks bypass traditional defenses
- 28:30 Effective detection and prevention strategies
- 34:00 Advanced link analysis evasion techniques
- 37:40 Defense in depth: User education, hardware MFA
- 40:40 Q&A: Challenges with personal device scanning
Game of Codes: QR Thrones, Image Battles, and the Quest for Initial Access
Speakers: Josh Kamdjou, Founder and CEO, Sublime Security
Conference: BSides London
YouTube: https://www.youtube.com/watch?v=Oicy2dYNHxo
Overview
In "Game of Codes: QR Thrones, Image Battles, and the Quest for Initial Access," Josh Kamdjou, CEO and Founder of Sublime Security, dissects the alarming rise of QR code phishing, a sophisticated and increasingly prevalent threat vector for initial access. The talk comprehensively explores why QR code phishing has become such an effective tool for attackers, bypassing traditional email security measures and leveraging user conditioning to achieve its malicious goals. Kamdjou, drawing from his extensive background in both offensive and defensive cyber security, provides a deep dive into the technical intricacies of these attacks, showcasing numerous real-world examples and detailing the subtle yet critical signals that can be leveraged for detection and prevention.
The core of the presentation emphasizes the stealth and efficacy of QR code phishing, highlighting how these attacks exploit legitimate user behaviors and evade conventional security tools by obfuscating malicious links within images. Kamdjou illustrates how attackers craft highly convincing lures impersonating major brands like Microsoft, DocuSign, and Adobe, often leading to credential harvesting pages. The talk is particularly relevant for security professionals, incident responders, and organizations grappling with persistent phishing threats, offering actionable insights into the evolving landscape of email-borne attacks and strategies for enhancing defense in depth.
This article summarizes and expands upon Kamdjou's key insights, providing a detailed technical analysis of QR code phishing tactics, evasion techniques, and the critical defensive strategies required to combat this growing menace. It underscores the urgent need for specialized detection capabilities and robust user education to mitigate the risks posed by this cunning attack vector, which often pivots from corporate networks to personal mobile devices, creating a significant blind spot for defenders.
Background
▶ Watch: Introduction and talk agenda (0:00)
The proliferation of QR codes in daily life, from restaurant menus to marketing materials and legitimate software-as-a-service (SaaS) applications, has inadvertently created a fertile ground for attackers. Users are now conditioned to scan QR codes for various legitimate purposes, including event registrations, multi-factor authentication (MFA) setups, and accessing shared documents. This normalization forms the psychological bedrock of QR code phishing's effectiveness: users perceive QR codes as a standard, trustworthy interaction mechanism.
Compounding this user conditioning is the inherent obfuscation offered by QR codes. Unlike traditional hyperlinks, which allow users to hover and inspect the destination URL, a QR code's target remains a mystery until scanned. This lack of transparency renders traditional user training – "hover before you click" – entirely ineffective. For security tools, the challenge is even greater. QR codes are typically embedded within image files (often as CID attachments), meaning the email message itself contains no traditional URL, attachment, or direct payload for security gateways to analyze. This technique, often referred to as an "image as content" attack, means the entire malicious content is encapsulated within a single image, bypassing email security solutions designed to scan text, links, or file attachments.
Attackers capitalize on these factors to deliver credential phishing pages or malware downloads. The typical target is sensitive user credentials, especially for widely used platforms like Microsoft 365. The problem is exacerbated by attackers' ability to mimic high-reputation brands and leverage automated campaigns that personalize lures using recipient-specific information, making the attacks appear highly legitimate and targeted. This combination of user trust, technical obfuscation, and sophisticated social engineering has elevated QR code phishing to a top-tier initial access vector, forcing a re-evaluation of current email security paradigms.
Key Findings
▶ Watch: Microsoft impersonation: Analyzing attack signals (10:00)
Kamdjou's presentation reveals several critical findings regarding the nature and prevalence of QR code phishing attacks:
- Prolific and Evasive Nature: QR code phishing is "very prolific" and highly effective at bypassing traditional email security gateways. The absence of traditional URLs or attachments in the email body forces security tools to employ specialized decoders and image analysis, which many lack.
- Brand Impersonation Dominance: Attackers heavily impersonate well-known brands to lend legitimacy to their lures. Microsoft is by far the most frequently impersonated brand, followed closely by DocuSign and Adobe. Other variants include SharePoint and generic "TFA renewal" notifications. These impersonations often leverage legitimate-looking templates and logos.
- Social Engineering Tactics:
- Urgency and Fear: Subjects and body text frequently convey a sense of urgency (e.g., "update required," "account access will be lost") to prompt immediate action.
- MFA/Authentication Association: Attackers exploit the legitimate association between QR codes and MFA setup, using subjects like "reauthentication required."
- Internal Impersonation: Lures often impersonate internal entities like "Tyrell Corp IT department" or "HR payroll support" to appear more credible to the recipient.
- Personalization: Attackers automate the insertion of the recipient's second-level domain (SLD) or local part (username before
@) into the sender's display name or subject line, making the email seem specifically targeted.
- Credential Phishing as Primary Intent: The overwhelming majority of these attacks aim to harvest credentials, with Microsoft credential phishing pages being the most common destination, even when impersonating other brands like DocuSign.
- Advanced Evasion Techniques:
- Image as Content: The entire email content is often embedded as a single image, eliminating scannable text or links.
- High-Reputation Open Redirects: Attackers abuse legitimate services like Constant Contact (RS6.net) or Bing.com to host initial redirectors. These services have high domain age and reputation, making them appear benign to basic checks, but they ultimately redirect to malicious sites. Bing.com abuse is particularly clever as it aligns with Microsoft impersonations.
- Mobile User Agent Validation: Malicious landing pages often check the user agent. If the request isn't from a mobile device (as expected from a scanned QR code), it redirects to a legitimate site (e.g.,
office365.com) or an error page, thwarting automated security scanners and researchers. - Delayed Redirects: Attackers use
Refreshheaders or obfuscated JavaScriptsetTimeoutfunctions to introduce delays before redirecting to the final malicious payload. This can bypass security tools with short timeout periods for analysis. - QR Code Obfuscation: While less effective, attackers have been observed using different colors in QR codes, seemingly attempting to evade detection, though this has no practical impact on decoding.
- Hijacked Threads: In some instances, QR code phishing emails are inserted into existing, legitimate email threads, making them appear as part of an ongoing conversation and enhancing believability, a technique more commonly seen in BEC attacks.
- HTML/EML Attachments: QR codes can be embedded within HTML attachments (sometimes HTML smuggled) or EML attachments, which Outlook can render directly, effectively hiding the malicious content deeper within the message structure.
- IOC Rotation: Attackers frequently rotate Indicators of Compromise (IOCs) such as sender email addresses and malicious URLs, rendering traditional blocklist-based defenses ineffective and emphasizing the need for behavioral detection.
Technical Deep Dive
▶ Watch: Effective detection and prevention strategies (28:30)
The effectiveness of QR code phishing stems from a sophisticated blend of social engineering and technical evasion. Kamdjou meticulously breaks down the signals available for detection and the evasion techniques employed by attackers.
Detection Signals
Detecting QR code phishing requires a multi-layered approach, analyzing various components of the email and its embedded content:
- Brand Impersonation Signals:
- Logo Detection: Identifying brand logos (e.g., Microsoft, DocuSign, Adobe) within the email body. This requires computer vision or OCR (Optical Character Recognition) capabilities if the logo is part of an image.
- Urgency Keywords: Analyzing subjects and body text for phrases like "update required," "action needed," "account suspended," often accompanied by exclamation marks or all caps.
- Authentication Keywords: Terms related to MFA, reauthentication, or account verification, leveraging the legitimate use of QR codes for these purposes.
- Sender and Recipient Context:
- Recipient SLD/Local Part in Sender Display Name/Subject: A common automation technique where attackers insert the target's domain (e.g., "Tyrell Corp") or local part (e.g., "Rachel") into the sender's display name or subject line. This makes the email appear personalized and internal.
- Sender Reputation: Analyzing the sender's domain age, reputation, and historical communication patterns within the organization. New domains or senders with no prior communication are high-signal indicators.
- Compromised Accounts: Many attacks originate from previously compromised accounts, emphasizing the need for behavioral analysis over static IOC blocking.
- QR Code Specific Signals:
- Existence of a QR Code: The mere presence of a QR code in an email is a significant signal, especially if it's not expected from a known, legitimate sender.
- QR Code URL Analysis:
- Suspicious TLDs: Many malicious QR codes point to URLs with unusual or high-risk Top-Level Domains (TLDs) (e.g.,
.ru,.xyz,.top). These are often overlooked because the URL is hidden behind the QR code. - Free Subdomain/File Hosts: Destinations frequently include free subdomain providers or file hosting services, which are commonly abused by attackers.
- Redirect Chain Analysis: Inspecting the number of redirects and the nature of intermediate domains (e.g., moving from a free subdomain host to a free file host) can reveal malicious intent.
- Final Destination Content Analysis: Performing OCR, Machine Learning (ML), and Natural Language Understanding (NLU) on the final landing page to detect login boxes, username/password fields, and impersonated brand logos.
- Auto-Downloaded Files: Checking if the QR code destination attempts to automatically download files, indicative of HTML smuggling or direct malware delivery.
- Email Structure Signals:
- Image as Content: Detecting emails where the entire visible content is a single embedded image (CID attachment), rather than text or HTML elements. This is a primary evasion technique.
- HTML/EML Attachments: Identifying QR codes hidden within HTML or EML attachments, which require deeper inspection than typical message body analysis.
- Hijacked Threads: Recognizing when a QR code phishing email is inserted into an existing email conversation thread, often indicated by
Re:orFwd:in the subject and prior conversation content.
Link Analysis Evasion Techniques
Attackers employ sophisticated methods to prevent security tools from accurately analyzing the malicious URLs behind QR codes:
- Mobile User Agent (UA) Validation: This is a crucial evasion. Attackers anticipate that users will scan QR codes with mobile devices. Their malicious landing pages are configured to check the
User-Agentstring of the accessing client. If the UA indicates a non-mobile device (e.g., a desktop browser or an automated security scanner), the page redirects to a legitimate, benign site (e.g.,office365.com) or an error page. This ensures that automated analysis tools, which often use generic UAs, see only harmless content, effectively bypassing detection. - Delayed Redirects: Attackers use various mechanisms to introduce a delay before redirecting to the final malicious payload:
RefreshHeader: The HTTPRefreshheader (Refresh: X; url=malicious_url) instructs the browser to waitXseconds before navigating to the specified URL. A common value isX=0for immediate redirection, but longer delays can be used.- JavaScript
setTimeout: Malicious HTML pages or HTML attachments contain JavaScript that usessetTimeout(function() { window.location.href = 'malicious_url'; }, delay_ms);to delay the redirection. This can be combined with JavaScript obfuscation.
- JavaScript Obfuscation: Critical redirection logic and malicious URLs are often hidden within heavily obfuscated JavaScript code. This makes static analysis difficult and requires dynamic execution in a sandbox environment to uncover the true destination.
- High-Reputation Open Redirects: Utilizing trusted domains (like
bing.comorrs6.netfrom Constant Contact) as the initial redirector. These domains typically have excellent reputation and age, making them less likely to be blocked by initial URL filters. The redirect chain then leads to the actual phishing site.
Open-Sourced Detection Rules
Kamdjou highlights Sublime Security's open-sourced detection rules, available on their GitHub repository. These rules are categorized to address different facets of QR code phishing:
- Generic QR code phishing detection: Covers broad patterns applicable across various brands and attack types.
- Image as content detections: Specifically targets the technique of embedding entire messages within images.
- Brand-specific detections: Rules tailored for common impersonations (e.g., Microsoft, DocuSign).
- Evasion-specific detections: Rules to catch attacks leveraging HTML smuggling, EML attachments, and other advanced evasion tactics.
Demo / Proof of Concept
▶ Watch: Advanced link analysis evasion techniques (34:00)
While the talk did not feature a live demonstration of an attack being executed, it presented numerous real-world examples of QR code phishing emails and their corresponding malicious landing pages. These examples served as compelling proofs of concept, illustrating the various social engineering tactics, brand impersonations, and technical evasions discussed. Kamdjou displayed redacted screenshots of emails impersonating Microsoft, DocuSign, and Adobe, decoding the embedded QR codes to reveal the suspicious URLs and, in some cases, showing the resulting credential phishing pages. This visual evidence underscored the sophistication and believability of these attacks, validating their real-world impact and the challenges they pose to both users and security solutions. The presentation effectively demonstrated how these attacks manifest in the wild and why they are successful.
Defensive Implications
▶ Watch: Q&A: Challenges with personal device scanning (40:40)
Combating QR code phishing requires a multi-pronged defensive strategy, addressing both human and technical vulnerabilities:
- User Education is Paramount: Given the reliance on social engineering and user conditioning, continuous and targeted user education is the first line of defense. Organizations must specifically inform users about the existence of QR code phishing, explain why it's dangerous (obfuscation, pivot to personal devices), and provide clear guidelines:
- Verify Sender: Always scrutinize the sender, even if it appears to be internal.
- Avoid Scanning Unexpected QR Codes: Advise users to be highly suspicious of QR codes in unexpected emails, especially those demanding urgent action or authentication.
- Use Known Apps: If a QR code is genuinely expected (e.g., for MFA setup), users should ideally navigate directly to the application or website rather than scanning a code from an email.
- Report Suspicious Emails: Reinforce the importance of reporting any suspicious emails.
- Implement Hardware-Backed Multi-Factor Authentication (MFA): This is the single most critical technical defense against credential phishing, which is the primary goal of these attacks.
- Resilience to Phishing: Hardware keys (e.g., WebAuthn, FIDO2, YubiKey) are highly resistant to phishing because they verify the legitimate domain during authentication. Even if a user enters credentials on a phishing site, the hardware token will refuse to authenticate to the attacker's domain.
- Bypassing Software MFA: Kamdjou warns that non-hardware based MFA, such as Time-based One-Time Passwords (TOTP) or push notifications, can be bypassed by sophisticated phishing toolkits like Evilginx, which act as reverse proxies to relay credentials and session tokens to the legitimate site. Organizations should prioritize the deployment of hardware-backed MFA wherever possible.
- Advanced Email Security Solutions: Traditional email gateways often fall short. Organizations need solutions with specialized capabilities:
- QR Code Decoding: The ability to automatically detect, extract, and decode QR codes embedded in email bodies and attachments.
- Image Analysis: Employing Optical Character Recognition (OCR) and Computer Vision to analyze images for embedded text, brand logos, and other signals (e.g., login forms on a phishing page).
- Deep URL Inspection: Security tools must perform comprehensive URL analysis, including:
- Following Redirects: Fully traversing all redirects in a chain, including those with delays or behind high-reputation open redirectors.
- User Agent Spoofing: Simulating mobile user agents during URL analysis to bypass mobile UA validation.
- Content Analysis: Analyzing the final landing page content for phishing indicators (login forms, brand impersonation, suspicious scripts).
- Behavioral Detection: Moving beyond static IOCs (sender addresses, URLs) to detect anomalous sending patterns, recipient personalization tactics, and other behavioral cues that indicate a campaign.
- Attachment Sandboxing: Dynamically analyzing HTML and EML attachments in a sandbox environment to uncover hidden QR codes or JavaScript-based evasions.
- Addressing the Personal Device Pivot: The inherent challenge of QR code phishing is the pivot to personal mobile devices, which are often outside corporate network visibility. This means:
- No Network Introspection: Corporate web gateways or network proxies cannot inspect traffic originating from a personal phone scanning a QR code.
- No Logs: There are typically no corporate logs of a user scanning a malicious QR code on their personal device.
- This lack of visibility underscores the critical importance of strong endpoint protection on corporate devices (if the QR code is scanned there) and, more importantly, robust MFA that can withstand phishing attempts even when the initial interaction occurs off-network.
- Vendor Responsibility: Kamdjou suggests a call to action for major platform providers like Apple and Google to implement better native security features for QR code scanning and SMS messaging. Similar to how email providers filter spam, mobile OS vendors could develop mechanisms to warn users about suspicious QR code destinations or malicious SMS links, adding another layer of defense at the device level.
Key Takeaways
- QR code phishing is a highly effective and pervasive attack vector, leveraging user conditioning and technical obfuscation to bypass traditional email security and achieve initial access, primarily for credential harvesting.
- Attackers employ sophisticated social engineering tactics, including brand impersonation (especially Microsoft, DocuSign, Adobe), urgency, and personalized lures (recipient SLD/local part insertion), to trick users into scanning malicious QR codes.
- Advanced evasion techniques are common, such as embedding entire messages as images ("image as content"), abusing high-reputation open redirects (Bing.com, Constant Contact), and using mobile user agent validation and delayed redirects to thwart automated security analysis.
- Traditional email security solutions are often inadequate, as they struggle to decode QR codes, analyze embedded images, and fully inspect redirect chains that leverage evasion tactics. Specialized detection capabilities are essential.
- Hardware-backed Multi-Factor Authentication (MFA) is the strongest technical defense against the credential phishing that typically results from these attacks, as it prevents authentication to attacker-controlled domains, unlike software-based MFA which can be bypassed.
- Continuous user education is critical, as most end-users are unaware of the QR code phishing threat. Training must focus on vigilance, avoiding unexpected QR codes, and understanding the risks associated with scanning codes from untrusted sources, especially given the pivot to personal mobile devices.
About the Speaker(s)
Josh Kamdjou is the Founder and CEO of Sublime Security, a company dedicated to providing a free and open detection-as-code platform for email attack defense and threat hunting. His expertise is deeply rooted in both offensive and defensive cyber security. Prior to founding Sublime Security, Josh spent a significant portion of his career engaged in offensive cyber operations for government-related entities, as well as in the private sector where he performed pen testing and red teaming, focusing heavily on gaining initial access through phishing. This dual perspective allows him to understand attacker methodologies intimately, which now informs his defensive strategies. Academically, he studied computer science at the University of Maryland. Outside of his professional life, Josh is known for his involvement in martial arts and his passion for playing Halo 3.
Reviews
Dr. Zero (Offensive Security Researcher) — SOLID
Solid threat brief on how attackers weaponize QR codes to bypass secure email gateways. Kamdjou maps out the exact evasion chain—from CID attachments to mobile User-Agent validation—that makes these campaigns successful. It isn't groundbreaking research, but it's a highly competent breakdown of a structural blind spot for enterprise defenders.
Heather Calloway (CISO) — STRONG ACCEPT
A clear-eyed breakdown of why QR code phishing is bypassing our email gateways and shifting initial access off our corporate networks. This isn't just a tactical headache; it is a structural argument for why soft tokens are obsolete and hardware MFA is a non-negotiable requirement for corporate access.