Query Details

Rule : OAST, Webhook, and Disposable Callback Destinations

C2 OAST Webhook Callback Domains

Query

let CallbackDomains=dynamic(["webhook.site","interact.sh","oast.pro","oast.live","burpcollaborator.net","oastify.com","oast.site","oast.online","oast.fun","oast.me","requestbin.net","pipedream.net"]);
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where isnotempty(RemoteUrl)
| extend Host=tolower(tostring(parse_url(iff(RemoteUrl matches regex @"(?i)^https?://", RemoteUrl, strcat("https://",RemoteUrl))).Host))
| where Host has_any (CallbackDomains) or RemoteUrl has_any (CallbackDomains)
| summarize Connections=count(), UniqueDestinations=dcount(RemoteUrl), SampleDestinations=make_set(RemoteUrl,10) by DeviceId, DeviceName, InitiatingProcessFileName, InitiatingProcessAccountName, bin(Timestamp,1h)
| order by Connections desc

About this query

Explanation

This query is designed to detect network connections to specific out-of-band testing and disposable callback services, which are often used in security testing and potentially malicious activities. Here's a simplified breakdown:

  1. Purpose: The query identifies devices connecting to known callback services like webhook.site, interact.sh, and others. These services are often used in security testing to confirm vulnerabilities by receiving data from potentially compromised systems.

  2. Data Source: It uses the DeviceNetworkEvents table, which logs network activity on devices.

  3. Detection Logic:

    • It checks network events from the past 7 days.
    • It extracts and normalizes the host part of the URL from each network event.
    • It looks for matches between these hosts and a predefined list of callback domains.
    • It summarizes the findings by device, process, and account over 1-hour intervals, counting the number of connections and unique destinations.
  4. Output: The query provides a summary of connections, including the number of connections, unique destinations, and sample URLs, sorted by the number of connections.

  5. False Positives: The query may flag legitimate security tests or webhook developments. It suggests excluding known testing devices and extending the list of callback domains based on your threat intelligence.

  6. Triage Steps:

    • Investigate the process initiating the callback.
    • If the device is a server, consider the callback as a potential sign of exploitation.
  7. Note: The domains listed are not inherently malicious but can be used for both legitimate and malicious purposes. The query should initially be used as a hunting tool to refine thresholds and reduce false positives.