Pierluigi Paganini December 09, 2024
Browser isolation is a security measure that separates web browsing from the user’s device by running the browser in a secure environment (e.g., cloud or VM) and streaming visuals.
Mandiant has identified a new technique for bypassing browser isolation technology and using QR codes to send commands from C2 to compromised devices.
C2 communications often rely on the HTTP protocol, implants request commands from a C2 server, execute them, and send results back. However, browser isolation systems complicate this, as they stream only the visual content of web pages to local devices, preventing the implants from decoding original HTTP responses.
Mandiant researchers devised a method to bypass browser isolation by embedding C2 data in a QR code displayed on a legitimate web page. A malicious implant uses a headless browser to render the page, captures a screenshot, and decodes the QR code to retrieve data, enabling communication with the attacker-controlled server.
“Mandiant’s Red Team developed a novel solution to this problem. Instead of returning the C2 data in the HTTP request headers or body, the C2 server returns a valid web page that visually shows a QR code. The implant then uses a local headless browser (e.g., using Selenium) to render the page, grabs a screenshot, and reads the QR code to retrieve the embedded data.” reads the advisory published by Mandiant. “By taking advantage of machine-readable QR codes, an attacker can send data from the attacker-controlled server to a malicious implant even when the web page is rendered in a remote browser.”
Below is the new C2 loop devised by Mandiant:
Mandiant researchers created a proof-of-concept implant leveraging Puppeteer and Google Chrome in headless mode to demonstrate their novel C2 technique.
The researchers also integrated their PoC implant with Cobalt Strike’s External C2 feature, allowing the use of the technique with the popular post-exploitation tool.
The proof-of-concept (PoC) demonstrated the feasibility of QR code-based C2, but the experts also highlighted the following limitations of the technique:
“While this technique proves that browser isolation technologies have weaknesses, Mandiant still recommends browser isolation as a strong protection measure against other types of attacks (e.g., client-side browser exploitation, phishing, etc).” concludes the report. “Organizations should not solely rely on browser isolation to protect themselves from web-based threats, but rather embrace the “defense in depth” strategy and establish a well-rounded cyber defense posture.”
Follow me on Twitter: @securityaffairs and Facebook and Mastodon
(SecurityAffairs – hacking, browser isolation)