Living Off The Land Detection

Original Source: [splunk source]
Name:Living Off The Land Detection
id:1be30d80-3a39-4df9-9102-64a467b24abc
version:4
date:2024-09-30
author:Michael Haag, Splunk
status:production
type:Correlation
Description:The following correlation identifies multiple risk events associated with the "Living Off The Land" analytic story, indicating potentially suspicious behavior. It leverages the Risk data model to aggregate and correlate events tagged under this story, focusing on systems with a high count of distinct sources. This activity is significant as it often involves the use of legitimate tools for malicious purposes, making detection challenging. If confirmed malicious, this behavior could allow attackers to execute code, escalate privileges, or persist within the environment using trusted system utilities.
Data_source:
search:| tstats `security_content_summariesonly` min(_time) as firstTime max(_time) as lastTime sum(All_Risk.calculated_risk_score) as risk_score, count(All_Risk.calculated_risk_score) as risk_event_count, values(All_Risk.annotations.mitre_attack.mitre_tactic_id) as annotations.mitre_attack.mitre_tactic_id, dc(All_Risk.annotations.mitre_attack.mitre_tactic_id) as mitre_tactic_id_count, values(All_Risk.annotations.mitre_attack.mitre_technique_id) as annotations.mitre_attack.mitre_technique_id, dc(All_Risk.annotations.mitre_attack.mitre_technique_id) as mitre_technique_id_count, values(All_Risk.tag) as tag, values(source) as source, dc(source) as source_count from datamodel=Risk.All_Risk where All_Risk.analyticstories="Living Off The Land" All_Risk.risk_object_type="system" by All_Risk.risk_object All_Risk.risk_object_type All_Risk.annotations.mitre_attack.mitre_tactic
| `drop_dm_object_name(All_Risk)`
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| where source_count >= 5
| `living_off_the_land_detection_filter`


how_to_implement:To implement this correlation search a user needs to enable all detections in the Living Off The Land Analytic Story and confirm it is generating risk events. A simple search `index=risk analyticstories="Living Off The Land"` should contain events.
known_false_positives:There are no known false positive for this search, but it could contain false positives as multiple detections can trigger and not have successful exploitation. Modify the static value distinct_detection_name to a higher value. It is also required to tune analytics that are also tagged to ensure volume is never too much.
References:
  -https://www.splunk.com/en_us/blog/security/living-off-the-land-threat-research-february-2022-release.html
  -https://research.splunk.com/stories/living_off_the_land/
drilldown_searches:
name:'View the detection results for - "$risk_object$"'
search:'%original_detection_search% | search risk_object = "$risk_object$"'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
name:'View risk events for the last 7 days for - "$risk_object$"'
search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$risk_object$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
tags:
  analytic_story:
    - 'Living Off The Land'
  asset_type:Endpoint
  confidence:70
  impact:90
  message:An increase of Living Off The Land behavior has been detected on $risk_object$
  mitre_attack_id:
    - 'T1105'
    - 'T1190'
    - 'T1059'
    - 'T1133'
  observable:
    name:'risk_object'
    type:'Hostname'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - '_time'
    - 'All_Risk.analyticstories'
    - 'All_Risk.risk_object_type'
    - 'All_Risk.risk_object'
    - 'All_Risk.annotations.mitre_attack.mitre_tactic'
    - 'source'
  risk_score:63
  security_domain:endpoint

tests:
name:'True Positive Test'
 attack_data:
  data: https://raw.githubusercontent.com/splunk/attack_data/master/datasets/attack_techniques/T1218/living_off_the_land/lolbinrisk.log
  source: lotl
  sourcetype: stash
manual_test:None

Related Analytic Stories


Living Off The Land