Detection: CrushFTP Server Side Template Injection

Description

This analytic is designed to identify attempts to exploit a server-side template injection vulnerability in CrushFTP, designated as CVE-2024-4040. This severe vulnerability enables unauthenticated remote attackers to access and read files beyond the VFS Sandbox, circumvent authentication protocols, and execute arbitrary commands on the affected server. The issue impacts all versions of CrushFTP up to 10.7.1 and 11.1.0 on all supported platforms. It is highly recommended to apply patches immediately to prevent unauthorized access to the system and avoid potential data compromises. The search specifically looks for patterns in the raw log data that match the exploitation attempts, including READ or WRITE actions, and extracts relevant information such as the protocol, session ID, user, IP address, HTTP method, and the URI queried. It then evaluates these logs to confirm traces of exploitation based on the presence of specific keywords and the originating IP address, counting and sorting these events for further analysis.

 1`crushftp` 
 2| rex field=_raw "\[(?<protocol>HTTPS
 3|HTTP):(?<session_id>[^\:]+):(?<user>[^\:]+):(?<src_ip>\d+\.\d+\.\d+\.\d+)\] (?<action>READ
 4|WROTE): \*(?<http_method>[A-Z]+) (?<uri_query>[^\s]+) HTTP/[^\*]+\*" 
 5| eval message=if(match(_raw, "INCLUDE") and isnotnull(src_ip), "traces of exploitation by " . src_ip, "false") 
 6| search message!=false 
 7| rename host as dest 
 8| stats count by _time, dest, source, message, src_ip, http_method, uri_query, user, action 
 9| sort -_time
10| `crushftp_server_side_template_injection_filter`

Data Source

Name Platform Sourcetype Source
CrushFTP N/A 'crushftp:sessionlogs' 'crushftp'

Macros Used

Name Value
crushftp sourcetype="crushftp:sessionlogs"
crushftp_server_side_template_injection_filter search *
crushftp_server_side_template_injection_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

CrushFTP Session logs, from Windows or Linux, must be ingested to Splunk. Currently, there is no TA for CrushFTP, so the data must be extracted from the raw logs.

Known False Positives

False positives should be limited, however tune or filter as needed.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

Potential exploitation of CrushFTP Server Side Template Injection Vulnerability on $dest$ by $src_ip$.

Risk Object Risk Object Type Risk Score Threat Objects
dest system 64 src_ip

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset crushftp crushftp:sessionlogs
Integration ✅ Passing Dataset crushftp crushftp:sessionlogs

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 3