| ID | Technique | Tactic |
|---|---|---|
| T1071.001 | Web Protocols | Command And Control |
Detection: HTTP PUA User Agent
Description
This Splunk query analyzes web logs to identify and categorize user agents, detecting various types of unwanted applications. This activity can signify possible compromised hosts on the network.
Search
1
2| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Web where Web.http_user_agent != null by Web.http_user_agent Web.http_method, Web.url, Web.url_length Web.src, Web.dest
3| `drop_dm_object_name("Web")`
4| lookup pua_user_agents pua_user_agent AS http_user_agent OUTPUT tool
5| where isnotnull(tool)
6| stats count min(firstTime) as first_seen max(lastTime) as last_seen by tool url http_user_agent src dest
7| `security_content_ctime(first_seen)`
8| `security_content_ctime(last_seen)`
9| `http_pua_user_agent_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| Suricata | Other | 'suricata' |
'suricata' |
Macros Used
| Name | Value |
|---|---|
| security_content_ctime | convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$) |
| http_pua_user_agent_filter | search * |
http_pua_user_agent_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 Risk Event | True |
Implementation
To successfully implement this search, you need to be ingesting web or proxy logs, or ensure it is being filled by a proxy like device, into the Web Datamodel. For additional filtering, allow list private IP space or restrict by known good.
Known False Positives
Noise and false positive can be seen if these programs are allowed to be used within corporate network. In this case, a filter is needed.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message:
A known user agent ($http_user_agent$) associated with unusual programs was performing a request from $src$.
| Risk Object | Risk Object Type | Risk Score | Threat Objects |
|---|---|---|---|
| src | system | 32 | http_user_agent |
References
Detection Testing
| Test Type | Status | Dataset | Source | Sourcetype |
|---|---|---|---|---|
| Validation | ✅ Passing | N/A | N/A | N/A |
| Unit | ✅ Passing | Dataset | suricata |
suricata |
| Integration | ✅ Passing | Dataset | suricata |
suricata |
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: 1