name: Detect PsExec With accepteula Flag
id: b89919ed-fe5f-492c-b139-151xb162040e
version: 3
date: '2020-11-10'
author: Bhavin Patel, Splunk
type: batch
datamodel:
- Endpoint
description: This search looks for events where `PsExec.exe` is run with the `accepteula`
  flag in the command line. PsExec is a built-in Windows utility that enables you
  to execute processes on other systems. It is fully interactive for console applications.
  This tool is widely used for launching interactive command prompts on remote systems.
  Threat actors leverage this extensively for executing code on compromised systems.
  If an attacker is running PsExec for the first time, they will be prompted to accept
  the end-user license agreement (EULA), which can be passed as the argument `accepteula`
  within the command line.
search: '| tstats `security_content_summariesonly` values(Processes.process) as process
  min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes
  where Processes.process=*psexec* Processes.process=*accepteula* by Processes.process_name
  Processes.dest  Processes.parent_process_name | `drop_dm_object_name(Processes)`|
  `security_content_ctime(firstTime)`| `security_content_ctime(lastTime)` | `detect_psexec_with_accepteula_flag_filter`'
how_to_implement: You must be ingesting data that records process activity from your
  hosts to populate the Endpoint data model in the Processes node. You must also be
  ingesting logs with both the process name and command line from your endpoints.
  The command-line arguments are mapped to the "process" field in the Endpoint data
  model.
known_false_positives: Administrators can leverage PsExec for accessing remote systems
  and might pass `accepteula` as an argument if they are running this tool for the
  first time. However, it is not likely that you'd see multiple occurrences of this
  event on a machine
references: []
tags:
  analytic_story:
  - SamSam Ransomware
  - DHS Report TA18-074A
  - HAFNIUM Group
  asset_type: Endpoint
  automated_detection_testing: passed
  cis20:
  - CIS 8
  dataset:
  - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1021.002/atomic_red_team/windows-sysmon.log
  kill_chain_phases:
  - Actions on Objectives
  mitre_attack_id:
  - T1021.002
  nist:
  - PR.PT
  - DE.CM
  product:
  - Splunk Enterprise
  - Splunk Enterprise Security
  - Splunk Cloud
  required_fields:
  - _time
  - Processes.process
  - Processes.process_name
  - Processes.dest
  - Processes.parent_process_name
  security_domain: endpoint
