LoFP LoFP / ngrok-managed domains and the tunnel gateway are used for legitimate development, testing, and remote-access workflows. static dev domains and repeated agent gateway lookups can be expected in approved environments. baseline authorized sources and use, and prioritize tcp tunnel endpoints, generated-looking labels, and the cisa-reported domain.

Techniques

Sample rules

Ngrok Reverse Proxy on Network

Description

This analytic detects DNS lookups to ngrok-managed endpoint domains, agent gateway domains, and CNAME targets, plus a CISA-reported ngrok-themed domain. Results classify TCP tunnel hostnames, tunnel.us-style agent gateway lookups, and generated-looking endpoint labels, and summarize repeated queries and distinct DNS answers by source and 15-minute interval. Threat actors have used ngrok to expose internal services, including RDP and SMB, maintain persistence, move laterally, and proxy command-and-control traffic. Ngrok is also a legitimate developer and remote-access service, so use the query classification, frequency, endpoint context, and approved usage baseline to prioritize investigation.

Detection logic


| tstats `security_content_summariesonly`
  count min(_time) as firstTime
        max(_time) as lastTime
        values(DNS.answer) as answer
        distinct_count(DNS.answer) as distinct_answers
        values(DNS.answer_count) as answer_count
        values(DNS.query_count) as query_count

FROM datamodel=Network_Resolution WHERE

DNS.query IN (
    "*.ngrok-agent.com.",
    "*.ngrok-agent.com",
    "*.ngrok-cname.com.",
    "*.ngrok-cname.com",
    "*.ngrok-free.app.",
    "*.ngrok-free.app",
    "*.ngrok-free.dev.",
    "*.ngrok-free.dev",
    "*.ngrok-free.pizza.",
    "*.ngrok-free.pizza",
    "*.ngrok.app.",
    "*.ngrok.app",
    "*.ngrok.com.",
    "*.ngrok.com",
    "*.ngrok.dev.",
    "*.ngrok.dev",
    "*.ngrok.io.",
    "*.ngrok.io",
    "*.ngrok.pizza.",
    "*.ngrok.pizza",
    "*.ngrok.pro.",
    "*.ngrok.pro",
    "*.tcp.ngrok.io.",
    "*.tcp.ngrok.io",
    "korgn.su.lennut.com.",
    "korgn.su.lennut.com",
    "tunnel.*.ngrok.com.",
    "tunnel.*.ngrok.com"
)

BY DNS.src DNS.query DNS.reply_code_id DNS.vendor_product _time span=15m


| `drop_dm_object_name("DNS")`


| eval query = lower(rtrim(query, "."))


| eval endpoint_label = mvindex(split(query, "."), 0)


| eval query_type = case(
    query = "korgn.su.lennut.com", "CISA-reported ngrok-themed domain",
    match(query, "(?i)^[^.]+\\.tcp\\.ngrok\\.io$"), "TCP tunnel endpoint",
    match(query, "(?i)^tunnel\\.[^.]+\\.ngrok\\.com$"), "Ngrok agent gateway",
    match(endpoint_label, "(?i)^(?:[0-9]{8,}
|[a-f0-9]{10,})$"), "Generated-looking endpoint label",
    true(), "Ngrok-managed domain lookup"
  )

| `security_content_ctime(firstTime)`

| `security_content_ctime(lastTime)`

| `ngrok_reverse_proxy_on_network_filter`