Detect Exfiltration Over Webhook in IBM QRadar
Adversaries may exfiltrate data to a webhook endpoint rather than over their primary command and control channel. Webhooks are simple HTTP/S push mechanisms supported by collaboration platforms such as Discord, Slack, Microsoft Teams, and generic services like webhook.site. Adversaries exploit these endpoints by either linking an adversary-controlled webhook to a victim-owned SaaS service for automated repeated exfiltration of emails or chat messages, or by manually posting staged data directly to a webhook URL via scripting tools. Because webhook traffic is HTTPS and destined for widely-trusted SaaS domains, it blends with normal enterprise traffic and often bypasses data loss prevention controls. Observed real-world usage includes Discord webhooks for credential and token exfiltration from malicious npm packages, Slack webhooks used by insider threats, and Microsoft Teams webhooks abused via SQL Server xp_cmdshell lateral movement chains.
MITRE ATT&CK
- Tactic
- Exfiltration
- Technique
- T1567 Exfiltration Over Web Service
- Sub-technique
- T1567.004 Exfiltration Over Webhook
- Canonical reference
- https://attack.mitre.org/techniques/T1567/004/
QRadar Detection Query
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS EventTime,
sourceip AS SourceIP,
destinationip AS DestinationIP,
destinationport AS DestPort,
username AS UserName,
"LOGSOURCENAME"(logsourceid) AS LogSource,
QIDNAME(qid) AS EventName,
CATEGORYNAME(category) AS Category,
devicehostname AS Hostname,
LOWER("URL") AS WebhookURL,
"ApplicationName" AS ProcessName,
"CommandLine" AS CommandLine,
SUM("Bytes Sent") AS TotalBytesSent,
COUNT(*) AS EventCount,
MIN(starttime) AS FirstSeen,
MAX(starttime) AS LastSeen
FROM events
WHERE
(
LOWER("URL") ILIKE '%discord.com/api/webhooks%'
OR LOWER("URL") ILIKE '%hooks.slack.com/services%'
OR LOWER("URL") ILIKE '%webhook.site%'
OR LOWER("URL") ILIKE '%webhooks.site%'
OR LOWER("URL") ILIKE '%outlook.office.com/webhook%'
OR LOWER("URL") ILIKE '%outlook.office365.com/webhook%'
OR LOWER("URL") ILIKE '%pipedream.net%'
OR LOWER("URL") ILIKE '%requestbin.com%'
OR LOWER("URL") ILIKE '%requestcatcher.com%'
OR LOWER("URL") ILIKE '%hookbin.com%'
OR LOWER("URL") ILIKE '%beeceptor.com%'
OR LOWER("URL") ILIKE '%smee.io%'
OR LOWER("URL") ILIKE '%ntfy.sh%'
OR LOWER("URL") ILIKE '%pushover.net%'
OR LOWER("CommandLine") ILIKE '%discord.com/api/webhooks%'
OR LOWER("CommandLine") ILIKE '%hooks.slack.com%'
OR LOWER("CommandLine") ILIKE '%webhook.site%'
OR LOWER("CommandLine") ILIKE '%pipedream.net%'
OR LOWER("CommandLine") ILIKE '%ntfy.sh%'
)
AND (
LOWER("ApplicationName") IN ('powershell.exe','pwsh.exe','cmd.exe','python.exe','python3','node.exe','curl.exe','wget.exe','wscript.exe','cscript.exe','mshta.exe','rundll32.exe','certutil.exe','bitsadmin.exe')
OR "Bytes Sent" > 1048576
)
AND LOGSOURCETYPEID IN (12, 352, 433)
GROUP BY
sourceip, destinationip, destinationport, username, devicehostname, "URL", "ApplicationName", "CommandLine"
HAVING TotalBytesSent > 0 OR EventCount > 0
ORDER BY TotalBytesSent DESC, EventCount DESC
LAST 24 HOURS AQL query correlating outbound network connections and process events against known webhook domains and testing tool domains. Detects both large-volume data transfers (>1MB sent) to webhook endpoints from any process and suspicious scripting/binary processes connecting to webhook URLs. Also matches processes with webhook URLs embedded in their command-line arguments, covering direct POST exfiltration patterns using curl, PowerShell Invoke-WebRequest, or Python requests.
Data Sources
Required Tables
False Positives & Tuning
- Automated notification scripts run by legitimate DevOps users sending deployment status messages to Slack or Teams webhooks from build servers.
- Endpoint security or SIEM integration tools using curl or Python to forward alerts to collaboration platform webhooks for SOC triage workflows.
- Web proxy or firewall logs capturing browser-based access to webhook.site or pipedream.net by developers testing integrations from their workstations.
Other platforms for T1567.004
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Exfiltrate Data via Discord Webhook using PowerShell
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Invoke-RestMethod' and 'webhook.site'. Sysmon Event ID 3: Network Connection from powershell.exe to webhook.site on port 443. DeviceNetworkEvents: RemoteUrl containing webhook.site, InitiatingProcessFileName=powershell.exe, BytesSent > 0.
- Test 2Exfiltrate File Contents via curl to Webhook Endpoint
Expected signal: Sysmon Event ID 1: Process Create for cmd.exe (echo/type) and curl.exe with CommandLine containing 'webhook.site' and '-X POST'. Sysmon Event ID 11: File Create for the staging file in %TEMP%. Sysmon Event ID 3: Network Connection from curl.exe to webhook.site on port 443. DeviceNetworkEvents: InitiatingProcessFileName=curl.exe, RemoteUrl containing webhook.site.
- Test 3Python Requests Library Webhook Exfiltration
Expected signal: Sysmon Event ID 1: Process Create with Image=python.exe, CommandLine containing 'urllib.request', 'webhook.site', and 'POST'. Sysmon Event ID 3: Network Connection from python.exe to webhook.site on port 443. DeviceNetworkEvents: InitiatingProcessFileName=python.exe, RemoteUrl=webhook.site.
- Test 4Automated SaaS Webhook Exfiltration via Microsoft Teams Incoming Webhook
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Invoke-WebRequest' and 'outlook.office.com/webhook'. Sysmon Event ID 3: Network Connection from powershell.exe to outlook.office.com on port 443. DeviceNetworkEvents: RemoteUrl containing /webhook/, InitiatingProcessFileName=powershell.exe.
References (11)
- https://attack.mitre.org/techniques/T1567/004/
- https://medium.com/checkmarx-security/webhook-party-malicious-packages-caught-exfiltrating-data-via-legit-webhook-services-6e046b07d191
- https://www.cyberark.com/resources/threat-research-blog/the-not-so-secret-war-on-discord
- https://blog.talosintelligence.com/collab-app-abuse/
- https://github.com/pushsecurity/saas-attacks/blob/main/techniques/webhooks/description.md
- https://www.microsoft.com/security/blog/2023/10/03/defending-new-vectors-threat-actors-attempt-sql-server-to-cloud-lateral-movement/
- https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks
- https://www.redhat.com/en/topics/automation/what-is-a-webhook
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1567.004/T1567.004.md
Unlock Pro Content
Get the full detection package for T1567.004 including response playbook, investigation guide, and atomic red team tests.