Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# --- Query Metadata ---
# Human-readable name for the query. Will be displayed as the title.
name: "Internet facing exploit followed by webshell execution and privileged account creation"

# MITRE ATT&CK technique IDs
mitre_ids:
- "T1190"
- "T1136"

# Description of what the query does and its purpose.
description: "This rule detects a possible webserver attack where :\n\nAttack passes WAF/Perimeter -> Supicious command runs -> New user window is created -> User is made Administrator.\n\nIf all these happen on same server within 30 minutes, the rule triggers\n\n(Network + Endpoint + Identity)"

# The author or team that created the query.
author: "Subhomoy Das"

# The required log sources to run this query successfully in Next-Gen SIEM.
log_sources:
- Endpoint
- Network
- Identity

# Tags for filtering and categorization.
tags:
- Hunting
- Monitoring
- Detection

cs_required_modules:
- Identity

# --- Query Content ---
# The actual CrowdStrike Query Language (CQL) code.
cql: |
correlate ( // kindly place your product name in place of vendor eg: Azure WAF , AKAMAI , palo alto
(Vendor="WAF" OR Vendor="Firewall")
Perimeter:{
/event.category[0]="threat"
| coalesce ([event.action, Vendor.action, Vendor.attackData.appliedAction), as perimeter_action)
| perimeter_action!=/^(deny denied block|blocked|reset) $/i
| coalesce ([server.address, server.domain, destination.address, destination.domain, host.name, Vendor.httpMessage.host],
as corr_host_raw)
| lower(corr_host_raw, as corr_host)
| corr_host=*
WebShell:{
#repo="base_sensor" fevent_simpleName="ProcessRollup2"
| (FileName=/^(w3wp|java|php-cgi/httpd/nginx) (\.exe)?$/i OR ParentBaseFileName=/^(w3wp|java|php-cgi/httpd/nginx) (\.exe) 25/i)
| CommandLine=/(powershell|cmd\.exe|whoami|certutil|curl|wget|net\s+(user|localgroup)|powershell. *New-LocalUser)/i
| coalesce ([ComputerName,host.name], as corr_host_raw)
| lower (corr_host_raw, as corr_host)
| corr host <=> Perimeter.corr_host
},
AccountCreated: {
#Vendor="microsoft" #event.module="windows"
| event.code="4720"
| coalesce ([host.name,windows.Computer), as corr_host_raw)
| lower (corr_host_raw, as corr_host)
| corr_host=*
| coalesce ([windows.EventData. TargetSid, Vendor.Event.EventData.TargetSid), as=corr_account_sid)
| corr_account_sid=*
| corr_host <=> WebShell.corr_host
},
PrivilegeGranted: {
#Vendor="microsoft" #event.module="windows"
| event.code="4732"
| (user.target.name=/^Administrators$/i OR Vendor.Event.EventData.TargetSid="s-1-5-32-544")
| coalesce ([host.name,windows.Computer), as=corr_host_raw)
| lower (corr_host_raw, as=corr_host)
| corr_host=*
| coalesce ([windows.EventData.MemberSid, Vendor. Event.EventData.MemberSid), as=corr_account_sid)
| corr_account_sid=*
| corr_host <=> AccountCreated.corr_host
| corr_account_sid <=> AccountCreated.corr_account_sid
},
sequence=true,
within 30m,
includeMatchesOnceOnly=true
)

# Explanation of the query. Uses markdown for formatting on the webpage.
explanation: |
This rule checks for a possible webserver compromise in four steps :

1. Perimeter/WAF threat : (not blocked / denied)
2. Supicious command execution (curl , cmd etc)
3. New Account Created (eid : 4720)
4. Account made Administrator.(eid : 4732)
Loading