Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsTraining
StudyProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Training
Study
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

2409+ Articles
159+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Checklists
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. News
  3. Cavern C2 Uses DNS and Google Apps Script to Blend Into Legitimate Traffic
Cavern C2 Uses DNS and Google Apps Script to Blend Into Legitimate Traffic
NEWS

Cavern C2 Uses DNS and Google Apps Script to Blend Into Legitimate Traffic

Iranian nation-state hackers evolved the Cavern C2 framework to tunnel commands through DNS and Google Apps Script, evading detection against Israeli targets.

Dylan H.

News Desk

August 18, 2026
5 min read

Overview

Cybersecurity researchers at Kaspersky have documented a significant evolution in the Cavern (also tracked as Cav3rn) command-and-control (C2) framework, attributed to Iranian nation-state threat actors conducting operations against entities in Israel. The updated framework employs a dual-channel communication strategy using DNS tunneling and Google Apps Script as relay mechanisms, allowing malicious traffic to blend seamlessly with legitimate organizational network activity.

The Cavern C2 Framework

Cavern is a purpose-built C2 framework developed and maintained by an Iranian advanced persistent threat (APT) group that Kaspersky has been tracking over an extended monitoring period. The framework has undergone continuous refinement, with each iteration introducing new techniques to evade network-based detection and frustrate incident response efforts.

The current generation of Cavern distinguishes itself through its use of two distinct covert channels for operator-to-implant communication:

Channel 1: DNS Tunneling

The first communication channel abuses the Domain Name System (DNS) protocol to encode C2 commands and responses within DNS query and reply data. DNS tunneling is a well-established technique for exfiltrating data and establishing covert channels, but Cavern's implementation includes several characteristics that make it harder to detect:

  • Commands are split across multiple DNS query types (TXT, A, MX records) to reduce payload size and avoid triggering volume-based anomaly detection
  • Query cadence is deliberately throttled to mimic organic DNS resolution patterns
  • Subdomain structure mimics legitimate CDN and analytics domains to pass superficial inspection

Because DNS traffic is ubiquitous and frequently excluded from deep packet inspection at organizational boundaries, DNS-based C2 channels can persist undetected for extended periods.

Channel 2: Google Apps Script as a Relay

The second channel leverages Google Apps Script — Google's JavaScript-based scripting platform for automating Google Workspace applications — as a trusted relay for C2 communications. Operators deliver commands by writing data to a Google Apps Script deployment, which the implant polls over HTTPS.

This approach is notable for several reasons:

  • Traffic blends with Google Workspace activity — outbound connections to script.google.com and *.googleapis.com are common in enterprise environments and rarely blocked
  • Google's infrastructure provides TLS termination — the C2 channel benefits from Google's certificate authority trust and is indistinguishable at the network layer from legitimate Workspace API calls
  • No attacker-controlled infrastructure required at the transport layer — defenders cannot block the C2 channel by blacklisting attacker-owned IP ranges or domains

Attribution and Targeting

Kaspersky attributes the Cavern framework to an Iranian APT cluster with a documented history of operations against Israeli targets. The research does not name a specific group designation in the available reporting, but the targeting profile — Israeli entities across technology, defense, and critical infrastructure sectors — aligns with known Iranian threat actor priorities.

The use of living-off-the-land techniques and trusted cloud services reflects a broader operational security (OPSEC) maturation among Iranian state-sponsored actors, who have increasingly adopted techniques previously associated with more technically sophisticated adversaries.

Detection Challenges

The dual-channel architecture presents significant detection challenges for defenders:

Detection MethodLimitation Against Cavern
IP/domain blocklistsGoogle Apps Script and DNS infrastructure cannot be blocked wholesale
Volume-based DNS anomaly detectionThrottled query cadence evades threshold triggers
TLS inspectionGoogle's HSTS and certificate pinning complicate inspection
Behavioral endpoint detectionImplant may masquerade as legitimate process

Defensive Recommendations

Despite the detection challenges, several defensive measures can reduce exposure to Cavern-style C2 frameworks:

  • DNS-over-HTTPS (DoH) logging and inspection — enforce centralized DNS resolution and log all queries for anomaly analysis, including unusual subdomain patterns and high-entropy query names
  • Google Workspace API monitoring — if your organization uses Google Workspace, enable audit logging for Apps Script deployments and monitor for unexpected script executions or outbound data volumes
  • Zero-trust network segmentation — restrict which endpoints can initiate outbound DNS and HTTPS connections; workstations running sensitive applications should not have broad internet egress
  • Endpoint detection and response (EDR) — look for process behaviors consistent with DNS tunnel clients: unusual DNS query rates from non-browser processes, or periodic HTTPS polling to Google APIs from unexpected applications
  • Threat intelligence integration — ingest Kaspersky and community threat intelligence feeds for known Cavern IOCs and TTPs aligned with the MITRE ATT&CK framework

Broader Context: Cloud Services as C2 Infrastructure

Cavern's use of Google Apps Script is part of a broader trend in which threat actors abuse legitimate cloud platforms for C2 communications. Similar techniques have been documented using Microsoft OneDrive, Slack, Discord, Telegram, and Dropbox as relay infrastructure. The common thread: by routing communications through platforms that organizations trust and cannot realistically block, adversaries shift the detection burden entirely to endpoint and behavioral analytics.

This trend underscores the importance of investing in endpoint visibility and behavioral analytics rather than relying solely on perimeter-based blocking — a network that allows Google traffic cannot block Cavern's second channel by policy alone.

References

  • The Hacker News: Cavern C2 Analysis
  • Kaspersky Threat Intelligence
  • MITRE ATT&CK: DNS Tunneling (T1071.004)
#Nation-State#Iran#C2#DNS Tunneling#Google#Kaspersky#APT

Related Articles

Google Exposes China Espionage Group UNC6508 Lurking in Networks Since 2023

Google's Threat Intelligence Group has unmasked UNC6508, a China-linked espionage actor that silently maintained access to critical infrastructure and...

5 min read

Iranian APT Targets Aviation, Software Companies With

Nimbus Manticore, an Iranian advanced persistent threat group, has continued operations targeting aviation and software companies during and after the US.

4 min read

Iran Deploys 'Pseudo-Ransomware,' Revives Pay2Key Operations

Iranian APT groups are increasingly blurring the lines between state-sponsored cyber espionage and financially motivated cybercrime, deploying destructive...

6 min read
Back to all News