Query Details
// Detect threat actor abuse CloudFlare tunnels to deliver RATS // https://www.linkedin.com/posts/activity-7225744862875152384-whO8/ UrlClickEvents | where Timestamp > ago(30d) | extend domain = tostring(parse_url(Url).Host) | where domain endswith ".trycloudflare.com" | join EmailEvents on NetworkMessageId | project Timestamp, Url, RecipientEmailAddress, SenderMailFromAddress, SenderFromAddress, Subject, AttachmentCount, UrlCount
This KQL (Kusto Query Language) query is designed to detect potential threat actors using CloudFlare tunnels to deliver Remote Access Trojans (RATs) via email. Here's a simple breakdown of what the query does:
UrlClickEvents table.Timestamp > ago(30d)).extend domain = tostring(parse_url(Url).Host)).EmailEvents table based on the NetworkMessageId field.Timestamp, Url, RecipientEmailAddress, SenderMailFromAddress, SenderFromAddress, Subject, AttachmentCount, and UrlCount.In summary, this query identifies and displays email events where recipients clicked on URLs that use CloudFlare tunnels, which could be a sign of malicious activity.

Steven Lim
Released: August 4, 2024
Tables
Keywords
Operators