From ecfb99efdf02b714bac834fa047183ae63c73542 Mon Sep 17 00:00:00 2001 From: research bot Date: Wed, 6 Feb 2019 21:53:17 +0000 Subject: [PATCH] updating src files --- src/default/analytic_stories.conf | 10 +- src/default/analyticstories.conf | 798 ++++----- src/default/savedsearches.conf | 2690 ++++++++++++++--------------- 3 files changed, 1749 insertions(+), 1749 deletions(-) diff --git a/src/default/analytic_stories.conf b/src/default/analytic_stories.conf index cac2a53275..818ea2a1c8 100644 --- a/src/default/analytic_stories.conf +++ b/src/default/analytic_stories.conf @@ -241,7 +241,7 @@ data_models = ["Application_State", "Authentication", "Network_Resolution", "Net description = Detect and investigate tactics, techniques, and procedures leveraged by attackers to establish and operate command and control channels. Implants installed by attackers on compromised endpoints use these channels to receive instructions and send data back to the malicious operators. id = 943773c6-c4de-4f38-89a8-0b92f98804d8 version = 1.0 -mappings = {"mitre_attack": ["Command and Control", "Exfiltration Over Command and Control Channel", "Standard Non-Application Layer Protocol", "Commonly Used Port", "Exfiltration Over Alternative Protocol", "Exfiltration", "Standard Application Layer Protocol", "Defense Evasion"], "cis20": ["CIS 8", "CIS 9", "CIS 11", "CIS 12", "CIS 13", "CIS 3", "CIS 1"], "kill_chain_phases": ["Command and Control", "Actions on Objectives", "Delivery"], "nist": ["ID.AM", "PR.DS", "PR.IP", "PR.PT", "PR.AC", "DE.AE", "DE.CM"]} +mappings = {"mitre_attack": ["Command and Control", "Exfiltration Over Command and Control Channel", "Standard Non-Application Layer Protocol", "Commonly Used Port", "Exfiltration Over Alternative Protocol", "Exfiltration", "Standard Application Layer Protocol", "Defense Evasion"], "cis20": ["CIS 8", "CIS 9", "CIS 11", "CIS 12", "CIS 13", "CIS 3", "CIS 1"], "kill_chain_phases": ["Command and Control", "Delivery", "Actions on Objectives"], "nist": ["ID.AM", "PR.DS", "PR.IP", "PR.PT", "PR.AC", "DE.AE", "DE.CM"]} modification_date = 2018-07-24 reference = ["https://attack.mitre.org/wiki/Command_and_Control", "https://searchsecurity.techtarget.com/feature/Command-and-control-servers-The-puppet-masters-that-govern-malware"] providing_technologies = ["AWS", "Bluecoat", "Bro", "Carbon Black Response", "CrowdStrike Falcon", "Linux", "Microsoft Windows", "Palo Alto Firewall", "Splunk Enterprise Security", "Splunk Stream", "Sysmon", "Tanium", "Ziften", "macOS"] @@ -368,7 +368,7 @@ data_models = ["Application_State", "Authentication", "Email", "Endpoint", "Netw description = Detect rarely used executables, specific registry paths that may confer malware survivability and persistence, instances where cmd.exe is used to launch script interpreters, and other indicators that the Emotet financial malware has compromised your environment. id = bb9f5ed2-916e-4364-bb6d-91c310efcf52 version = 1.0 -mappings = {"mitre_attack": ["Third-party Software", "AppInit DLLs", "Commonly Used Port", "Command-Line Interface", "Registry Run Keys / Start Folder", "Persistence", "Defense Evasion", "Execution", "Authentication Package", "Account Discovery"], "cis20": ["CIS 7", "CIS 12", "CIS 2", "CIS 3", "CIS 8"], "kill_chain_phases": ["Exploitation", "Actions on Objectives", "Delivery", "Installation", "Command and Control"], "nist": ["ID.AM", "PR.DS", "PR.IP", "PR.PT", "DE.AE", "DE.CM"]} +mappings = {"mitre_attack": ["Third-party Software", "AppInit DLLs", "Commonly Used Port", "Command-Line Interface", "Registry Run Keys / Start Folder", "Persistence", "Defense Evasion", "Execution", "Authentication Package", "Account Discovery"], "cis20": ["CIS 7", "CIS 12", "CIS 2", "CIS 3", "CIS 8"], "kill_chain_phases": ["Exploitation", "Delivery", "Installation", "Command and Control", "Actions on Objectives"], "nist": ["ID.AM", "PR.DS", "PR.IP", "PR.PT", "DE.AE", "DE.CM"]} modification_date = 2018-12-03 reference = ["https://www.us-cert.gov/ncas/alerts/TA18-201A", "https://www.first.org/resources/papers/conf2017/Advanced-Incident-Detection-and-Threat-Hunting-using-Sysmon-and-Splunk.pdf", "https://www.vkremez.com/2017/05/emotet-banking-trojan-malware-analysis.html"] providing_technologies = ["Bluecoat", "Bro", "Carbon Black Response", "CrowdStrike Falcon", "Linux", "Microsoft Exchange", "Microsoft Windows", "Palo Alto Firewall", "Splunk Enterprise Security", "Splunk Stream", "Sysmon", "Tanium", "Ziften", "macOS"] @@ -698,7 +698,7 @@ data_models = ["Application_State", "Authentication", "Network_Resolution", "Net description = Detect instances of prohibited network traffic allowed in the environment, as well as protocols running on non-standard ports. Both of these types of behaviors typically violate policy and can be leveraged by attackers. id = 6d13121c-90f3-446d-8ac3-27efbbc65218 version = 1.0 -mappings = {"mitre_attack": ["Command and Control", "Exfiltration Over Command and Control Channel", "Commonly Used Port", "Exfiltration Over Alternative Protocol", "Exfiltration", "Defense Evasion"], "cis20": ["CIS 12", "CIS 13", "CIS 8", "CIS 9"], "kill_chain_phases": ["Command and Control", "Actions on Objectives", "Delivery"], "nist": ["PR.PT", "DE.AE", "DE.CM", "PR.AC", "PR.DS"]} +mappings = {"mitre_attack": ["Command and Control", "Exfiltration Over Command and Control Channel", "Commonly Used Port", "Exfiltration Over Alternative Protocol", "Exfiltration", "Defense Evasion"], "cis20": ["CIS 12", "CIS 13", "CIS 8", "CIS 9"], "kill_chain_phases": ["Command and Control", "Delivery", "Actions on Objectives"], "nist": ["PR.PT", "DE.AE", "DE.CM", "PR.AC", "PR.DS"]} modification_date = 2018-07-24 reference = ["http://www.novetta.com/2015/02/advanced-methods-to-detect-advanced-cyber-attacks-protocol-abuse/"] providing_technologies = ["Bluecoat", "Bro", "Linux", "Microsoft Windows", "Palo Alto Firewall", "Splunk Enterprise Security", "Splunk Stream", "macOS"] @@ -766,7 +766,7 @@ data_models = ["Application_State", "Authentication", "Endpoint", "Network_Traff description = Leverage searches that allow you to detect and investigate unusual activities that might relate to the SamSam ransomware, including looking for file writes associated with SamSam, RDP brute force attacks, the presence of files with SamSam ransomware extensions, suspicious psexec use, and more. id = c4b89506-fbcf-4cb7-bfd6-527e54789604 version = 1.0 -mappings = {"mitre_attack": ["Exploitation of Vulnerability", "Execution", "Commonly Used Port", "Command-Line Interface", "Credential Access", "Lateral Movement", "Defense Evasion", "System Information Discovery", "Remote Desktop Protocol", "Discovery"], "cis20": ["CIS 3", "CIS 18", "CIS 8", "CIS 9", "CIS 10", "CIS 12", "CIS 2", "CIS 4", "CIS 16"], "kill_chain_phases": ["Delivery", "Actions on Objectives", "Reconnaissance", "Installation", "Command and Control"], "nist": ["ID.AM", "PR.DS", "ID.RA", "PR.IP", "PR.PT", "PR.AC", "DE.AE", "PR.MA", "DE.CM"]} +mappings = {"mitre_attack": ["Exploitation of Vulnerability", "System Information Discovery", "Commonly Used Port", "Command-Line Interface", "Credential Access", "Lateral Movement", "Defense Evasion", "Execution", "Remote Desktop Protocol", "Discovery"], "cis20": ["CIS 3", "CIS 18", "CIS 8", "CIS 9", "CIS 10", "CIS 12", "CIS 2", "CIS 4", "CIS 16"], "kill_chain_phases": ["Delivery", "Actions on Objectives", "Reconnaissance", "Installation", "Command and Control"], "nist": ["ID.AM", "PR.DS", "ID.RA", "PR.IP", "PR.PT", "PR.AC", "DE.AE", "PR.MA", "DE.CM"]} modification_date = 2018-12-14 reference = ["https://www.crowdstrike.com/blog/an-in-depth-analysis-of-samsam-ransomware-and-boss-spider/", "https://www.sophos.com/en-us/medialibrary/PDFs/technical-papers/SamSam-ransomware-chooses-Its-targets-carefully-wpna.pdf", "https://www.sophos.com/en-us/medialibrary/PDFs/technical-papers/SamSam-The-Almost-Six-Million-Dollar-Ransomware.pdf?cmp=26061"] providing_technologies = ["Apache", "Bluecoat", "Bro", "Carbon Black Response", "CrowdStrike Falcon", "Linux", "Microsoft Windows", "Nessus", "Netbackup", "Palo Alto Firewall", "Splunk Enterprise Security", "Splunk Stream", "Sysmon", "Tanium", "Ziften", "macOS"] @@ -898,7 +898,7 @@ data_models = description = Use the searches in this Analytic Story to monitor your AWS S3 buckets for evidence of anomalous activity and suspicious behaviors, such as detecting open S3 buckets and buckets being accessed from a new IP. The contextual and investigative searches will give you more information, when required. id = 2e8948a5-5239-406b-b56b-6c50w3168af3 version = 2.0 -mappings = {"mitre_attack": ["Exfiltration", "Credential Access", "Execution", "Initial Access"], "cis20": ["CIS 13", "CIS 14"], "kill_chain_phases": ["Actions on Objectives"], "nist": ["DE.CM", "PR.DS", "DE.DP", "PR.AC"]} +mappings = {"mitre_attack": ["Exfiltration", "Credential Access", "Execution", "Initial Access"], "cis20": ["CIS 13", "CIS 14"], "kill_chain_phases": ["Actions on Objectives"], "nist": ["DE.DP", "PR.DS", "DE.CM", "PR.AC"]} modification_date = 2018-11-27 reference = ["https://d0.awsstatic.com/whitepapers/aws-security-best-practices.pdf", "https://www.tripwire.com/state-of-security/security-data-protection/cloud/public-aws-s3-buckets-writable/"] providing_technologies = ["AWS", "Splunk Enterprise Security"] diff --git a/src/default/analyticstories.conf b/src/default/analyticstories.conf index 56ee625a10..6f30ff8606 100644 --- a/src/default/analyticstories.conf +++ b/src/default/analyticstories.conf @@ -1003,15 +1003,14 @@ known_false_positives = It is possible that these logs may be legitimately clear providing_technologies = ["Microsoft Windows"] -[savedsearch://ESCU - Detect Activity Related to Pass the Hash Attacks - Rule] -type = detection -asset_type = Endpoint -confidence = low -explanation = To detect pass the hash activity, we look at all events with event code 4624 or 4625 that specify a logon type 3 (network logons). We are looking for the NtLmSsP account, with a key length set to 0. These indicate lower level protocols that are typically used through Pass the Hash (WMI, SMB, etc.). The search also filters out events with an account name of 'Anonymous' to help reduce false positives. -how_to_implement = To successfully implement this search, you must ingest your Windows Security Event logs and leverage the TA for Windows to extract EventCode, Logon_Process, Logon_Type, Key_Length and Account_Name fields from these events. -annotations = {"mitre_attack": ["Lateral Movement", "Pass the Hash"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} -known_false_positives = Legitimate logon activity by authorized NTLM systems may be detected by this search. Please investigate as appropriate. -providing_technologies = ["Microsoft Windows"] +[savedsearch://ESCU - Get Process Information For Port Activity] +type = investigative +explanation = none +how_to_implement = To successfully implement this search you must be ingesting endpoint data that associates processes with network events. +known_false_positives = None at this time +providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] +earliest_time_offset = 7200 +latest_time_offset = 7200 [savedsearch://ESCU - Create or delete hidden shares using net.exe - Rule] @@ -1035,14 +1034,15 @@ known_false_positives = None at the moment providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Get Process Information For Port Activity] -type = investigative -explanation = none -how_to_implement = To successfully implement this search you must be ingesting endpoint data that associates processes with network events. -known_false_positives = None at this time -providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] -earliest_time_offset = 7200 -latest_time_offset = 7200 +[savedsearch://ESCU - Detect Activity Related to Pass the Hash Attacks - Rule] +type = detection +asset_type = Endpoint +confidence = low +explanation = To detect pass the hash activity, we look at all events with event code 4624 or 4625 that specify a logon type 3 (network logons). We are looking for the NtLmSsP account, with a key length set to 0. These indicate lower level protocols that are typically used through Pass the Hash (WMI, SMB, etc.). The search also filters out events with an account name of 'Anonymous' to help reduce false positives. +how_to_implement = To successfully implement this search, you must ingest your Windows Security Event logs and leverage the TA for Windows to extract EventCode, Logon_Process, Logon_Type, Key_Length and Account_Name fields from these events. +annotations = {"mitre_attack": ["Lateral Movement", "Pass the Hash"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} +known_false_positives = Legitimate logon activity by authorized NTLM systems may be detected by this search. Please investigate as appropriate. +providing_technologies = ["Microsoft Windows"] [savedsearch://ESCU - TOR Traffic - Rule] @@ -1085,15 +1085,14 @@ known_false_positives = None at this time providing_technologies = ["Netbackup"] -[savedsearch://ESCU - Detect API activity from users without MFA - Rule] -type = detection -asset_type = AWS Instance -confidence = medium -explanation = In this search, we query CloudTrail logs and specifically look for events where the multi factor authentication context of the user's session is false which basically means, that the user does not have MFA enabled on AWS. We then filter out all the known AWS service accounts since service accounts typically do not have MFA enabled. The search then creates a table of the first and last time a user without MFA was detected, the values and count of the API calls made, the type of user identity, ARN and the name of the user. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Leverage the support search `Create a list of approved AWS service accounts`: run it once every 30 days to create a list of service accounts and validate them. -annotations = {"mitre_attack": ["Execution"], "cis20": ["CIS 16"], "nist": ["DE.DP", "PR.AC"]} -known_false_positives = Many service accounts configured within an AWS infrastructure do not have multi factor authentication enabled. Please ignore the service accounts, if triggered and instead add them to the aws_service_accounts.csv file to fine tune the detection. It is also possible that the search detects users in your environment using Single Sign-On systems, since the MFA is not handled by AWS. -providing_technologies = ["AWS"] +[savedsearch://ESCU - Get Logon Rights Modifications For Endpoint] +type = investigative +explanation = none +how_to_implement = To successfully implement this search you must be ingesting your Windows event logs +known_false_positives = None at this time +providing_technologies = ["Microsoft Windows"] +earliest_time_offset = 86400 +latest_time_offset = 86400 [savedsearch://ESCU - Identify Systems Creating Remote Desktop Traffic] @@ -1242,11 +1241,14 @@ known_false_positives = There may be other processes in your environment that us providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Baseline of Network ACL Activity by ARN] -type = support -explanation = Use this search to create a baseline for API calls related to network ACLs for the users who initiated this activity. It returns all logged API calls for network activity, pulls out the ARN that initiated each call, and collects the `eventNames` in one-hour groupings. Next, it calculates the number of API calls made per ARN per-hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points for each ARN. This table is stored in a lookup file. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. To add or remove API event names for network ACLs, edit the macro `NetworkACLEvents`. -known_false_positives = None at this time +[savedsearch://ESCU - Detect S3 access from a new IP - Rule] +type = detection +asset_type = S3 Bucket +confidence = low +explanation = Here the subsearch executes first and returns all successful S3 bucket-access attempts (HTTP code "200") within the last hour. It groups the results by the earliest and latest times it has seen a remote IP accessing a particular bucket. It appends this information to the historical data from the lookup file and then recalculates the `firstTime` and `lastTime` field for each remote IP accessing an S3 bucket. Next, it returns only those remote IP addresses that have first been seen accessing a specific bucket within the past hour. This is combined with the main search to return the time, bucket name, source IP, city, and country operations performed, as well as the requested URI of the resource +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your S3 access logs' inputs. This search works best when you run the "Previously Seen S3 Bucket Access by Remote IP" support search once to create a history of previously seen remote IPs and bucket names. +annotations = {"mitre_attack": ["Execution", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13", "CIS 14"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} +known_false_positives = S3 buckets can be accessed from any IP, as long as it can make a successful connection. This will be a false postive, since the search is looking for a new IP within the past hour providing_technologies = ["AWS"] @@ -1327,15 +1329,17 @@ known_false_positives = It's possible for legitimate HTTP requests to be made to providing_technologies = ["Splunk Stream", "Palo Alto Firewall", "Apache", "Bro"] -[savedsearch://ESCU - SMB Traffic Spike - Rule] +[savedsearch://ESCU - AWS Cloud Provisioning From Previously Unseen IP Address - Rule] type = detection -asset_type = Endpoint +asset_type = AWS Instance confidence = medium -explanation = Server Message Block (SMB) traffic, a protocol used for Windows file sharing-activity, is often leveraged by attackers. One example of SMB abuse was the WannaCry ransomware, which leveraged a vulnerability in the SMB protocol to propagate to other systems. Attackers have also used SMB for lateral movement with a target environment and to test credentials against target systems. While SMB is highly prevalent in Windows environments, a spike in SMB traffic may still be indicative of this type of malicious activity. This search looks for a traffic spike in SMB traffic from a particular system. If such a spike is detected, you may want to investigate the source and analyze the cause of the abnormal traffic. -how_to_implement = This search requires you to be ingesting your network traffic logs and populating the `Network_Traffic` data model. -annotations = {"mitre_attack": ["Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} -known_false_positives = A file server may experience high-demand loads that could cause this analytic to trigger. -providing_technologies = ["Bro", "Splunk Stream"] +explanation = The subsearch returns all events with event names that start with "Run" or "Create," and then does a `GeoIP` lookup on the IP address that initiated the action within the last hour. It appends the historical data to those results in the lookup file. Next, it recalculates the `firstTime` and `lastTime` field for each country, region, city, and IP address and outputs this data to the lookup file to update the local cache. It then calculates the `firstTime` and `lastTime` for each city. It returns only those events from IP addresses that have first been seen in the past hour. This is combined with the main search to return the time, user, IP address, city, event name, and error code from the action. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen AWS Provisioning Activity Sources" support search once to create a history of previously seen locations that have provisioned AWS resources. +annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +known_false_positives = This is a strictly behavioral search, so we define "false positive" slightly differently. Every time this fires, it will accurately reflect the first occurrence in the time period you're searching within, plus what is stored in the cache feature. But while there are really no "false positives" in a traditional sense, there is definitely lots of noise.\ +\ + This search will fire any time a new IP address is seen in the **GeoIP** database for any kind of provisioning activity. If you typically do all provisioning from tools inside of your country, there should be few false positives. If you are located in countries where the free version of **MaxMind GeoIP** that ships by default with Splunk has weak resolution (particularly small countries in less economically powerful regions), this may be much less valuable to you. +providing_technologies = ["AWS"] [savedsearch://ESCU - Samsam Test File Write - Rule] @@ -1349,6 +1353,14 @@ known_false_positives = No false positives have been identified. providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] +[savedsearch://ESCU - Previously Seen AWS Cross Account Activity] +type = support +explanation = In this support search, we look for **AssumeRole** events where the requesting account is different from the requested account. The first and last times these events are seen are written to a lookup file. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Validate the user name entries in `previously_seen_aws_cross_account_activity.csv`, a lookup file created by this support search. +known_false_positives = None at this time +providing_technologies = ["AWS"] + + [savedsearch://ESCU - Investigate AWS activities via region name] type = investigative explanation = none @@ -1359,16 +1371,6 @@ earliest_time_offset = 14400 latest_time_offset = 0 -[savedsearch://ESCU - Get EC2 Instance Details by instanceId] -type = contextual -explanation = none -how_to_implement = In order to implement this search, you must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS(version 4.4.0 or later) and configure your AWS description inputs. -known_false_positives = None at this time -providing_technologies = ["AWS"] -earliest_time_offset = 86400 -latest_time_offset = 0 - - [savedsearch://ESCU - AWS Network Access Control List Created with All Open Ports - Rule] type = detection asset_type = AWS Instance @@ -1413,25 +1415,25 @@ known_false_positives = It is possible that your vulnerability scanner is not de providing_technologies = ["Nessus", "Qualys"] -[savedsearch://ESCU - Get Notable History] -type = contextual -explanation = none -how_to_implement = If you are using Enterprise Security you are likely already creating notable events with your correlation rules. No additional configuration is necessary. -known_false_positives = None at this time -providing_technologies = ["Splunk Enterprise Security"] -earliest_time_offset = 864000 -latest_time_offset = 86400 - - -[savedsearch://ESCU - EC2 Instance Started With Previously Unseen AMI - Rule] +[savedsearch://ESCU - Malicious PowerShell Process With Obfuscation Techniques - Rule] type = detection -asset_type = AWS Instance +asset_type = Endpoint confidence = medium -explanation = The subsearch returns the AMI image ID of all successful EC2 instance launches within the last hour and then appends the historical data from the lookup file to those results. It then recalculates the earliest and latest seen time field for each AMI image ID and returns only those AMI image IDs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance id of those systems. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 AMIs" support search once to create a history of previously seen AMIs. -annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -known_false_positives = After a new AMI is created, the first systems created with that AMI will cause this alert to fire. Verify that the AMI being used was created by a legitimate user. -providing_technologies = ["AWS"] +explanation = This search looks for PowerShell processes that are passing command-line arguments with unusual characters (backticks and carets) that are PowerShell specific escape characters. Attackers use this obfuscation technique since it does not affect the functionality of PowerShell and it will bypass standard security controls that look for straight up malicious strings and commands. The search counts the occurrence of these obfuscation characters and lists out destination IPs running these PowerShell commands. +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. +annotations = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} +known_false_positives = These characters might be legitimately on the command-line, but it is not common. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] + + +[savedsearch://ESCU - Get Parent Process Info] +type = investigative +explanation = none +how_to_implement = To successfully implement this search you must be ingesting endpoint data via Microsoft-Windows-Sysmon and extract the Image and Parent Image field. +known_false_positives = None at this time +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +earliest_time_offset = 0 +latest_time_offset = 86400 [savedsearch://ESCU - Processes launching netsh - Rule] @@ -1456,15 +1458,15 @@ known_false_positives = Some of these processes may be used legitimately on web providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Shim Database File Creation - Rule] +[savedsearch://ESCU - Large Volume of DNS ANY Queries - Rule] type = detection -asset_type = Endpoint +asset_type = DNS Servers confidence = high -explanation = This search looks for files being created in `Windows\AppPatch\Custom and Windows\AppPatch\Custom64`, the location where shim databases are installed. It will return all the files created, as well as the time of creation for the first and last file for each endpoint. -how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. -annotations = {"mitre_attack": ["Persistence", "Application Shimming"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} -known_false_positives = Because legitimate shim files are created and used all the time, this event, in itself, is not suspicious. However, if there are other correlating events, it may warrant further investigation. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] +explanation = This search counts the number of DNS ANY queries received in 5 minutes, and generates a Notable Event if the count exceeds a predefined threshold. The search returns the count, the first time, and the last time a DNS packet was observed with the ANY flag set. +how_to_implement = To successfully implement this search you must ensure that DNS data is populating the Network_Resolution data model. +annotations = {"kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 11", "CIS 12"], "nist": ["PR.PT", "DE.AE", "PR.IP"]} +known_false_positives = Legitimate ANY requests may trigger this search, however it is unusual to see a large volume of them under typical circumstances. You may modify the threshold in the search to better suit your environment. +providing_technologies = ["Splunk Stream", "Bro"] [savedsearch://ESCU - Previously Seen EC2 Launches By User] @@ -1508,12 +1510,15 @@ known_false_positives = Administrators may attempt to change the default executi providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Previously Seen AWS Cross Account Activity] -type = support -explanation = In this support search, we look for **AssumeRole** events where the requesting account is different from the requested account. The first and last times these events are seen are written to a lookup file. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Validate the user name entries in `previously_seen_aws_cross_account_activity.csv`, a lookup file created by this support search. -known_false_positives = None at this time -providing_technologies = ["AWS"] +[savedsearch://ESCU - Prohibited Network Traffic Allowed - Rule] +type = detection +asset_type = Endpoint +confidence = medium +explanation = The search looks for traffic marked 'is_prohibited' in the Enterprise Security lookup table 'interesting_ports_lookup', and then determines if any network devices have an associated 'allow' action on that traffic by checking the Network_Traffic data model. +how_to_implement = In order to properly run this search, Splunk needs to ingest data from firewalls or other network control devices that mediate the traffic allowed into an environment. This is necessary so that the search can identify an 'action' taken on the traffic of interest. The search requires the Network_Traffic data model be populated. +annotations = {"mitre_attack": ["Command and Control", "Commonly Used Port", "Exfiltration", "Exfiltration Over Alternative Protocol"], "kill_chain_phases": ["Delivery", "Command and Control"], "cis20": ["CIS 9", "CIS 12"], "nist": ["DE.AE", "PR.AC"]} +known_false_positives = None identified +providing_technologies = ["Palo Alto Firewall", "Bro", "Splunk Stream"] [savedsearch://ESCU - Count of assets by category] @@ -1524,14 +1529,26 @@ known_false_positives = None at this time providing_technologies = ["Splunk Enterprise Security"] -[savedsearch://ESCU - Investigate Web Activity From Host] -type = investigative -explanation = none -how_to_implement = To successfully implement this search you must be ingesting your web traffic and populating the Web data model. -known_false_positives = None at this time -providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] -earliest_time_offset = 3600 -latest_time_offset = 3600 +[savedsearch://ESCU - Suspicious File Write - Rule] +type = detection +asset_type = Endpoint +confidence = high +explanation = This search looks at files being created or modified in the Endpoint file-system data model. The names of those files are checked against an included lookup file, which contains the names of files associated with malware or attack activity. The search returns any files with matching names, along with a note (also specified in the lookup file) that gives or points to more information about the files. +how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. This is typically populated via endpoint detection-and-response products, such as Carbon Black, or via other endpoint data sources, such as Sysmon. The data used for this search is typically generated via logs that report file system reads and writes. In addition, this search leverages an included lookup file that contains the names of the files to watch for, as well as a note to communicate why that file name is being monitored. This lookup file can be edited to add or remove file the file names you want to monitor. +annotations = {"mitre_attack": [], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +known_false_positives = It's possible for a legitimate file to be created with the same name as one noted in the lookup file. Filenames listed in the lookup file should be unique enough that collisions are rare. Looking at the location of the file and the process responsible for the activity can help determine whether or not the activity is legitimate. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] + + +[savedsearch://ESCU - Detect API activity from users without MFA - Rule] +type = detection +asset_type = AWS Instance +confidence = medium +explanation = In this search, we query CloudTrail logs and specifically look for events where the multi factor authentication context of the user's session is false which basically means, that the user does not have MFA enabled on AWS. We then filter out all the known AWS service accounts since service accounts typically do not have MFA enabled. The search then creates a table of the first and last time a user without MFA was detected, the values and count of the API calls made, the type of user identity, ARN and the name of the user. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Leverage the support search `Create a list of approved AWS service accounts`: run it once every 30 days to create a list of service accounts and validate them. +annotations = {"mitre_attack": ["Execution"], "cis20": ["CIS 16"], "nist": ["DE.DP", "PR.AC"]} +known_false_positives = Many service accounts configured within an AWS infrastructure do not have multi factor authentication enabled. Please ignore the service accounts, if triggered and instead add them to the aws_service_accounts.csv file to fine tune the detection. It is also possible that the search detects users in your environment using Single Sign-On systems, since the MFA is not handled by AWS. +providing_technologies = ["AWS"] [savedsearch://ESCU - Previously Seen Running Windows Services] @@ -1574,15 +1591,12 @@ earliest_time_offset = 7200 latest_time_offset = 7200 -[savedsearch://ESCU - Detect Prohibited Applications Spawning cmd.exe - Rule] -type = detection -asset_type = Endpoint -confidence = medium -explanation = Obtaining access to the Command-Line Interface (CLI) is typically a primary attacker goal. Once an attacker has obtained the ability to execute code on a target system, they will often further manipulate the system via commands passed to the CLI. It is also unusual for many applications to spawn a command shell during normal operation, while it is often observed if an application has been compromised in some way. As such, it is often beneficial to look for cmd.exe being executed by processes that are often targeted for exploitation, or that would not spawn cmd.exe in any other circumstances. A lookup file is provided to easily modify the processes that are being watched for execution of cmd.exe. -how_to_implement = You must be ingesting data that records process activity from your hosts and populates the Endpoint data model with the resultant dataset. This search includes a lookup file, `prohibited_apps_launching_cmd.csv`, that contains a list of processes that should not be spawning cmd.exe. You can modify this lookup to better suit your environment. -annotations = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -known_false_positives = There are circumstances where an application may legitimately execute and interact with the Windows command-line interface. Investigate and modify the lookup file, as appropriate. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - Previously Seen AWS Regions] +type = support +explanation = In this support search, we create a table of the first time (earliest) and most recent time (latest) that this region has been seen in our dataset, grouped by the value `awsRegion`. We only look for those events where an instance has been started. All of these entries will be added to the `previously_seen_aws_regions.csv` lookup file, which will act like a baseline for detections. Please validate the entries of region names in the lookup file. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. +known_false_positives = None at this time +providing_technologies = ["AWS"] [savedsearch://ESCU - Detect USB device insertion - Rule] @@ -1596,14 +1610,14 @@ known_false_positives = Legitimate USB activity will also be detected. Please ve providing_technologies = ["Microsoft Windows"] -[savedsearch://ESCU - Get Backup Logs For Endpoint] +[savedsearch://ESCU - Get User Information from Identity Table] type = contextual explanation = none -how_to_implement = You must be ingesting your backup logs. +how_to_implement = To successfully implement this search you must have populated the identity table with information about your users. known_false_positives = None at this time -providing_technologies = ["Netbackup"] -earliest_time_offset = 604800 -latest_time_offset = 0 +providing_technologies = ["Splunk Enterprise Security"] +earliest_time_offset = 864000 +latest_time_offset = 86400 [savedsearch://ESCU - Get DNS Server History for a host] @@ -1700,12 +1714,15 @@ known_false_positives = None identified providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Previously Seen AWS Regions] -type = support -explanation = In this support search, we create a table of the first time (earliest) and most recent time (latest) that this region has been seen in our dataset, grouped by the value `awsRegion`. We only look for those events where an instance has been started. All of these entries will be added to the `previously_seen_aws_regions.csv` lookup file, which will act like a baseline for detections. Please validate the entries of region names in the lookup file. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. -known_false_positives = None at this time -providing_technologies = ["AWS"] +[savedsearch://ESCU - Detect Prohibited Applications Spawning cmd.exe - Rule] +type = detection +asset_type = Endpoint +confidence = medium +explanation = Obtaining access to the Command-Line Interface (CLI) is typically a primary attacker goal. Once an attacker has obtained the ability to execute code on a target system, they will often further manipulate the system via commands passed to the CLI. It is also unusual for many applications to spawn a command shell during normal operation, while it is often observed if an application has been compromised in some way. As such, it is often beneficial to look for cmd.exe being executed by processes that are often targeted for exploitation, or that would not spawn cmd.exe in any other circumstances. A lookup file is provided to easily modify the processes that are being watched for execution of cmd.exe. +how_to_implement = You must be ingesting data that records process activity from your hosts and populates the Endpoint data model with the resultant dataset. This search includes a lookup file, `prohibited_apps_launching_cmd.csv`, that contains a list of processes that should not be spawning cmd.exe. You can modify this lookup to better suit your environment. +annotations = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +known_false_positives = There are circumstances where an application may legitimately execute and interact with the Windows command-line interface. Investigate and modify the lookup file, as appropriate. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] [savedsearch://ESCU - WMI Temporary Event Subscription - Rule] @@ -1813,15 +1830,15 @@ known_false_positives = It's possible that a legitimate file could be created wi providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -[savedsearch://ESCU - Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments - Rule] +[savedsearch://ESCU - Detect PsExec With accepteula Flag - Rule] type = detection asset_type = Endpoint confidence = medium -explanation = This search looks for PowerShell processes that have a number of suspicious flags on the command-line. It is looking for flags are passing encoded commands on the command-line. The flags `-EncodedCommand` and `-enc` are two different possible flags that can be used to pass base64 encoded commands to PowerShell. The `*-Exec*` flag looks to see it the default execution policy of PowerShell is being overridden, while the `*-NonI*` flag tells the PowerShell process that this will be a noninteractive process, so the user doesn't know about the process. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. -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. -annotations = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} -known_false_positives = Legitimate process can have this combination of command-line options, but it's not common. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +explanation = In this search, we are looking for the PsExec process with `accepteula` on the command line. +how_to_implement = To successfully implement this search, you need to be ingesting logs with the process name, command-line arguments, and parent process from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon Technology Add-on (TA). +annotations = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +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 +providing_technologies = ["Sysmon"] [savedsearch://ESCU - Malicious PowerShell Process - Execution Policy Bypass - Rule] @@ -1909,15 +1926,14 @@ known_false_positives = None identified providing_technologies = ["Microsoft Exchange"] -[savedsearch://ESCU - Malicious PowerShell Process With Obfuscation Techniques - Rule] -type = detection -asset_type = Endpoint -confidence = medium -explanation = This search looks for PowerShell processes that are passing command-line arguments with unusual characters (backticks and carets) that are PowerShell specific escape characters. Attackers use this obfuscation technique since it does not affect the functionality of PowerShell and it will bypass standard security controls that look for straight up malicious strings and commands. The search counts the occurrence of these obfuscation characters and lists out destination IPs running these PowerShell commands. -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. -annotations = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} -known_false_positives = These characters might be legitimately on the command-line, but it is not common. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - Get Notable History] +type = contextual +explanation = none +how_to_implement = If you are using Enterprise Security you are likely already creating notable events with your correlation rules. No additional configuration is necessary. +known_false_positives = None at this time +providing_technologies = ["Splunk Enterprise Security"] +earliest_time_offset = 864000 +latest_time_offset = 86400 [savedsearch://ESCU - Create a list of approved AWS service accounts] @@ -1979,14 +1995,6 @@ earliest_time_offset = 3600 latest_time_offset = 86400 -[savedsearch://ESCU - Systems Ready for Spectre-Meltdown Windows Patch] -type = support -explanation = This search looks to see if a registry key was created at `HKLM\Software\Microsoft\Windows\CurrentVersion\QualityCompat`. It will tell you when it was created and, if possible, what process created it. -how_to_implement = You need to be ingesting logs with both the process name and command-line from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. -known_false_positives = None at this time -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] - - [savedsearch://ESCU - Detect hosts connecting to dynamic domain providers - Rule] type = detection asset_type = Endpoint @@ -2028,14 +2036,37 @@ known_false_positives = None identified providing_technologies = ["Microsoft Windows"] -[savedsearch://ESCU - Get All AWS Activity From City] -type = investigative -explanation = none -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. -known_false_positives = None at this time +[savedsearch://ESCU - Detect Spike in AWS API Activity - Rule] +type = detection +asset_type = AWS Instance +confidence = medium +explanation = This search and its corresponding subsearch run through a series of steps, as per the following: \ +\ +1. Retrieves all the AWS CloudTrail log entries that have recorded AWS API calls.\ +\ +1. Kicks off a subsearch that retrieves the same data and pulls out the ARN into a more friendly format.\ +\ +1. Counts the number of API calls per ARN.\ +\ +1. Loads the cache file that contains the number of data points, the count from the latest hour, the API call average, and the standard deviation for each ARN.\ +\ +1. Drops the count from the latest hour, since it is not necessary, and merges the rest of the data with the results of the stats command. \ +\ +1. Renames `apiCalls` as `latestCount`.\ +\ +1. Calculates the new average value for each ARN with the latest count, weighting the past much more heavily than the current hour. It does the same for the standard deviation--weighting the past more heavily than the current.\ +\ +1. Updates the cache file with the latest results.\ +\ +1. Sets the minimum threshold for the number of data points and sets the number of standard deviations away from the mean it must be to be considered a spike.\ +\ +1. Makes a determination regarding whether or not the current count is a spike by checking to see if the minimum data-point threshold has been met and the count is a sufficient number of standard deviations away from the average.\ +\ +1. Filters out anything that it determines is not a spike and returns the list of ARNs to the main search. The main search subsequently gets the names of all the API calls, the number of unique API calls, and the total number of API calls for each of these ARNs. Finally, it looks up the average and standard deviation and returns both the average and the number of standard deviations the spike is from the average. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. You can modify `dataPointThreshold` and `deviationThreshold` to better fit your environment. The `dataPointThreshold` variable is the minimum number of data points required to have a statistically significant amount of data to determine. The `deviationThreshold` variable is the number of standard deviations away from the mean that the value must be to be considered a spike. +annotations = {"mitre_attack": ["Credential Access", "Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 16"], "nist": ["DE.DP", "DE.CM", "PR.AC"]} +known_false_positives = providing_technologies = ["AWS"] -earliest_time_offset = 14400 -latest_time_offset = 0 [savedsearch://ESCU - Email files written outside of the Outlook directory - Rule] @@ -2082,37 +2113,14 @@ known_false_positives = It is possible that a legitimate user is experiencing an providing_technologies = ["Microsoft Windows"] -[savedsearch://ESCU - Detect Spike in AWS API Activity - Rule] -type = detection -asset_type = AWS Instance -confidence = medium -explanation = This search and its corresponding subsearch run through a series of steps, as per the following: \ -\ -1. Retrieves all the AWS CloudTrail log entries that have recorded AWS API calls.\ -\ -1. Kicks off a subsearch that retrieves the same data and pulls out the ARN into a more friendly format.\ -\ -1. Counts the number of API calls per ARN.\ -\ -1. Loads the cache file that contains the number of data points, the count from the latest hour, the API call average, and the standard deviation for each ARN.\ -\ -1. Drops the count from the latest hour, since it is not necessary, and merges the rest of the data with the results of the stats command. \ -\ -1. Renames `apiCalls` as `latestCount`.\ -\ -1. Calculates the new average value for each ARN with the latest count, weighting the past much more heavily than the current hour. It does the same for the standard deviation--weighting the past more heavily than the current.\ -\ -1. Updates the cache file with the latest results.\ -\ -1. Sets the minimum threshold for the number of data points and sets the number of standard deviations away from the mean it must be to be considered a spike.\ -\ -1. Makes a determination regarding whether or not the current count is a spike by checking to see if the minimum data-point threshold has been met and the count is a sufficient number of standard deviations away from the average.\ -\ -1. Filters out anything that it determines is not a spike and returns the list of ARNs to the main search. The main search subsequently gets the names of all the API calls, the number of unique API calls, and the total number of API calls for each of these ARNs. Finally, it looks up the average and standard deviation and returns both the average and the number of standard deviations the spike is from the average. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. You can modify `dataPointThreshold` and `deviationThreshold` to better fit your environment. The `dataPointThreshold` variable is the minimum number of data points required to have a statistically significant amount of data to determine. The `deviationThreshold` variable is the number of standard deviations away from the mean that the value must be to be considered a spike. -annotations = {"mitre_attack": ["Credential Access", "Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 16"], "nist": ["DE.DP", "DE.CM", "PR.AC"]} -known_false_positives = -providing_technologies = ["AWS"] +[savedsearch://ESCU - Get Vulnerability Logs For Endpoint] +type = contextual +explanation = none +how_to_implement = You need to be ingesting the logs from your vulnerability scanner. +known_false_positives = None at this time +providing_technologies = ["Nessus"] +earliest_time_offset = 604800 +latest_time_offset = 0 [savedsearch://ESCU - RunDLL Loading DLL By Ordinal - Rule] @@ -2137,17 +2145,6 @@ known_false_positives = The false-positive rate will vary based on how you set t providing_technologies = ["Bro", "Splunk Stream"] -[savedsearch://ESCU - Large Volume of DNS ANY Queries - Rule] -type = detection -asset_type = DNS Servers -confidence = high -explanation = This search counts the number of DNS ANY queries received in 5 minutes, and generates a Notable Event if the count exceeds a predefined threshold. The search returns the count, the first time, and the last time a DNS packet was observed with the ANY flag set. -how_to_implement = To successfully implement this search you must ensure that DNS data is populating the Network_Resolution data model. -annotations = {"kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 11", "CIS 12"], "nist": ["PR.PT", "DE.AE", "PR.IP"]} -known_false_positives = Legitimate ANY requests may trigger this search, however it is unusual to see a large volume of them under typical circumstances. You may modify the threshold in the search to better suit your environment. -providing_technologies = ["Splunk Stream", "Bro"] - - [savedsearch://ESCU - Detect Spike in blocked Outbound Traffic from your AWS - Rule] type = detection asset_type = AWS Instance @@ -2188,17 +2185,6 @@ known_false_positives = If the Identity_Management data model is not updated reg providing_technologies = ["Active Directory"] -[savedsearch://ESCU - Detect S3 access from a new IP - Rule] -type = detection -asset_type = S3 Bucket -confidence = low -explanation = Here the subsearch executes first and returns all successful S3 bucket-access attempts (HTTP code "200") within the last hour. It groups the results by the earliest and latest times it has seen a remote IP accessing a particular bucket. It appends this information to the historical data from the lookup file and then recalculates the `firstTime` and `lastTime` field for each remote IP accessing an S3 bucket. Next, it returns only those remote IP addresses that have first been seen accessing a specific bucket within the past hour. This is combined with the main search to return the time, bucket name, source IP, city, and country operations performed, as well as the requested URI of the resource -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your S3 access logs' inputs. This search works best when you run the "Previously Seen S3 Bucket Access by Remote IP" support search once to create a history of previously seen remote IPs and bucket names. -annotations = {"mitre_attack": ["Execution", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13", "CIS 14"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} -known_false_positives = S3 buckets can be accessed from any IP, as long as it can make a successful connection. This will be a false postive, since the search is looking for a new IP within the past hour -providing_technologies = ["AWS"] - - [savedsearch://ESCU - Detect Large Outbound ICMP Packets - Rule] type = detection asset_type = Endpoint @@ -2220,23 +2206,26 @@ earliest_time_offset = 86400 latest_time_offset = 86400 -[savedsearch://ESCU - Identify Systems Using Remote Desktop] -type = support -explanation = This search counts the numbers of times the remote desktop process, mstsc.exe, has run on each system. It does this by looking for the process in the Application_State data model. -how_to_implement = To successfully implement this search you must be ingesting endpoint data that records process activity. -known_false_positives = None at this time -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - Abnormally High AWS Instances Terminated by User - Rule] +type = detection +asset_type = AWS Instance +confidence = medium +explanation = In this search, we query CloudTrail logs to look for events where an instance is successfully terminated by a particular user. Since we want to detect a high number of instances terminated within a short period, we create event buckets for 10-minute windows. We then calculate the total number of instances terminated by a particular user, as well as the average- and standard-deviation values. Assign a `threshold_value` in the search. Try starting with 3 (but it will likely need to be tweaked for your environment). The `eval` function will set the outlier to 1 if the number of instances is greater than the average number of instances terminated, added to the multiplied value of threshold and standard deviation. We then filter out outliers with a value of 1 and show only those instance-termination events that happened within the previous 10 minutes. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. +annotations = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["DE.DP", "DE.AE"]} +known_false_positives = Many service accounts configured with your AWS infrastructure are known to exhibit this behavior. Please adjust the threshold values and filter out service accounts from the output. Always verify whether this search alerted on a human user. +providing_technologies = ["AWS"] -[savedsearch://ESCU - WMI Permanent Event Subscription - Rule] +[savedsearch://ESCU - Scheduled Task Name Used by Dragonfly Threat Actors - Rule] type = detection asset_type = Endpoint confidence = medium -explanation = Attackers are increasingly abusing Windows Management Infrastructure (WMI) for stealth, persistence, lateral movement, or just to leverage its functionality. This search looks for the creation of a WMI event subscription by watching for Windows event ID 5861. -how_to_implement = To successfully implement this search, you must be ingesting the Windows WMI activity logs. This can be done by adding a stanza to inputs.conf on the system generating logs with a title of [WinEventLog://Microsoft-Windows-WMI-Activity/Operational]. -annotations = {"mitre_attack": ["Execution", "Windows Management Instrumentation", "Persistence", "Windows Management Instrumentation Event Subscription"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} -known_false_positives = Although unlikely, administrators may use event subscriptions for legitimate purposes. -providing_technologies = ["Microsoft Windows"] +explanation = The search looks for execution of schtasks.exe with parameters that indicate that a specific task "reset," whose name is associated with the Dragonfly threat actor--has been created or deleted. Schtasks.exe is a native Windows program that is used to schedule tasks on local or remote systems. Attackers often leverage this capability to schedule the execution of commands or establish persistence. +how_to_implement = You must be ingesting endpoint data that tracks process activity, including parent-child relationships from your endpoints to populate the Endpoint data model in the Processes node. The command-line arguments are mapped to the "process" field in the Endpoint data model. +annotations = {"mitre_attack": ["Execution", "Scheduled Task"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3"], "nist": ["PR.IP"]} +known_false_positives = No known false positives +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] [savedsearch://ESCU - Investigate Web Activity From src_ip] @@ -2277,14 +2266,14 @@ known_false_positives = None at this time providing_technologies = ["AWS"] -[savedsearch://ESCU - Detect New Open S3 buckets - Rule] +[savedsearch://ESCU - Detect new API calls from user roles - Rule] type = detection -asset_type = S3 Bucket +asset_type = AWS Instance confidence = medium -explanation = This search queries CloudTrail logs for events with S3 bucket access controls given to the "All Users" group, which allows anyone in the world access to the resource. This search generates a table displaying the time when the bucket was made public, the permission of the S3 bucket, the bucket name, and the ARN of the user who created the bucket. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), and then configure your CloudTrail inputs. The threshold value should be tuned to your environment. -annotations = {"mitre_attack": ["Execution", "Initial Access", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} -known_false_positives = While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group. +explanation = The subsearch will execute first and return the user roles and names of the API calls completed within the last hour, where the type of user identity is `AssumedRole`. It then appends the historical data to those results in the lookup file. Next, it recalculates the `earliest` and `latest` fields for each user role, as well as the name of the API call, and returns only those roles and API calls that have first been seen in the past hour. This is combined with the main search to return the values of API calls, name of the user role, and the earliest and latest time of this activity. It is worth noting that the name of the role of a particular user is parsed as "userName" in the CloudTrail logs. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously seen API call per user roles in CloudTrail" support search once to create a history of previously seen user roles. +annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +known_false_positives = It is possible that there are legitimate user roles making new or infrequently used API calls in your infrastructure, causing the search to trigger. providing_technologies = ["AWS"] @@ -2309,28 +2298,25 @@ known_false_positives = It's possible that legitimate traffic will have long URL providing_technologies = ["Splunk Stream", "Bro"] -[savedsearch://ESCU - AWS Cloud Provisioning From Previously Unseen IP Address - Rule] -type = detection -asset_type = AWS Instance -confidence = medium -explanation = The subsearch returns all events with event names that start with "Run" or "Create," and then does a `GeoIP` lookup on the IP address that initiated the action within the last hour. It appends the historical data to those results in the lookup file. Next, it recalculates the `firstTime` and `lastTime` field for each country, region, city, and IP address and outputs this data to the lookup file to update the local cache. It then calculates the `firstTime` and `lastTime` for each city. It returns only those events from IP addresses that have first been seen in the past hour. This is combined with the main search to return the time, user, IP address, city, event name, and error code from the action. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen AWS Provisioning Activity Sources" support search once to create a history of previously seen locations that have provisioned AWS resources. -annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -known_false_positives = This is a strictly behavioral search, so we define "false positive" slightly differently. Every time this fires, it will accurately reflect the first occurrence in the time period you're searching within, plus what is stored in the cache feature. But while there are really no "false positives" in a traditional sense, there is definitely lots of noise.\ -\ - This search will fire any time a new IP address is seen in the **GeoIP** database for any kind of provisioning activity. If you typically do all provisioning from tools inside of your country, there should be few false positives. If you are located in countries where the free version of **MaxMind GeoIP** that ships by default with Splunk has weak resolution (particularly small countries in less economically powerful regions), this may be much less valuable to you. -providing_technologies = ["AWS"] +[savedsearch://ESCU - Get Web Session Information via session_id] +type = investigative +explanation = none +how_to_implement = This search leverages data extracted from Stream:HTTP. You must configure the HTTP stream using the Splunk Stream App on your Splunk Stream deployment server. +known_false_positives = None at this time +providing_technologies = ["Splunk Stream"] +earliest_time_offset = 3600 +latest_time_offset = 3600 -[savedsearch://ESCU - Remote Desktop Network Traffic - Rule] +[savedsearch://ESCU - Execution of File With Spaces Before Extension - Rule] type = detection asset_type = Endpoint confidence = medium -explanation = This search finds systems that do not commonly communicate use remote desktop. It does this by filtering out all systems that have the "common_rdp_source" or "common_rdp_destination" category applied to that system. Categories are applied to systems using the Assets and Identity framework. -how_to_implement = To successfully implement this search you need to identify systems that commonly originate remote desktop traffic and that commonly receive remote desktop traffic. You can use the included support search "Identify Systems Creating Remote Desktop Traffic" to identify systems that originate the traffic and the search "Identify Systems Receiving Remote Desktop Traffic" to identify systems that receive a lot of remote desktop traffic. After identifying these systems, you will need to add the "common_rdp_source" or "common_rdp_destination" category to that system depending on the usage, using the Enterprise Security Assets and Identities framework. This can be done by adding an entry in the assets.csv file located in SA-IdentityManagement/lookups. -annotations = {"mitre_attack": ["Lateral Movement", "Remote Desktop Protocol", "Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 9", "CIS 16"], "nist": ["DE.AE", "PR.AC", "PR.IP"]} -known_false_positives = Remote Desktop may be used legitimately by users on the network. -providing_technologies = ["Bro", "Splunk Stream"] +explanation = This search uses the endpoint data model to look for process names with at least five spaces between the file name and its extension. +how_to_implement = To successfully implement this search, you must be ingesting data that records process activity from your hosts to populate the endpoint data model in the processes node. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. +annotations = {"mitre_attack": ["Execution", "Persistence", "Change Default File Association"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 8"], "nist": ["DE.CM", "PR.PT", "PR.IP"]} +known_false_positives = None identified. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] [savedsearch://ESCU - Investigate Network Traffic From src_ip] @@ -2354,14 +2340,11 @@ known_false_positives = There are many legitimate applications that must execute providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -[savedsearch://ESCU - EC2 Instance Modified With Previously Unseen User - Rule] -type = detection -asset_type = AWS Instance -confidence = medium -explanation = The subsearch returns the ARNs of all successful EC2 instance modifications within the last hour and then appends the historical data in the lookup file to those results. EC2 modification APIs are defined by the macro `ec2ModificationAPIs`. The search then recalculates the `firstTime` and `lastTime` field for each ARN and returns only those ARNs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance ID of those systems. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 Launches By User" support search once to create a history of previously seen ARNs. To add or remove APIs that modify an EC2 instance, edit the macro `ec2ModificationAPIs`. -annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -known_false_positives = It's possible that a new user will start to modify EC2 instances when they haven't before for any number of reasons. Verify with the user that is modifying instances that this is the intended behavior. +[savedsearch://ESCU - Baseline of Network ACL Activity by ARN] +type = support +explanation = Use this search to create a baseline for API calls related to network ACLs for the users who initiated this activity. It returns all logged API calls for network activity, pulls out the ARN that initiated each call, and collects the `eventNames` in one-hour groupings. Next, it calculates the number of API calls made per ARN per-hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points for each ARN. This table is stored in a lookup file. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. To add or remove API event names for network ACLs, edit the macro `NetworkACLEvents`. +known_false_positives = None at this time providing_technologies = ["AWS"] @@ -2386,16 +2369,6 @@ known_false_positives = It is possible that an administrator created and deleted providing_technologies = ["Microsoft Windows"] -[savedsearch://ESCU - Get Vulnerability Logs For Endpoint] -type = contextual -explanation = none -how_to_implement = You need to be ingesting the logs from your vulnerability scanner. -known_false_positives = None at this time -providing_technologies = ["Nessus"] -earliest_time_offset = 604800 -latest_time_offset = 0 - - [savedsearch://ESCU - Remote WMI Command Attempt - Rule] type = detection asset_type = Endpoint @@ -2474,6 +2447,14 @@ known_false_positives = It's possible that a user will start to create EC2 insta providing_technologies = ["AWS"] +[savedsearch://ESCU - Identify Systems Using Remote Desktop] +type = support +explanation = This search counts the numbers of times the remote desktop process, mstsc.exe, has run on each system. It does this by looking for the process in the Application_State data model. +how_to_implement = To successfully implement this search you must be ingesting endpoint data that records process activity. +known_false_positives = None at this time +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] + + [savedsearch://ESCU - Previously seen command line arguments] type = support explanation = In this support search, we look for command-line arguments using the parameter `/c` to execute processes and create an initial baseline cache for the previous 30 days. This will include the earliest and latest times a particular command-line argument is seen in our dataset, grouped by the command-line value. @@ -2482,38 +2463,6 @@ known_false_positives = None at this time providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Detect Mimikatz Via PowerShell And EventCode 4663 - Rule] -type = detection -asset_type = Windows -confidence = medium -explanation = This search looks for Windows Event Code 4663 (object access), where the process performing the access is PowerShell.exe, the target process of the access is lsass.exe, and the access mask is given as 0x10. This is consistent with the use of PowerShell to execute Mimikatz using sekurlsa::logonpasswords. It will return the host where the activity occurred, the process and associated id, the enabled privilege, and the message in the event. -how_to_implement = You must be ingesting Windows Security logs. You must also enable the account change auditing here: http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/MonitorWindowseventlogdata. Additionally, this search requires you to enable your Group Management Audit Logs in your Local Windows Security Policy and to be ingesting those logs. More information on how to enable them can be found here: http://whatevernetworks.com/auditing-group-membership-changes-in-active-directory/. Finally, please make sure that the local administrator group name is "Administrators" to be able to look for the right group membership changes. -annotations = {"mitre_attack": ["Credential Access", "Credential Dumping"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.IP", "PR.AC", "DE.CM"]} -known_false_positives = The activity may be legitimate. PowerShell is often used by administrators to perform various tasks, and it's possible this event could be generated in those cases. In these cases, false positives should be fairly obvious and you may need to tweak the search to eliminate noise. -providing_technologies = ["Microsoft Windows"] - - -[savedsearch://ESCU - Registry Keys for Creating SHIM Databases - Rule] -type = detection -asset_type = Endpoint -confidence = medium -explanation = In this search, we look for modifications to registry keys used for shim databases on Microsoft platforms via the object_category and object_path field in the Change_Analysis data model and give you the destination, command used to initiate the change, the user who conducted this activity, the resource affected(object), and the whole path of the object. An application compatibility shim is a small library that transparently intercepts an API (via hooking), changes the parameters passed, handles the operation itself, or redirects the operation elsewhere, such as additional code stored on a system. This capability can be also leveraged by attackers to create and store malicious files in a shim database as observed in CARBANAK backdoor. -how_to_implement = To successfully implement this search, you must populate the Change_Analysis data model. This is typically populated via endpoint detection and response products, such as Carbon Black or other endpoint data sources such as Sysmon. The data used for this search is typically generated via logs that report reads and writes to the registry. -annotations = {"mitre_attack": ["Persistence", "Application Shimming"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -known_false_positives = There are many legitimate applications that leverage shim databases for compatibility purposes for legacy applications -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] - - -[savedsearch://ESCU - Get User Information from Identity Table] -type = contextual -explanation = none -how_to_implement = To successfully implement this search you must have populated the identity table with information about your users. -known_false_positives = None at this time -providing_technologies = ["Splunk Enterprise Security"] -earliest_time_offset = 864000 -latest_time_offset = 86400 - - [savedsearch://ESCU - DNS Query Requests Resolved by Unauthorized DNS Servers - Rule] type = detection asset_type = Endpoint @@ -2525,6 +2474,28 @@ known_false_positives = Legitimate DNS activity can be detected in this search. providing_technologies = ["Splunk Stream", "Bro"] +[savedsearch://ESCU - Registry Keys for Creating SHIM Databases - Rule] +type = detection +asset_type = Endpoint +confidence = medium +explanation = In this search, we look for modifications to registry keys used for shim databases on Microsoft platforms via the object_category and object_path field in the Change_Analysis data model and give you the destination, command used to initiate the change, the user who conducted this activity, the resource affected(object), and the whole path of the object. An application compatibility shim is a small library that transparently intercepts an API (via hooking), changes the parameters passed, handles the operation itself, or redirects the operation elsewhere, such as additional code stored on a system. This capability can be also leveraged by attackers to create and store malicious files in a shim database as observed in CARBANAK backdoor. +how_to_implement = To successfully implement this search, you must populate the Change_Analysis data model. This is typically populated via endpoint detection and response products, such as Carbon Black or other endpoint data sources such as Sysmon. The data used for this search is typically generated via logs that report reads and writes to the registry. +annotations = {"mitre_attack": ["Persistence", "Application Shimming"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +known_false_positives = There are many legitimate applications that leverage shim databases for compatibility purposes for legacy applications +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] + + +[savedsearch://ESCU - Detect Mimikatz Via PowerShell And EventCode 4663 - Rule] +type = detection +asset_type = Windows +confidence = medium +explanation = This search looks for Windows Event Code 4663 (object access), where the process performing the access is PowerShell.exe, the target process of the access is lsass.exe, and the access mask is given as 0x10. This is consistent with the use of PowerShell to execute Mimikatz using sekurlsa::logonpasswords. It will return the host where the activity occurred, the process and associated id, the enabled privilege, and the message in the event. +how_to_implement = You must be ingesting Windows Security logs. You must also enable the account change auditing here: http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/MonitorWindowseventlogdata. Additionally, this search requires you to enable your Group Management Audit Logs in your Local Windows Security Policy and to be ingesting those logs. More information on how to enable them can be found here: http://whatevernetworks.com/auditing-group-membership-changes-in-active-directory/. Finally, please make sure that the local administrator group name is "Administrators" to be able to look for the right group membership changes. +annotations = {"mitre_attack": ["Credential Access", "Credential Dumping"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.IP", "PR.AC", "DE.CM"]} +known_false_positives = The activity may be legitimate. PowerShell is often used by administrators to perform various tasks, and it's possible this event could be generated in those cases. In these cases, false positives should be fairly obvious and you may need to tweak the search to eliminate noise. +providing_technologies = ["Microsoft Windows"] + + [savedsearch://ESCU - Get All AWS Activity From Country] type = investigative explanation = none @@ -2535,6 +2506,17 @@ earliest_time_offset = 14400 latest_time_offset = 0 +[savedsearch://ESCU - Shim Database File Creation - Rule] +type = detection +asset_type = Endpoint +confidence = high +explanation = This search looks for files being created in `Windows\AppPatch\Custom and Windows\AppPatch\Custom64`, the location where shim databases are installed. It will return all the files created, as well as the time of creation for the first and last file for each endpoint. +how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. +annotations = {"mitre_attack": ["Persistence", "Application Shimming"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} +known_false_positives = Because legitimate shim files are created and used all the time, this event, in itself, is not suspicious. However, if there are other correlating events, it may warrant further investigation. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] + + [savedsearch://ESCU - Script Execution via WMI - Rule] type = detection asset_type = Endpoint @@ -2756,17 +2738,6 @@ known_false_positives = It is possible for a legitimate file with these extensio providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -[savedsearch://ESCU - Abnormally High AWS Instances Terminated by User - Rule] -type = detection -asset_type = AWS Instance -confidence = medium -explanation = In this search, we query CloudTrail logs to look for events where an instance is successfully terminated by a particular user. Since we want to detect a high number of instances terminated within a short period, we create event buckets for 10-minute windows. We then calculate the total number of instances terminated by a particular user, as well as the average- and standard-deviation values. Assign a `threshold_value` in the search. Try starting with 3 (but it will likely need to be tweaked for your environment). The `eval` function will set the outlier to 1 if the number of instances is greater than the average number of instances terminated, added to the multiplied value of threshold and standard deviation. We then filter out outliers with a value of 1 and show only those instance-termination events that happened within the previous 10 minutes. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. -annotations = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["DE.DP", "DE.AE"]} -known_false_positives = Many service accounts configured with your AWS infrastructure are known to exhibit this behavior. Please adjust the threshold values and filter out service accounts from the output. Always verify whether this search alerted on a human user. -providing_technologies = ["AWS"] - - [savedsearch://ESCU - Extended Period Without Successful Netbackup Backups - Rule] type = detection asset_type = Endpoint @@ -2788,15 +2759,14 @@ earliest_time_offset = 3600 latest_time_offset = 0 -[savedsearch://ESCU - Detect PsExec With accepteula Flag - Rule] -type = detection -asset_type = Endpoint -confidence = medium -explanation = In this search, we are looking for the PsExec process with `accepteula` on the command line. -how_to_implement = To successfully implement this search, you need to be ingesting logs with the process name, command-line arguments, and parent process from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon Technology Add-on (TA). -annotations = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -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 -providing_technologies = ["Sysmon"] +[savedsearch://ESCU - Get EC2 Instance Details by instanceId] +type = contextual +explanation = none +how_to_implement = In order to implement this search, you must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS(version 4.4.0 or later) and configure your AWS description inputs. +known_false_positives = None at this time +providing_technologies = ["AWS"] +earliest_time_offset = 86400 +latest_time_offset = 0 [savedsearch://ESCU - Reg.exe Manipulating Windows Services Registry Keys - Rule] @@ -2834,15 +2804,15 @@ known_false_positives = This is a strictly behavioral search, so we define "fals providing_technologies = ["AWS"] -[savedsearch://ESCU - Suspicious Java Classes - Rule] +[savedsearch://ESCU - Processes created by netsh - Rule] type = detection asset_type = Endpoint confidence = medium -explanation = The search leverages HTTP form data from typically POST events that can be captured with Splunk streams or similar wire data capture tools. The search looks for java classes like `processbuilder` and `runtime` are used to create a new process and execute commands inside java, and are synonymous with spawning a shell. There are very exceptional reasons to ever these classes in Java via an HTTP API and hence when seen are highly suspicious. Also, this is a common vectors leverage to exploit Apache Struts. -how_to_implement = In order to properly run this search, Splunk needs to ingest data from your web-traffic appliances that serve or sit in the path of your Struts application servers. This can be accomplished by indexing data from a web proxy, or by using network traffic-analysis tools, such as Splunk Stream or Bro. -annotations = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 7", "CIS 12"], "nist": ["DE.AE"]} -known_false_positives = There are no known false positives. -providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Apache"] +explanation = This search looks for all processes with the parent process "c:\Windows\System32\netsh.exe" and returns the process, the command line used to execute it, the host name, and the user context under which it ran. +how_to_implement = To successfully implement this search, you must be ingesting logs with the process name, command-line arguments, and parent processes from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. +annotations = {"mitre_attack": ["Execution", "Command-Line Interface", "Persistence"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +known_false_positives = It is unusual for netsh.exe to have any child processes in most environments. It makes sense to investigate the child process and verify whether the process spawned is legitimate. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] [savedsearch://ESCU - Web Fraud - Account Harvesting - Rule] @@ -2856,28 +2826,37 @@ known_false_positives = As is common with many fraud-related searches, we are us providing_technologies = ["Splunk Stream", "Palo Alto Firewall", "Bro"] -[savedsearch://ESCU - Scheduled Task Name Used by Dragonfly Threat Actors - Rule] +[savedsearch://ESCU - Investigate Web Activity From Host] +type = investigative +explanation = none +how_to_implement = To successfully implement this search you must be ingesting your web traffic and populating the Web data model. +known_false_positives = None at this time +providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] +earliest_time_offset = 3600 +latest_time_offset = 3600 + + +[savedsearch://ESCU - Get All AWS Activity From City] +type = investigative +explanation = none +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. +known_false_positives = None at this time +providing_technologies = ["AWS"] +earliest_time_offset = 14400 +latest_time_offset = 0 + + +[savedsearch://ESCU - Malicious PowerShell Process - Encoded Command - Rule] type = detection asset_type = Endpoint confidence = medium -explanation = The search looks for execution of schtasks.exe with parameters that indicate that a specific task "reset," whose name is associated with the Dragonfly threat actor--has been created or deleted. Schtasks.exe is a native Windows program that is used to schedule tasks on local or remote systems. Attackers often leverage this capability to schedule the execution of commands or establish persistence. -how_to_implement = You must be ingesting endpoint data that tracks process activity, including parent-child relationships from your endpoints to populate the Endpoint data model in the Processes node. The command-line arguments are mapped to the "process" field in the Endpoint data model. -annotations = {"mitre_attack": ["Execution", "Scheduled Task"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3"], "nist": ["PR.IP"]} -known_false_positives = No known false positives +explanation = This search looks for PowerShell processes that are passing encoded commands on the command-line. The flags "-EncodedCommand" and "-enc" are two different possible flags that can be used to pass base64 encoded commands to PowerShell. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. +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. +annotations = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} +known_false_positives = System administrators may use this option, but it's not common. providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Prohibited Network Traffic Allowed - Rule] -type = detection -asset_type = Endpoint -confidence = medium -explanation = The search looks for traffic marked 'is_prohibited' in the Enterprise Security lookup table 'interesting_ports_lookup', and then determines if any network devices have an associated 'allow' action on that traffic by checking the Network_Traffic data model. -how_to_implement = In order to properly run this search, Splunk needs to ingest data from firewalls or other network control devices that mediate the traffic allowed into an environment. This is necessary so that the search can identify an 'action' taken on the traffic of interest. The search requires the Network_Traffic data model be populated. -annotations = {"mitre_attack": ["Command and Control", "Commonly Used Port", "Exfiltration", "Exfiltration Over Alternative Protocol"], "kill_chain_phases": ["Delivery", "Command and Control"], "cis20": ["CIS 9", "CIS 12"], "nist": ["DE.AE", "PR.AC"]} -known_false_positives = None identified -providing_technologies = ["Palo Alto Firewall", "Bro", "Splunk Stream"] - - [savedsearch://ESCU - Monitor Email For Brand Abuse - Rule] type = detection asset_type = Endpoint @@ -2941,35 +2920,15 @@ known_false_positives = Some networks may use kerberized FTP or telnet servers, providing_technologies = ["Splunk Stream", "Bro"] -[savedsearch://ESCU - Get Web Session Information via session_id] -type = investigative -explanation = none -how_to_implement = This search leverages data extracted from Stream:HTTP. You must configure the HTTP stream using the Splunk Stream App on your Splunk Stream deployment server. -known_false_positives = None at this time -providing_technologies = ["Splunk Stream"] -earliest_time_offset = 3600 -latest_time_offset = 3600 - - -[savedsearch://ESCU - Processes created by netsh - Rule] +[savedsearch://ESCU - Suspicious Java Classes - Rule] type = detection asset_type = Endpoint confidence = medium -explanation = This search looks for all processes with the parent process "c:\Windows\System32\netsh.exe" and returns the process, the command line used to execute it, the host name, and the user context under which it ran. -how_to_implement = To successfully implement this search, you must be ingesting logs with the process name, command-line arguments, and parent processes from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. -annotations = {"mitre_attack": ["Execution", "Command-Line Interface", "Persistence"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -known_false_positives = It is unusual for netsh.exe to have any child processes in most environments. It makes sense to investigate the child process and verify whether the process spawned is legitimate. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] - - -[savedsearch://ESCU - Get Logon Rights Modifications For Endpoint] -type = investigative -explanation = none -how_to_implement = To successfully implement this search you must be ingesting your Windows event logs -known_false_positives = None at this time -providing_technologies = ["Microsoft Windows"] -earliest_time_offset = 86400 -latest_time_offset = 86400 +explanation = The search leverages HTTP form data from typically POST events that can be captured with Splunk streams or similar wire data capture tools. The search looks for java classes like `processbuilder` and `runtime` are used to create a new process and execute commands inside java, and are synonymous with spawning a shell. There are very exceptional reasons to ever these classes in Java via an HTTP API and hence when seen are highly suspicious. Also, this is a common vectors leverage to exploit Apache Struts. +how_to_implement = In order to properly run this search, Splunk needs to ingest data from your web-traffic appliances that serve or sit in the path of your Struts application servers. This can be accomplished by indexing data from a web proxy, or by using network traffic-analysis tools, such as Splunk Stream or Bro. +annotations = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 7", "CIS 12"], "nist": ["DE.AE"]} +known_false_positives = There are no known false positives. +providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Apache"] [savedsearch://ESCU - Add Prohibited Processes to Enterprise Security] @@ -2991,15 +2950,15 @@ known_false_positives = None at this time providing_technologies = ["Splunk Stream", "Bro"] -[savedsearch://ESCU - Suspicious File Write - Rule] +[savedsearch://ESCU - Remote Desktop Network Traffic - Rule] type = detection asset_type = Endpoint -confidence = high -explanation = This search looks at files being created or modified in the Endpoint file-system data model. The names of those files are checked against an included lookup file, which contains the names of files associated with malware or attack activity. The search returns any files with matching names, along with a note (also specified in the lookup file) that gives or points to more information about the files. -how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. This is typically populated via endpoint detection-and-response products, such as Carbon Black, or via other endpoint data sources, such as Sysmon. The data used for this search is typically generated via logs that report file system reads and writes. In addition, this search leverages an included lookup file that contains the names of the files to watch for, as well as a note to communicate why that file name is being monitored. This lookup file can be edited to add or remove file the file names you want to monitor. -annotations = {"mitre_attack": [], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -known_false_positives = It's possible for a legitimate file to be created with the same name as one noted in the lookup file. Filenames listed in the lookup file should be unique enough that collisions are rare. Looking at the location of the file and the process responsible for the activity can help determine whether or not the activity is legitimate. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] +confidence = medium +explanation = This search finds systems that do not commonly communicate use remote desktop. It does this by filtering out all systems that have the "common_rdp_source" or "common_rdp_destination" category applied to that system. Categories are applied to systems using the Assets and Identity framework. +how_to_implement = To successfully implement this search you need to identify systems that commonly originate remote desktop traffic and that commonly receive remote desktop traffic. You can use the included support search "Identify Systems Creating Remote Desktop Traffic" to identify systems that originate the traffic and the search "Identify Systems Receiving Remote Desktop Traffic" to identify systems that receive a lot of remote desktop traffic. After identifying these systems, you will need to add the "common_rdp_source" or "common_rdp_destination" category to that system depending on the usage, using the Enterprise Security Assets and Identities framework. This can be done by adding an entry in the assets.csv file located in SA-IdentityManagement/lookups. +annotations = {"mitre_attack": ["Lateral Movement", "Remote Desktop Protocol", "Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 9", "CIS 16"], "nist": ["DE.AE", "PR.AC", "PR.IP"]} +known_false_positives = Remote Desktop may be used legitimately by users on the network. +providing_technologies = ["Bro", "Splunk Stream"] [savedsearch://ESCU - Create local admin accounts using net.exe - Rule] @@ -3021,17 +2980,6 @@ known_false_positives = None at this time providing_technologies = ["AWS"] -[savedsearch://ESCU - Detect new API calls from user roles - Rule] -type = detection -asset_type = AWS Instance -confidence = medium -explanation = The subsearch will execute first and return the user roles and names of the API calls completed within the last hour, where the type of user identity is `AssumedRole`. It then appends the historical data to those results in the lookup file. Next, it recalculates the `earliest` and `latest` fields for each user role, as well as the name of the API call, and returns only those roles and API calls that have first been seen in the past hour. This is combined with the main search to return the values of API calls, name of the user role, and the earliest and latest time of this activity. It is worth noting that the name of the role of a particular user is parsed as "userName" in the CloudTrail logs. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously seen API call per user roles in CloudTrail" support search once to create a history of previously seen user roles. -annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -known_false_positives = It is possible that there are legitimate user roles making new or infrequently used API calls in your infrastructure, causing the search to trigger. -providing_technologies = ["AWS"] - - [savedsearch://ESCU - Detection of tools built by NirSoft - Rule] type = detection asset_type = Endpoint @@ -3064,12 +3012,12 @@ known_false_positives = None identified. providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Baseline of API Calls per User ARN] +[savedsearch://ESCU - Systems Ready for Spectre-Meltdown Windows Patch] type = support -explanation = This search returns all log events that are API calls, pulls out the ARN that initiated each call, and collects them in one-hour groupings. Next, it calculates the number of API calls made per ARN per hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points each ARN had. This table is then stored in a lookup file. -how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. +explanation = This search looks to see if a registry key was created at `HKLM\Software\Microsoft\Windows\CurrentVersion\QualityCompat`. It will tell you when it was created and, if possible, what process created it. +how_to_implement = You need to be ingesting logs with both the process name and command-line from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. known_false_positives = None at this time -providing_technologies = ["AWS"] +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] [savedsearch://ESCU - Get EC2 Launch Details] @@ -3093,6 +3041,16 @@ known_false_positives = There may be legitimate reasons for administrators to ad providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - Get Backup Logs For Endpoint] +type = contextual +explanation = none +how_to_implement = You must be ingesting your backup logs. +known_false_positives = None at this time +providing_technologies = ["Netbackup"] +earliest_time_offset = 604800 +latest_time_offset = 0 + + [savedsearch://ESCU - Baseline of blocked outbound traffic from AWS] type = support explanation = Use this search to create a baseline of blocked outbound network connections by each source IP in your AWS environment. This search returns all log events that correspond to a blocked outbound network connection, extracts the source IP from where the outbound connection was initiated, and collects the events in one-hour groupings. Next, it calculates the number of outbound connections blocked per hour. For each source IP, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points each source IP had. This table is then stored in a lookup file. @@ -3119,6 +3077,17 @@ earliest_time_offset = 14400 latest_time_offset = 0 +[savedsearch://ESCU - Detect New Open S3 buckets - Rule] +type = detection +asset_type = S3 Bucket +confidence = medium +explanation = This search queries CloudTrail logs for events with S3 bucket access controls given to the "All Users" group, which allows anyone in the world access to the resource. This search generates a table displaying the time when the bucket was made public, the permission of the S3 bucket, the bucket name, and the ARN of the user who created the bucket. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), and then configure your CloudTrail inputs. The threshold value should be tuned to your environment. +annotations = {"mitre_attack": ["Execution", "Initial Access", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} +known_false_positives = While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group. +providing_technologies = ["AWS"] + + [savedsearch://ESCU - Get DNS traffic ratio] type = investigative explanation = none @@ -3217,6 +3186,17 @@ known_false_positives = A previously unseen service is not necessarily malicious providing_technologies = ["Microsoft Windows"] +[savedsearch://ESCU - Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments - Rule] +type = detection +asset_type = Endpoint +confidence = medium +explanation = This search looks for PowerShell processes that have a number of suspicious flags on the command-line. It is looking for flags are passing encoded commands on the command-line. The flags `-EncodedCommand` and `-enc` are two different possible flags that can be used to pass base64 encoded commands to PowerShell. The `*-Exec*` flag looks to see it the default execution policy of PowerShell is being overridden, while the `*-NonI*` flag tells the PowerShell process that this will be a noninteractive process, so the user doesn't know about the process. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. +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. +annotations = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} +known_false_positives = Legitimate process can have this combination of command-line options, but it's not common. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] + + [savedsearch://ESCU - Registry Keys Used For Persistence - Rule] type = detection asset_type = Endpoint @@ -3228,15 +3208,15 @@ known_false_positives = There are many legitimate applications that must execute providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -[savedsearch://ESCU - Batch File Write to System32 - Rule] +[savedsearch://ESCU - SMB Traffic Spike - Rule] type = detection asset_type = Endpoint -confidence = high -explanation = This search looks at file modifications across your hosts, as well as for evidence of batch files being written to paths that include "system32." This activity is consistent with some SamSam attacks and is, in general, suspicious. -how_to_implement = You must be ingesting data that records the file-system activity from your hosts to populate the Endpoint file-system data-model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. -annotations = {"mitre_attack": [], "kill_chain_phases": ["Delivery"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -known_false_positives = It is possible for this search to generate a notable event for a batch file write to a path that includes the string "system32", but is not the actual Windows system directory. As such, you should confirm the path of the batch file identified by the search. In addition, a false positive may be generated by an administrator copying a legitimate batch file in this directory tree. You should confirm that the activity is legitimate and modify the search to add exclusions, as necessary. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] +confidence = medium +explanation = Server Message Block (SMB) traffic, a protocol used for Windows file sharing-activity, is often leveraged by attackers. One example of SMB abuse was the WannaCry ransomware, which leveraged a vulnerability in the SMB protocol to propagate to other systems. Attackers have also used SMB for lateral movement with a target environment and to test credentials against target systems. While SMB is highly prevalent in Windows environments, a spike in SMB traffic may still be indicative of this type of malicious activity. This search looks for a traffic spike in SMB traffic from a particular system. If such a spike is detected, you may want to investigate the source and analyze the cause of the abnormal traffic. +how_to_implement = This search requires you to be ingesting your network traffic logs and populating the `Network_Traffic` data model. +annotations = {"mitre_attack": ["Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} +known_false_positives = A file server may experience high-demand loads that could cause this analytic to trigger. +providing_technologies = ["Bro", "Splunk Stream"] [savedsearch://ESCU - AWS Investigate User Activities By AccessKeyId] @@ -3303,6 +3283,17 @@ known_false_positives = None identified. Attempts to disable security-related se providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - WMI Permanent Event Subscription - Rule] +type = detection +asset_type = Endpoint +confidence = medium +explanation = Attackers are increasingly abusing Windows Management Infrastructure (WMI) for stealth, persistence, lateral movement, or just to leverage its functionality. This search looks for the creation of a WMI event subscription by watching for Windows event ID 5861. +how_to_implement = To successfully implement this search, you must be ingesting the Windows WMI activity logs. This can be done by adding a stanza to inputs.conf on the system generating logs with a title of [WinEventLog://Microsoft-Windows-WMI-Activity/Operational]. +annotations = {"mitre_attack": ["Execution", "Windows Management Instrumentation", "Persistence", "Windows Management Instrumentation Event Subscription"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} +known_false_positives = Although unlikely, administrators may use event subscriptions for legitimate purposes. +providing_technologies = ["Microsoft Windows"] + + [savedsearch://ESCU - Spike in File Writes - Rule] type = detection asset_type = Endpoint @@ -3336,6 +3327,17 @@ known_false_positives = Although unlikely, administrators may use wmi to execute providing_technologies = ["Carbon Black Response", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - EC2 Instance Modified With Previously Unseen User - Rule] +type = detection +asset_type = AWS Instance +confidence = medium +explanation = The subsearch returns the ARNs of all successful EC2 instance modifications within the last hour and then appends the historical data in the lookup file to those results. EC2 modification APIs are defined by the macro `ec2ModificationAPIs`. The search then recalculates the `firstTime` and `lastTime` field for each ARN and returns only those ARNs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance ID of those systems. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 Launches By User" support search once to create a history of previously seen ARNs. To add or remove APIs that modify an EC2 instance, edit the macro `ec2ModificationAPIs`. +annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +known_false_positives = It's possible that a new user will start to modify EC2 instances when they haven't before for any number of reasons. Verify with the user that is modifying instances that this is the intended behavior. +providing_technologies = ["AWS"] + + [savedsearch://ESCU - Remote Process Instantiation via WMI - Rule] type = detection asset_type = Endpoint @@ -3347,6 +3349,17 @@ known_false_positives = The wmic.exe utility is a benign Windows application. It providing_technologies = ["Carbon Black Response", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - Batch File Write to System32 - Rule] +type = detection +asset_type = Endpoint +confidence = high +explanation = This search looks at file modifications across your hosts, as well as for evidence of batch files being written to paths that include "system32." This activity is consistent with some SamSam attacks and is, in general, suspicious. +how_to_implement = You must be ingesting data that records the file-system activity from your hosts to populate the Endpoint file-system data-model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. +annotations = {"mitre_attack": [], "kill_chain_phases": ["Delivery"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +known_false_positives = It is possible for this search to generate a notable event for a batch file write to a path that includes the string "system32", but is not the actual Windows system directory. As such, you should confirm the path of the batch file identified by the search. In addition, a false positive may be generated by an administrator copying a legitimate batch file in this directory tree. You should confirm that the activity is legitimate and modify the search to add exclusions, as necessary. +providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] + + [savedsearch://ESCU - Windows Updates Install Successes] type = support explanation = This search gives you the count and name of all the systems that had a successful update applied each day @@ -3366,14 +3379,15 @@ known_false_positives = None identified. providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -[savedsearch://ESCU - Get Parent Process Info] -type = investigative -explanation = none -how_to_implement = To successfully implement this search you must be ingesting endpoint data via Microsoft-Windows-Sysmon and extract the Image and Parent Image field. -known_false_positives = None at this time -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -earliest_time_offset = 0 -latest_time_offset = 86400 +[savedsearch://ESCU - EC2 Instance Started With Previously Unseen AMI - Rule] +type = detection +asset_type = AWS Instance +confidence = medium +explanation = The subsearch returns the AMI image ID of all successful EC2 instance launches within the last hour and then appends the historical data from the lookup file to those results. It then recalculates the earliest and latest seen time field for each AMI image ID and returns only those AMI image IDs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance id of those systems. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 AMIs" support search once to create a history of previously seen AMIs. +annotations = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +known_false_positives = After a new AMI is created, the first systems created with that AMI will cause this alert to fire. Verify that the AMI being used was created by a legitimate user. +providing_technologies = ["AWS"] [savedsearch://ESCU - DNSTwist Domain Names] @@ -3395,15 +3409,12 @@ known_false_positives = It's possible that normal DNS traffic will exhibit this providing_technologies = ["Splunk Stream", "Bro"] -[savedsearch://ESCU - Malicious PowerShell Process - Encoded Command - Rule] -type = detection -asset_type = Endpoint -confidence = medium -explanation = This search looks for PowerShell processes that are passing encoded commands on the command-line. The flags "-EncodedCommand" and "-enc" are two different possible flags that can be used to pass base64 encoded commands to PowerShell. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. -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. -annotations = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} -known_false_positives = System administrators may use this option, but it's not common. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +[savedsearch://ESCU - Baseline of API Calls per User ARN] +type = support +explanation = This search returns all log events that are API calls, pulls out the ARN that initiated each call, and collects them in one-hour groupings. Next, it calculates the number of API calls made per ARN per hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points each ARN had. This table is then stored in a lookup file. +how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. +known_false_positives = None at this time +providing_technologies = ["AWS"] [savedsearch://ESCU - Unusually Long Command Line - Rule] @@ -3478,14 +3489,3 @@ known_false_positives = The false-positive rate will vary based on how you set t providing_technologies = ["Bro", "Splunk Stream"] -[savedsearch://ESCU - Execution of File With Spaces Before Extension - Rule] -type = detection -asset_type = Endpoint -confidence = medium -explanation = This search uses the endpoint data model to look for process names with at least five spaces between the file name and its extension. -how_to_implement = To successfully implement this search, you must be ingesting data that records process activity from your hosts to populate the endpoint data model in the processes node. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. -annotations = {"mitre_attack": ["Execution", "Persistence", "Change Default File Association"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 8"], "nist": ["DE.CM", "PR.PT", "PR.IP"]} -known_false_positives = None identified. -providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] - - diff --git a/src/default/savedsearches.conf b/src/default/savedsearches.conf index 43d9c437d1..38a3f69a62 100644 --- a/src/default/savedsearches.conf +++ b/src/default/savedsearches.conf @@ -47,54 +47,29 @@ schedule_window = auto is_visible = false search = ((sourcetype=*wineventlog:security) AND (EventCode=1102 OR EventCode=1100)) OR ((sourcetype=wineventlog:system OR sourcetype=XmlWinEventlog:System) AND EventCode=104) | stats count min(_time) as firstTime max(_time) as lastTime by EventCode sourcetype host | `ctime(firstTime)` | `ctime(lastTime)` | rename host as dest -[ESCU - Detect Activity Related to Pass the Hash Attacks - Rule] +[ESCU - Get Process Information For Port Activity] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2016-09-13 -action.escu.modification_date = 2017-09-18 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2017-06-25 +action.escu.modification_date = 2017-09-10 action.escu.channel = ESCU -action.escu.confidence = low -action.escu.eli5 = To detect pass the hash activity, we look at all events with event code 4624 or 4625 that specify a logon type 3 (network logons). We are looking for the NtLmSsP account, with a key length set to 0. These indicate lower level protocols that are typically used through Pass the Hash (WMI, SMB, etc.). The search also filters out events with an account name of 'Anonymous' to help reduce false positives. -action.escu.how_to_implement = To successfully implement this search, you must ingest your Windows Security Event logs and leverage the TA for Windows to extract EventCode, Logon_Process, Logon_Type, Key_Length and Account_Name fields from these events. -action.escu.full_search_name = ESCU - Detect Activity Related to Pass the Hash Attacks - Rule -action.escu.mappings = {"mitre_attack": ["Lateral Movement", "Pass the Hash"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} -action.escu.known_false_positives = Legitimate logon activity by authorized NTLM systems may be detected by this search. Please investigate as appropriate. -action.escu.search_type = detection -action.escu.providing_technologies = ["Microsoft Windows"] -action.escu.analytic_story = ["Lateral Movement"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect Activity Related to Pass the Hash Attacks -action.notable = 1 -action.notable.param.nes_fields = -action.notable.param.rule_description = This search looks for Authentication log events from the Windows Security Audit logs to detect potential attempts for Passing the Hash -action.notable.param.rule_title = Detect Activity Related to Pass the Hash -action.notable.param.security_domain = access -action.notable.param.severity = low -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 10 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = ComputerName -alert.suppress.period = 86400s -cron_schedule = 0 * * * * -description = This search looks for specific authentication events from the Windows Security Event logs to detect potential attempts at using the Pass-the-Hash technique. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m +action.escu.eli5 = none +action.escu.how_to_implement = To successfully implement this search you must be ingesting endpoint data that associates processes with network events. +action.escu.data_models = ["Application_State"] +action.escu.full_search_name = ESCU - Get Process Information For Port Activity +action.escu.known_false_positives = None at this time +action.escu.search_type = investigative +action.escu.providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] +action.escu.analytic_story = ["Ransomware", "Use of Cleartext Protocols", "SamSam Ransomware", "Prohibited Traffic Allowed or Protocol Mismatch", "Command and Control"] +action.escu.fields_required = ["dest_port", "src"] +action.escu.earliest_time_offset = 7200 +action.escu.latest_time_offset = 7200 +description = This search will return information about the process associated with observed network traffic to a specific destination port from a specific host. disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype="WinEventLog:Security" (EventCode=4624 OR EventCode=4625) Logon_Process=NtLmSsp Logon_Type=3 Account_Name !="ANONYMOUS LOGON" Key_Length=0 | table _time Source_Network_Address Account_Name Account_Domain ComputerName Workstation_Name +search = | from datamodel Application_State.Ports | search dest_port=$dest_port$ dest=$src$ | table dest dest_port process process_name [ESCU - Create or delete hidden shares using net.exe - Rule] action.escu = 0 @@ -194,29 +169,54 @@ schedule_window = auto is_visible = false search = sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational add Hidden REG_DWORD | search process=*reg.exe cmdline=*add* cmdline=*Hidden* cmdline=*REG_DWORD* | regex cmdline= "(/d\s+2)" | stats count values(cmdline) min(_time) as firstTime max(_time) as lastTime by dest process | `ctime(firstTime)` |`ctime(lastTime)` -[ESCU - Get Process Information For Port Activity] +[ESCU - Detect Activity Related to Pass the Hash Attacks - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-06-25 -action.escu.modification_date = 2017-09-10 +action.escu.creation_date = 2016-09-13 +action.escu.modification_date = 2017-09-18 +action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = To successfully implement this search you must be ingesting endpoint data that associates processes with network events. -action.escu.data_models = ["Application_State"] -action.escu.full_search_name = ESCU - Get Process Information For Port Activity -action.escu.known_false_positives = None at this time -action.escu.search_type = investigative -action.escu.providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] -action.escu.analytic_story = ["Command and Control", "Use of Cleartext Protocols", "Prohibited Traffic Allowed or Protocol Mismatch", "Ransomware", "SamSam Ransomware"] -action.escu.fields_required = ["dest_port", "src"] -action.escu.earliest_time_offset = 7200 -action.escu.latest_time_offset = 7200 -description = This search will return information about the process associated with observed network traffic to a specific destination port from a specific host. +action.escu.confidence = low +action.escu.eli5 = To detect pass the hash activity, we look at all events with event code 4624 or 4625 that specify a logon type 3 (network logons). We are looking for the NtLmSsP account, with a key length set to 0. These indicate lower level protocols that are typically used through Pass the Hash (WMI, SMB, etc.). The search also filters out events with an account name of 'Anonymous' to help reduce false positives. +action.escu.how_to_implement = To successfully implement this search, you must ingest your Windows Security Event logs and leverage the TA for Windows to extract EventCode, Logon_Process, Logon_Type, Key_Length and Account_Name fields from these events. +action.escu.full_search_name = ESCU - Detect Activity Related to Pass the Hash Attacks - Rule +action.escu.mappings = {"mitre_attack": ["Lateral Movement", "Pass the Hash"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} +action.escu.known_false_positives = Legitimate logon activity by authorized NTLM systems may be detected by this search. Please investigate as appropriate. +action.escu.search_type = detection +action.escu.providing_technologies = ["Microsoft Windows"] +action.escu.analytic_story = ["Lateral Movement"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Detect Activity Related to Pass the Hash Attacks +action.notable = 1 +action.notable.param.nes_fields = +action.notable.param.rule_description = This search looks for Authentication log events from the Windows Security Audit logs to detect potential attempts for Passing the Hash +action.notable.param.rule_title = Detect Activity Related to Pass the Hash +action.notable.param.security_domain = access +action.notable.param.severity = low +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 10 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = ComputerName +alert.suppress.period = 86400s +cron_schedule = 0 * * * * +description = This search looks for specific authentication events from the Windows Security Event logs to detect potential attempts at using the Pass-the-Hash technique. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | from datamodel Application_State.Ports | search dest_port=$dest_port$ dest=$src$ | table dest dest_port process process_name +search = sourcetype="WinEventLog:Security" (EventCode=4624 OR EventCode=4625) Logon_Process=NtLmSsp Logon_Type=3 Account_Name !="ANONYMOUS LOGON" Key_Length=0 | table _time Source_Network_Address Account_Name Account_Domain ComputerName Workstation_Name [ESCU - TOR Traffic - Rule] action.escu = 0 @@ -234,7 +234,7 @@ action.escu.mappings = {"mitre_attack": ["Command and Control", "Commonly Used P action.escu.known_false_positives = None at this time action.escu.search_type = detection action.escu.providing_technologies = ["Palo Alto Firewall", "Bro", "Splunk Stream"] -action.escu.analytic_story = ["Command and Control", "Prohibited Traffic Allowed or Protocol Mismatch", "Ransomware"] +action.escu.analytic_story = ["Ransomware", "Prohibited Traffic Allowed or Protocol Mismatch", "Command and Control"] action.correlationsearch.enabled = 1 action.correlationsearch.label = TOR Traffic action.notable = 1 @@ -243,7 +243,7 @@ action.notable.param.rule_description = Network traffic accessing TOR detected f action.notable.param.rule_title = TOR Network Traffic Allowed from $src_ip$ action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Backup Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get Update Logs For Endpoint\n - ESCU - Get User Information from Identity Table\n - ESCU - Get Vulnerability Logs For Endpoint\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src_ip @@ -354,7 +354,7 @@ action.escu.full_search_name = ESCU - Monitor Successful Backups action.escu.known_false_positives = None at this time action.escu.search_type = support action.escu.providing_technologies = ["Netbackup"] -action.escu.analytic_story = ["Ransomware", "Monitor Backup Solution", "SamSam Ransomware"] +action.escu.analytic_story = ["Monitor Backup Solution", "Ransomware", "SamSam Ransomware"] description = This search is intended to give you a feel for how often successful backups are conducted in your environment. Fluctuations in these numbers will allow you to determine when you should investigate. dispatch.earliest_time = -30d@d dispatch.latest_time = -10m@m @@ -364,54 +364,28 @@ schedule_window = auto is_visible = false search = sourcetype="netbackup_logs" "Disk/Partition backup completed successfully." | bucket _time span=1d | stats dc(COMPUTERNAME) as count values(COMPUTERNAME) as dest by _time, MESSAGE -[ESCU - Detect API activity from users without MFA - Rule] +[ESCU - Get Logon Rights Modifications For Endpoint] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-05-17 -action.escu.modification_date = 2018-05-17 -action.escu.asset_at_risk = AWS Instance +action.escu.creation_date = 2017-08-16 +action.escu.modification_date = 2017-09-12 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = In this search, we query CloudTrail logs and specifically look for events where the multi factor authentication context of the user's session is false which basically means, that the user does not have MFA enabled on AWS. We then filter out all the known AWS service accounts since service accounts typically do not have MFA enabled. The search then creates a table of the first and last time a user without MFA was detected, the values and count of the API calls made, the type of user identity, ARN and the name of the user. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Leverage the support search `Create a list of approved AWS service accounts`: run it once every 30 days to create a list of service accounts and validate them. -action.escu.full_search_name = ESCU - Detect API activity from users without MFA - Rule -action.escu.mappings = {"mitre_attack": ["Execution"], "cis20": ["CIS 16"], "nist": ["DE.DP", "PR.AC"]} -action.escu.known_false_positives = Many service accounts configured within an AWS infrastructure do not have multi factor authentication enabled. Please ignore the service accounts, if triggered and instead add them to the aws_service_accounts.csv file to fine tune the detection. It is also possible that the search detects users in your environment using Single Sign-On systems, since the MFA is not handled by AWS. -action.escu.search_type = detection -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS User Monitoring"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect API activity from users without MFA -action.notable = 1 -action.notable.param.nes_fields = user -action.notable.param.rule_description = API Activity detected from $user$ without MFA enabled. -action.notable.param.rule_title = API Activity detected from $user$ without MFA enabled -action.notable.param.security_domain = network -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate AWS User Activities by user field\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = user -action.risk.param._risk_object_type = user -action.risk.param._risk_score = 30 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = user -alert.suppress.period = 84600s -cron_schedule = 0 8 * * * -description = This search looks for CloudTrail events where a user logged into the AWS account, is making API calls and has not enabled Multi Factor authentication. Multi factor authentication adds a layer of security by forcing the users to type a unique authentication code from an approved authentication device when they access AWS websites or services. AWS Best Practices recommend that you enable MFA for privileged IAM users. -dispatch.earliest_time = -1d@d -dispatch.latest_time = -10m@m +action.escu.eli5 = none +action.escu.how_to_implement = To successfully implement this search you must be ingesting your Windows event logs +action.escu.full_search_name = ESCU - Get Logon Rights Modifications For Endpoint +action.escu.known_false_positives = None at this time +action.escu.search_type = investigative +action.escu.providing_technologies = ["Microsoft Windows"] +action.escu.analytic_story = ["Account Monitoring and Controls"] +action.escu.fields_required = ["dest"] +action.escu.earliest_time_offset = 86400 +action.escu.latest_time_offset = 86400 +description = This search allows you to retrieve any modifications to logon rights associated with a specific host. disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail userIdentity.sessionContext.attributes.mfaAuthenticated=false | search NOT [| inputlookup aws_service_accounts | fields identity | rename identity as user]| stats count min(_time) as firstTime max(_time) as lastTime values(eventName) by userIdentity.arn userIdentity.type user | `ctime(firstTime)` | `ctime(lastTime)` +search = | search sourcetype=WinEventLog:Security (EventCode=4718 OR EventCode=4717) dest=$dest$ | rename user as "Account Modified" | table _time, dest, "Account Modified", Access_Right, signature [ESCU - Identify Systems Creating Remote Desktop Traffic] action.escu = 0 @@ -816,7 +790,7 @@ action.escu.mappings = {"mitre_attack": ["Command and Control", "Commonly Used P action.escu.known_false_positives = None identified action.escu.search_type = detection action.escu.providing_technologies = ["Palo Alto Firewall", "Bro", "Splunk Stream"] -action.escu.analytic_story = ["Command and Control", "Prohibited Traffic Allowed or Protocol Mismatch"] +action.escu.analytic_story = ["Prohibited Traffic Allowed or Protocol Mismatch", "Command and Control"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Protocol or Port Mismatch action.notable = 1 @@ -825,7 +799,7 @@ action.notable.param.rule_description = This search looks for network traffic on action.notable.param.rule_title = Protocol / Port Mismatch from $src_ip$ action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Information For Port Activity\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src_ip @@ -922,27 +896,54 @@ schedule_window = auto is_visible = false search = (sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational OR tag=process) EventCode=13 object_path=*\\Explorer\\FileExts* process!=Explorer.exe AND process!=OpenWith.exe | stats count min(_time) as firstTime max(_time) as lastTime by dest, process, object_path, Details | rename Details as value | `ctime(firstTime)`| `ctime(lastTime)` -[ESCU - Baseline of Network ACL Activity by ARN] +[ESCU - Detect S3 access from a new IP - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-05-21 -action.escu.modification_date = 2018-05-21 +action.escu.creation_date = 2018-06-25 +action.escu.modification_date = 2018-06-28 +action.escu.asset_at_risk = S3 Bucket action.escu.channel = ESCU -action.escu.eli5 = Use this search to create a baseline for API calls related to network ACLs for the users who initiated this activity. It returns all logged API calls for network activity, pulls out the ARN that initiated each call, and collects the `eventNames` in one-hour groupings. Next, it calculates the number of API calls made per ARN per-hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points for each ARN. This table is stored in a lookup file. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. To add or remove API event names for network ACLs, edit the macro `NetworkACLEvents`. -action.escu.full_search_name = ESCU - Baseline of Network ACL Activity by ARN -action.escu.known_false_positives = None at this time -action.escu.search_type = support +action.escu.confidence = low +action.escu.eli5 = Here the subsearch executes first and returns all successful S3 bucket-access attempts (HTTP code "200") within the last hour. It groups the results by the earliest and latest times it has seen a remote IP accessing a particular bucket. It appends this information to the historical data from the lookup file and then recalculates the `firstTime` and `lastTime` field for each remote IP accessing an S3 bucket. Next, it returns only those remote IP addresses that have first been seen accessing a specific bucket within the past hour. This is combined with the main search to return the time, bucket name, source IP, city, and country operations performed, as well as the requested URI of the resource +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your S3 access logs' inputs. This search works best when you run the "Previously Seen S3 Bucket Access by Remote IP" support search once to create a history of previously seen remote IPs and bucket names. +action.escu.full_search_name = ESCU - Detect S3 access from a new IP - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13", "CIS 14"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} +action.escu.known_false_positives = S3 buckets can be accessed from any IP, as long as it can make a successful connection. This will be a false postive, since the search is looking for a new IP within the past hour +action.escu.search_type = detection action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Network ACL Activity"] -description = This search establishes, on a per-hour basis, the average and the standard deviation of the number of API calls that were related to network ACLs made by each user. Also recorded is the number of data points for each user. This table is then outputted to a lookup file to allow the detection search to operate quickly. -dispatch.earliest_time = -30d@d +action.escu.analytic_story = ["Suspicious AWS S3 Activities"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Detect S3 access from a new IP +action.notable = 1 +action.notable.param.nes_fields = bucket_name, src_ip +action.notable.param.rule_description = A remote IP, $src_ip$, has made a successful connection with an S3 $bucket_name$. +action.notable.param.rule_title = S3 bucket $bucketName$ was accessed by a new $src_ip$ +action.notable.param.security_domain = network +action.notable.param.severity = low +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS S3 Bucket details via bucketName\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Investigate AWS activities via region name\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = src_ip +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 20 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = bucket_name, src_ip +alert.suppress.period = 86400s +cron_schedule = 5 * * * * +description = This search looks at S3 bucket-access logs and detects new or previously unseen remote IP addresses that have successfully accessed an S3 bucket. +dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail `NetworkACLEvents` | spath output=arn path=userIdentity.arn | bucket _time span=1h | stats count as apiCalls by _time, arn | stats count(apiCalls) as numDataPoints, latest(apiCalls) as latestCount, avg(apiCalls) as avgApiCalls, stdev(apiCalls) as stdevApiCalls by arn | table arn, latestCount, numDataPoints, avgApiCalls, stdevApiCalls | outputlookup network_acl_activity_baseline | stats count +search = sourcetype=aws:s3:accesslogs http_status=200 [search sourcetype=aws:s3:accesslogs http_status=200 | stats earliest(_time) as firstTime latest(_time) as lastTime by bucket_name remote_ip | inputlookup append=t previously_seen_S3_access_from_remote_ip.csv | stats min(firstTime) as firstTime, max(lastTime) as lastTime by bucket_name remote_ip | outputlookup previously_seen_S3_access_from_remote_ip.csv | eval newIP=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newIP=1 | convert ctime(firstTime) ctime(lastTime) | table bucket_name remote_ip]| iplocation remote_ip |rename remote_ip as src_ip | table _time bucket_name src_ip City Country operation request_uri [ESCU - Remote Desktop Process Running On System - Rule] action.escu = 0 @@ -960,7 +961,7 @@ action.escu.mappings = {"mitre_attack": ["Lateral Movement", "Remote Desktop Pro action.escu.known_false_positives = Remote Desktop may be used legitimately by users on the network. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Hidden Cobra Malware", "Lateral Movement"] +action.escu.analytic_story = ["Lateral Movement", "Hidden Cobra Malware"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Remote Desktop Process Running On System action.notable = 1 @@ -969,7 +970,7 @@ action.notable.param.rule_description = The system $dest$ is running the remote action.notable.param.rule_title = Remote Desktop Process Running On $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Outbound Emails to Hidden Cobra Threat Actors\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest @@ -1213,45 +1214,46 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Web where (Web.http_method="GET" OR Web.http_method="HEAD") AND (Web.url="*/web-console/ServerInfo.jsp*" OR Web.url="*web-console*" OR Web.url="*jmx-console*" OR Web.url = "*invoker*") by Web.http_method, Web.url, Web.src, Web.dest | `drop_dm_object_name("Web")` | `ctime(firstTime)` | `ctime(lastTime)` -[ESCU - SMB Traffic Spike - Rule] +[ESCU - AWS Cloud Provisioning From Previously Unseen IP Address - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-08-20 -action.escu.modification_date = 2017-09-10 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2018-03-16 +action.escu.modification_date = 2018-03-16 +action.escu.asset_at_risk = AWS Instance action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = Server Message Block (SMB) traffic, a protocol used for Windows file sharing-activity, is often leveraged by attackers. One example of SMB abuse was the WannaCry ransomware, which leveraged a vulnerability in the SMB protocol to propagate to other systems. Attackers have also used SMB for lateral movement with a target environment and to test credentials against target systems. While SMB is highly prevalent in Windows environments, a spike in SMB traffic may still be indicative of this type of malicious activity. This search looks for a traffic spike in SMB traffic from a particular system. If such a spike is detected, you may want to investigate the source and analyze the cause of the abnormal traffic. -action.escu.how_to_implement = This search requires you to be ingesting your network traffic logs and populating the `Network_Traffic` data model. -action.escu.data_models = ["Network_Traffic"] -action.escu.full_search_name = ESCU - SMB Traffic Spike - Rule -action.escu.mappings = {"mitre_attack": ["Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} -action.escu.known_false_positives = A file server may experience high-demand loads that could cause this analytic to trigger. +action.escu.eli5 = The subsearch returns all events with event names that start with "Run" or "Create," and then does a `GeoIP` lookup on the IP address that initiated the action within the last hour. It appends the historical data to those results in the lookup file. Next, it recalculates the `firstTime` and `lastTime` field for each country, region, city, and IP address and outputs this data to the lookup file to update the local cache. It then calculates the `firstTime` and `lastTime` for each city. It returns only those events from IP addresses that have first been seen in the past hour. This is combined with the main search to return the time, user, IP address, city, event name, and error code from the action. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen AWS Provisioning Activity Sources" support search once to create a history of previously seen locations that have provisioned AWS resources. +action.escu.full_search_name = ESCU - AWS Cloud Provisioning From Previously Unseen IP Address - Rule +action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +action.escu.known_false_positives = This is a strictly behavioral search, so we define "false positive" slightly differently. Every time this fires, it will accurately reflect the first occurrence in the time period you're searching within, plus what is stored in the cache feature. But while there are really no "false positives" in a traditional sense, there is definitely lots of noise.\ +\ + This search will fire any time a new IP address is seen in the **GeoIP** database for any kind of provisioning activity. If you typically do all provisioning from tools inside of your country, there should be few false positives. If you are located in countries where the free version of **MaxMind GeoIP** that ships by default with Splunk has weak resolution (particularly small countries in less economically powerful regions), this may be much less valuable to you. action.escu.search_type = detection -action.escu.providing_technologies = ["Bro", "Splunk Stream"] -action.escu.analytic_story = ["Emotet Malware (TA18-201A)", "Hidden Cobra Malware", "Ransomware", "DHS Report TA18-074A"] +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["AWS Suspicious Provisioning Activities"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = SMB Traffic Spike +action.correlationsearch.label = AWS Cloud Provisioning From Previously Unseen IP Address action.notable = 1 -action.notable.param.nes_fields = src -action.notable.param.rule_description = There was a spike in SMB traffic from $src$. -action.notable.param.rule_title = SMB Traffic Spike from $src$ -action.notable.param.security_domain = network +action.notable.param.nes_fields = src_ip +action.notable.param.rule_description = Your AWS infrastructure was provisioned from an IP, $src_ip$, which has never before been seen provisioning your infrastructure. +action.notable.param.rule_title = AWS Provision Activity From $src_ip$ +action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From City\n - ESCU - Get All AWS Activity From Country\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get All AWS Activity From Region\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = src +action.risk.param._risk_object = src_ip action.risk.param._risk_object_type = system -action.risk.param._risk_score = 50 +action.risk.param._risk_score = 30 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = src -alert.suppress.period = 28800s +alert.suppress.fields = src_ip +alert.suppress.period = 14400s cron_schedule = 0 * * * * -description = This search looks for spikes in the number of Server Message Block (SMB) traffic connections. -dispatch.earliest_time = -7d@d +description = This search looks for AWS provisioning activities from previously unseen IP addresses. Provisioning activities are defined broadly as any event that begins with "Run" or "Create." +dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true enableSched = 1 @@ -1261,7 +1263,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count from datamodel=Network_Traffic where All_Traffic.dest_port=139 OR All_Traffic.dest_port=445 OR All_Traffic.app=smb by _time span=1h, All_Traffic.src | `drop_dm_object_name("All_Traffic")` | eventstats max(_time) as maxtime | stats count as num_data_samples max(eval(if(_time >= relative_time(maxtime, "-70m@m"), count, null))) as count avg(eval(if(_time upperBound AND num_data_samples >=50, 1, 0) | where isOutlier=1 | table src count +search = sourcetype=aws:cloudtrail (eventName=Run* OR eventName=Create*) | iplocation sourceIPAddress | search Country=* [search sourcetype=aws:cloudtrail (eventName=Run* OR eventName=Create*) | iplocation sourceIPAddress | search Country=* | stats earliest(_time) as firstTime, latest(_time) as lastTime by sourceIPAddress, City, Region, Country | inputlookup append=t previously_seen_provisioning_activity_src.csv | stats min(firstTime) as firstTime max(lastTime) as lastTime by sourceIPAddress, City, Region, Country | outputlookup previously_seen_provisioning_activity_src.csv | stats min(firstTime) as firstTime max(lastTime) as lastTime by sourceIPAddress | eval newIP=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newIP=1 | table sourceIPAddress] | spath output=user userIdentity.arn | rename sourceIPAddress as src_ip | table _time, user, src_ip, eventName, errorCode [ESCU - Samsam Test File Write - Rule] action.escu = 0 @@ -1313,6 +1315,28 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime values(Filesystem.user) as user values(Filesystem.dest) as dest values(Filesystem.file_name) as file_name from datamodel=Endpoint.Filesystem where Filesystem.file_path=*\\windows\\system32\\test.txt by Filesystem.file_path | `drop_dm_object_name(Filesystem)` | `ctime(lastTime)` | `ctime(firstTime)` +[ESCU - Previously Seen AWS Cross Account Activity] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2018-06-04 +action.escu.modification_date = 2018-06-04 +action.escu.channel = ESCU +action.escu.eli5 = In this support search, we look for **AssumeRole** events where the requesting account is different from the requested account. The first and last times these events are seen are written to a lookup file. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Validate the user name entries in `previously_seen_aws_cross_account_activity.csv`, a lookup file created by this support search. +action.escu.full_search_name = ESCU - Previously Seen AWS Cross Account Activity +action.escu.known_false_positives = None at this time +action.escu.search_type = support +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["AWS Cross Account Activity"] +description = This search looks for **AssumeRole** events where the requesting account differs from the requested account, then writes these relationships to a lookup file. +dispatch.earliest_time = -30d@d +dispatch.latest_time = -10m@m +disabled=true +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = sourcetype=aws:cloudtrail eventName=AssumeRole | spath output=requestingAccountId path=userIdentity.accountId | spath output=requestedAccountId path=resources{}.accountId | search requestingAccountId=* | where requestingAccountId!=requestedAccountId | stats earliest(_time) as firstTime latest(_time) as lastTime by requestingAccountId, requestedAccountId | outputlookup previously_seen_aws_cross_account_activity | stats count + [ESCU - Investigate AWS activities via region name] action.escu = 0 action.escu.enabled = 1 @@ -1325,7 +1349,7 @@ action.escu.full_search_name = ESCU - Investigate AWS activities via region name action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["Suspicious AWS EC2 Activities", "Suspicious AWS S3 Activities"] +action.escu.analytic_story = ["Suspicious AWS S3 Activities", "Suspicious AWS EC2 Activities"] action.escu.fields_required = ["awsRegion"] action.escu.earliest_time_offset = 14400 action.escu.latest_time_offset = 0 @@ -1336,29 +1360,6 @@ schedule_window = auto is_visible = false search = | search sourcetype=aws:cloudtrail awsRegion=$awsRegion$| rename requestParameters.instancesSet.items{}.instanceId as instanceId| stats values(eventName) by userName instanceId -[ESCU - Get EC2 Instance Details by instanceId] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-02-12 -action.escu.modification_date = 2018-02-12 -action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = In order to implement this search, you must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS(version 4.4.0 or later) and configure your AWS description inputs. -action.escu.full_search_name = ESCU - Get EC2 Instance Details by instanceId -action.escu.known_false_positives = None at this time -action.escu.search_type = contextual -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["Suspicious AWS EC2 Activities", "Unusual AWS EC2 Modifications"] -action.escu.fields_required = ["instanceId"] -action.escu.earliest_time_offset = 86400 -action.escu.latest_time_offset = 0 -description = This search queries AWS description logs and returns all the information about a specific instance via the instanceId field -disabled=true -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | search sourcetype="aws:description" source="*:ec2_instances"| dedup id sortby -_time | search id=$instanceId$ | spath output=tags path=tags | eval tags=mvzip(key,value," = "), ip_address=if((ip_address == "null"),private_ip_address,ip_address) | table id, tags.Name, aws_account_id, placement, instance_type, key_name, ip_address, launch_time, state, vpc_id, subnet_id, tags | rename aws_account_id as "Account ID", id as ID, instance_type as Type, ip_address as "IP Address", key_name as "Key Pair", launch_time as "Launch Time", placement as "Availability Zone", state as State, subnet_id as Subnet, "tags.Name" as Name, vpc_id as VPC - [ESCU - AWS Network Access Control List Created with All Open Ports - Rule] action.escu = 0 action.escu.enabled = 1 @@ -1557,66 +1558,44 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` min(_time) as firstTime max(_time) as lastTime from datamodel=Vulnerabilities where Vulnerabilities.cve ="CVE-2017-5753" OR Vulnerabilities.cve ="CVE-2017-5715" OR Vulnerabilities.cve ="CVE-2017-5754" by Vulnerabilities.dest -[ESCU - Get Notable History] +[ESCU - Malicious PowerShell Process With Obfuscation Techniques - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-03-15 -action.escu.modification_date = 2017-09-20 -action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = If you are using Enterprise Security you are likely already creating notable events with your correlation rules. No additional configuration is necessary. -action.escu.full_search_name = ESCU - Get Notable History -action.escu.known_false_positives = None at this time -action.escu.search_type = contextual -action.escu.providing_technologies = ["Splunk Enterprise Security"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "JBoss Vulnerability", "Orangeworm Attack Group", "Monitor for Unauthorized Software", "AWS Network ACL Activity", "ColdRoot MacOS RAT", "Command and Control", "Router & Infrastructure Security", "Emotet Malware (TA18-201A)", "Credential Dumping", "Data Protection", "ColdRoot MacOS RAT", "Brand Monitoring", "Disabling Security Tools", "Spectre And Meltdown Vulnerabilities", "Suspicious Windows Registry Activities", "Suspicious AWS Traffic", "Windows Privilege Escalation", "Windows Persistence Techniques", "Asset Tracking", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Use of Cleartext Protocols", "Account Monitoring and Controls", "DNS Amplification Attacks", "Unusual Processes", "SQL Injection", "Dynamic DNS", "Collection and Staging", "Suspicious AWS Login Activities", "Prohibited Traffic Allowed or Protocol Mismatch", "Web Fraud Detection", "Suspicious Command-Line Executions", "Splunk Enterprise Vulnerability", "Ransomware", "Windows Service Abuse", "Netsh Abuse", "Monitor Backup Solution", "Windows Defense Evasion Tactics", "Splunk Enterprise Vulnerability CVE-2018-11409", "SamSam Ransomware", "Host Redirection", "DHS Report TA18-074A", "AWS Cross Account Activity", "Suspicious AWS EC2 Activities", "Suspicious MSHTA Activity", "Malicious PowerShell", "Lateral Movement", "Windows Log Manipulation", "Suspicious AWS S3 Activities", "Monitor for Updates", "Unusual AWS EC2 Modifications", "Suspicious DNS Traffic", "AWS User Monitoring", "Apache Struts Vulnerability", "Suspicious WMI Use", "Suspicious Emails"] -action.escu.fields_required = ["dest"] -action.escu.earliest_time_offset = 864000 -action.escu.latest_time_offset = 86400 -description = This search queries the notable index and returns all the Notable Events for the particular destination host, giving the analyst an overview of the incidents that may have occurred with the host under investigation. -disabled=true -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | search `notable` | search dest=$dest$ | table _time, rule_name, owner, priority, severity, status_description - -[ESCU - EC2 Instance Started With Previously Unseen AMI - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-03-12 -action.escu.modification_date = 2018-03-12 -action.escu.asset_at_risk = AWS Instance +action.escu.creation_date = 2017-04-25 +action.escu.modification_date = 2018-12-03 +action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = The subsearch returns the AMI image ID of all successful EC2 instance launches within the last hour and then appends the historical data from the lookup file to those results. It then recalculates the earliest and latest seen time field for each AMI image ID and returns only those AMI image IDs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance id of those systems. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 AMIs" support search once to create a history of previously seen AMIs. -action.escu.full_search_name = ESCU - EC2 Instance Started With Previously Unseen AMI - Rule -action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -action.escu.known_false_positives = After a new AMI is created, the first systems created with that AMI will cause this alert to fire. Verify that the AMI being used was created by a legitimate user. +action.escu.eli5 = This search looks for PowerShell processes that are passing command-line arguments with unusual characters (backticks and carets) that are PowerShell specific escape characters. Attackers use this obfuscation technique since it does not affect the functionality of PowerShell and it will bypass standard security controls that look for straight up malicious strings and commands. The search counts the occurrence of these obfuscation characters and lists out destination IPs running these PowerShell commands. +action.escu.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. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Malicious PowerShell Process With Obfuscation Techniques - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} +action.escu.known_false_positives = These characters might be legitimately on the command-line, but it is not common. action.escu.search_type = detection -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Cryptomining"] +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Malicious PowerShell"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = EC2 Instance Started With Previously Unseen AMI +action.correlationsearch.label = Malicious PowerShell Process With Obfuscation Techniques action.notable = 1 -action.notable.param.nes_fields = dest -action.notable.param.rule_description = The EC2 instance $dest$ was created with previously unused AMI $amiID$ -action.notable.param.rule_title = EC2 Instance Type $dest$ Created With New AMI +action.notable.param.nes_fields = dest, user, process_name, process +action.notable.param.rule_description = The system $dest$ executed a PowerShell process that has evidence of obfuscation on the command-line +action.notable.param.rule_title = PowerShell process with an obfuscation techniques detected on $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get EC2 Launch Details\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest action.risk.param._risk_object_type = system -action.risk.param._risk_score = 30 +action.risk.param._risk_score = 60 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest +alert.suppress.fields = dest,process_name,process alert.suppress.period = 14400s cron_schedule = 0 * * * * -description = This search looks for EC2 instances being created with previously unseen AMIs. +description = This search looks for PowerShell processes launched with arguments that have characters indicative of obfuscation on the command-line. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -1627,7 +1606,30 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail eventName=RunInstances [search sourcetype=aws:cloudtrail eventName=RunInstances errorCode=success | stats earliest(_time) as earliest latest(_time) as latest by requestParameters.instancesSet.items{}.imageId | rename requestParameters.instancesSet.items{}.imageId as amiID | inputlookup append=t previously_seen_ec2_amis.csv | stats min(earliest) as earliest max(latest) as latest by amiID | outputlookup previously_seen_ec2_amis.csv | eval newAMI=if(earliest >= relative_time(now(), "-70m@m"), 1, 0) | convert ctime(earliest) ctime(latest) | where newAMI=1 | rename amiID as requestParameters.instancesSet.items{}.imageId | table requestParameters.instancesSet.items{}.imageId] | rename requestParameters.instanceType as instanceType, responseElements.instancesSet.items{}.instanceId as dest, userIdentity.arn as arn, requestParameters.instancesSet.items{}.imageId as amiID | table _time, arn, amiID, dest, instanceType +search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=powershell.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)`| eval num_obfuscation = (mvcount(split(process, "`"))-1) + (mvcount(split(process, "^"))-1) | search num_obfuscation > 0 + +[ESCU - Get Parent Process Info] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2017-08-22 +action.escu.modification_date = 2017-09-10 +action.escu.channel = ESCU +action.escu.eli5 = none +action.escu.how_to_implement = To successfully implement this search you must be ingesting endpoint data via Microsoft-Windows-Sysmon and extract the Image and Parent Image field. +action.escu.full_search_name = ESCU - Get Parent Process Info +action.escu.known_false_positives = None at this time +action.escu.search_type = investigative +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Ransomware", "Netsh Abuse", "Collection and Staging", "Orangeworm Attack Group", "Suspicious Windows Registry Activities", "Credential Dumping", "Emotet Malware (TA18-201A)", "SamSam Ransomware", "Disabling Security Tools", "Windows Privilege Escalation", "Suspicious Command-Line Executions", "Windows Service Abuse", "Windows File Extension and Association Abuse", "Windows Persistence Techniques", "Windows Defense Evasion Tactics", "Hidden Cobra Malware", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] +action.escu.fields_required = ["process", "dest"] +action.escu.earliest_time_offset = 0 +action.escu.latest_time_offset = 86400 +description = This search queries the Application State data model to give you details about the parent process of a process running on a host which is under investigation. Enter the values of the process name in question and the dest_ip +disabled=true +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | search sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational process=$process$ dest=$dest$ | table parent_process parent_process_id [ESCU - Processes launching netsh - Rule] action.escu = 0 @@ -1645,7 +1647,7 @@ action.escu.mappings = {"mitre_attack": ["Execution", "Command-Line Interface", action.escu.known_false_positives = Some VPN applications are known to launch netsh.exe. Outside of these instances, it is unusual for an executable to launch netsh.exe and run commands. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Disabling Security Tools", "Netsh Abuse", "DHS Report TA18-074A"] +action.escu.analytic_story = ["Netsh Abuse", "Disabling Security Tools", "DHS Report TA18-074A"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Processes launching netsh action.notable = 1 @@ -1729,45 +1731,45 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Application_State where All_Application_State.dest_category="web_server" AND (All_Application_State.process="*whoami*" OR All_Application_State.process="*ping*" OR All_Application_State.process="*iptables*" OR All_Application_State.process="*wget*" OR All_Application_State.process="*service*" OR All_Application_State.process="*curl*") by All_Application_State.process, All_Application_State.dest | `ctime(firstTime)` | `ctime(lastTime)` | `drop_dm_object_name("All_Application_State")` -[ESCU - Shim Database File Creation - Rule] +[ESCU - Large Volume of DNS ANY Queries - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-10-03 -action.escu.modification_date = 2018-11-02 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2016-08-24 +action.escu.modification_date = 2017-09-20 +action.escu.asset_at_risk = DNS Servers action.escu.channel = ESCU action.escu.confidence = high -action.escu.eli5 = This search looks for files being created in `Windows\AppPatch\Custom and Windows\AppPatch\Custom64`, the location where shim databases are installed. It will return all the files created, as well as the time of creation for the first and last file for each endpoint. -action.escu.how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Shim Database File Creation - Rule -action.escu.mappings = {"mitre_attack": ["Persistence", "Application Shimming"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} -action.escu.known_false_positives = Because legitimate shim files are created and used all the time, this event, in itself, is not suspicious. However, if there are other correlating events, it may warrant further investigation. +action.escu.eli5 = This search counts the number of DNS ANY queries received in 5 minutes, and generates a Notable Event if the count exceeds a predefined threshold. The search returns the count, the first time, and the last time a DNS packet was observed with the ANY flag set. +action.escu.how_to_implement = To successfully implement this search you must ensure that DNS data is populating the Network_Resolution data model. +action.escu.data_models = ["Network_Resolution"] +action.escu.full_search_name = ESCU - Large Volume of DNS ANY Queries - Rule +action.escu.mappings = {"kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 11", "CIS 12"], "nist": ["PR.PT", "DE.AE", "PR.IP"]} +action.escu.known_false_positives = Legitimate ANY requests may trigger this search, however it is unusual to see a large volume of them under typical circumstances. You may modify the threshold in the search to better suit your environment. action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -action.escu.analytic_story = ["Windows Persistence Techniques"] +action.escu.providing_technologies = ["Splunk Stream", "Bro"] +action.escu.analytic_story = ["DNS Amplification Attacks"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Shim Database File Creation +action.correlationsearch.label = Large Volume of DNS ANY Queries action.notable = 1 -action.notable.param.nes_fields = dest, file_name -action.notable.param.rule_description = A file, $file_name$, was created in the default shim database directory on $dest. -action.notable.param.rule_title = Shim database file created on $dest$ -action.notable.param.security_domain = endpoint +action.notable.param.nes_fields = dest +action.notable.param.rule_description = The search is used to identify attempts to use your DNS Infrastructure for DDoS purposes via a DNS amplification attack leveraging ANY queries. +action.notable.param.rule_title = Large Volume of DNS ANY Queries +action.notable.param.security_domain = network action.notable.param.severity = high -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest action.risk.param._risk_object_type = system -action.risk.param._risk_score = 20 +action.risk.param._risk_score = 60 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 alert.suppress.fields = dest -alert.suppress.period = 14400s -cron_schedule = 0 * * * * -description = This search looks for shim database files being written to default directories. The sdbinst.exe application is used to install shim database files (.sdb). According to Microsoft, a shim is a small library that transparently intercepts an API, changes the parameters passed, handles the operation itself, or redirects the operation elsewhere. -dispatch.earliest_time = -70m@m +alert.suppress.period = 7200s +cron_schedule = */5 * * * * +description = The search is used to identify attempts to use your DNS Infrastructure for DDoS purposes via a DNS amplification attack leveraging ANY queries. +dispatch.earliest_time = -15m@m dispatch.latest_time = -10m@m disabled=true enableSched = 1 @@ -1777,7 +1779,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count values(Filesystem.action) values(Filesystem.file_hash) as file_hash values(Filesystem.file_path) as file_path min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.file_path=*Windows\AppPatch\Custom* by Filesystem.file_name Filesystem.dest | `ctime(lastTime)` | `ctime(firstTime)` |`drop_dm_object_name(Filesystem)` +search = | tstats `summariesonly` count from datamodel=Network_Resolution where nodename=DNS "DNS.message_type"="QUERY" "DNS.record_type"="ANY" by "DNS.dest" | `drop_dm_object_name("DNS")` | where count>200 [ESCU - Previously Seen EC2 Launches By User] action.escu = 0 @@ -1817,7 +1819,7 @@ action.escu.mappings = {"mitre_attack": ["Command and Control", "Exfiltration", action.escu.known_false_positives = It's possible that legitimate TXT record responses can be long enough to trigger this search. You can modify the packet threshold for this search to help mitigate false positives. action.escu.search_type = detection action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Suspicious DNS Traffic", "Command and Control"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Detect Long DNS TXT Record Response action.notable = 1 @@ -1826,7 +1828,7 @@ action.notable.param.rule_description = A DNS TXT record response of over 100 ch action.notable.param.rule_title = Long DNS TXT Record Response action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src @@ -1950,27 +1952,55 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=reg.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)`| search (process=*add* process=*Software\\Microsoft\\Powershell\\1\\ShellIds\\Microsoft.PowerShell* process=*ExecutionPolicy* process=*Unrestricted*) -[ESCU - Previously Seen AWS Cross Account Activity] +[ESCU - Prohibited Network Traffic Allowed - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-06-04 -action.escu.modification_date = 2018-06-04 +action.escu.creation_date = 2017-04-18 +action.escu.modification_date = 2017-09-11 +action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU -action.escu.eli5 = In this support search, we look for **AssumeRole** events where the requesting account is different from the requested account. The first and last times these events are seen are written to a lookup file. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Validate the user name entries in `previously_seen_aws_cross_account_activity.csv`, a lookup file created by this support search. -action.escu.full_search_name = ESCU - Previously Seen AWS Cross Account Activity -action.escu.known_false_positives = None at this time -action.escu.search_type = support -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Cross Account Activity"] -description = This search looks for **AssumeRole** events where the requesting account differs from the requested account, then writes these relationships to a lookup file. -dispatch.earliest_time = -30d@d +action.escu.confidence = medium +action.escu.eli5 = The search looks for traffic marked 'is_prohibited' in the Enterprise Security lookup table 'interesting_ports_lookup', and then determines if any network devices have an associated 'allow' action on that traffic by checking the Network_Traffic data model. +action.escu.how_to_implement = In order to properly run this search, Splunk needs to ingest data from firewalls or other network control devices that mediate the traffic allowed into an environment. This is necessary so that the search can identify an 'action' taken on the traffic of interest. The search requires the Network_Traffic data model be populated. +action.escu.data_models = ["Network_Traffic"] +action.escu.full_search_name = ESCU - Prohibited Network Traffic Allowed - Rule +action.escu.mappings = {"mitre_attack": ["Command and Control", "Commonly Used Port", "Exfiltration", "Exfiltration Over Alternative Protocol"], "kill_chain_phases": ["Delivery", "Command and Control"], "cis20": ["CIS 9", "CIS 12"], "nist": ["DE.AE", "PR.AC"]} +action.escu.known_false_positives = None identified +action.escu.search_type = detection +action.escu.providing_technologies = ["Palo Alto Firewall", "Bro", "Splunk Stream"] +action.escu.analytic_story = ["Ransomware", "Prohibited Traffic Allowed or Protocol Mismatch", "Command and Control"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Prohibited Network Traffic Allowed +action.notable = 1 +action.notable.param.nes_fields = src_ip, dest_ip +action.notable.param.rule_description = This search looks for network traffic defined by port and transport in the ES lookup table "lookup_interesting_ports", that is marked as prohibited, and yet has an 'allow' action in the Network_Traffic data model. This should help to identify areas where a network device is not properly configured. +action.notable.param.rule_title = Prohibited Network Traffic Allowed from $src_ip$ +action.notable.param.security_domain = network +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = src_ip +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 40 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest_ip,src_ip +alert.suppress.period = 14400s +cron_schedule = 0 * * * * +description = This search looks for network traffic defined by port and transport layer protocol in the Enterprise Security lookup table "lookup_interesting_ports", that is marked as prohibited, and has an associated 'allow' action in the Network_Traffic data model. This could be indicative of a misconfigured network device. +dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail eventName=AssumeRole | spath output=requestingAccountId path=userIdentity.accountId | spath output=requestedAccountId path=resources{}.accountId | search requestingAccountId=* | where requestingAccountId!=requestedAccountId | stats earliest(_time) as firstTime latest(_time) as lastTime by requestingAccountId, requestedAccountId | outputlookup previously_seen_aws_cross_account_activity | stats count +search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Network_Traffic where All_Traffic.action = allowed by All_Traffic.src_ip All_Traffic.dest_ip All_Traffic.dest_port All_Traffic.action | lookup update=true interesting_ports_lookup dest_port as All_Traffic.dest_port OUTPUT app is_prohibited note transport | search is_prohibited=true | `ctime(firstTime)` | `ctime(lastTime)` | `drop_dm_object_name("All_Traffic")` [ESCU - Count of assets by category] action.escu = 0 @@ -1995,29 +2025,104 @@ schedule_window = auto is_visible = false search = | from datamodel Identity_Management.All_Assets | stats count values(nt_host) by category | sort -count -[ESCU - Investigate Web Activity From Host] +[ESCU - Suspicious File Write - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-04-21 -action.escu.modification_date = 2017-11-09 +action.escu.creation_date = 2018-06-14 +action.escu.modification_date = 2018-11-14 +action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = To successfully implement this search you must be ingesting your web traffic and populating the Web data model. -action.escu.data_models = ["Web"] -action.escu.full_search_name = ESCU - Investigate Web Activity From Host -action.escu.known_false_positives = None at this time -action.escu.search_type = investigative -action.escu.providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] -action.escu.analytic_story = ["Orangeworm Attack Group", "Monitor for Unauthorized Software", "Emotet Malware (TA18-201A)", "Credential Dumping", "Brand Monitoring", "Unusual Processes", "Suspicious Command-Line Executions", "Ransomware", "Netsh Abuse", "SamSam Ransomware", "Host Redirection", "Suspicious Emails"] -action.escu.fields_required = ["dest"] -action.escu.earliest_time_offset = 3600 -action.escu.latest_time_offset = 3600 -description = This search allows you to find all the web activity from a specific host. During an investigation, it is important to profile web activity to characterize user or host activity. +action.escu.confidence = high +action.escu.eli5 = This search looks at files being created or modified in the Endpoint file-system data model. The names of those files are checked against an included lookup file, which contains the names of files associated with malware or attack activity. The search returns any files with matching names, along with a note (also specified in the lookup file) that gives or points to more information about the files. +action.escu.how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. This is typically populated via endpoint detection-and-response products, such as Carbon Black, or via other endpoint data sources, such as Sysmon. The data used for this search is typically generated via logs that report file system reads and writes. In addition, this search leverages an included lookup file that contains the names of the files to watch for, as well as a note to communicate why that file name is being monitored. This lookup file can be edited to add or remove file the file names you want to monitor. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Suspicious File Write - Rule +action.escu.mappings = {"mitre_attack": [], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +action.escu.known_false_positives = It's possible for a legitimate file to be created with the same name as one noted in the lookup file. Filenames listed in the lookup file should be unique enough that collisions are rare. Looking at the location of the file and the process responsible for the activity can help determine whether or not the activity is legitimate. +action.escu.search_type = detection +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] +action.escu.analytic_story = ["Hidden Cobra Malware"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Suspicious File Write +action.notable = 1 +action.notable.param.nes_fields = dest, file_name +action.notable.param.rule_description = A write to a filename associated with malicious activity detected on $dest$. +action.notable.param.rule_title = Suspicious File Write Detected on $dest$ +action.notable.param.security_domain = endpoint +action.notable.param.severity = high +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Outbound Emails to Hidden Cobra Threat Actors\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 80 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest,file_name +alert.suppress.period = 14400s +cron_schedule = 0 * * * * +description = The search looks for files created with names that have been linked to malicious activity. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | from datamodel Web.Web | search src=$dest$ +search = | tstats `summariesonly` count values(Filesystem.action) as action values(Filesystem.file_path) as file_path min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem by Filesystem.file_name Filesystem.dest | `ctime(lastTime)` | `ctime(firstTime)` | `drop_dm_object_name(Filesystem)` + +[ESCU - Detect API activity from users without MFA - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2018-05-17 +action.escu.modification_date = 2018-05-17 +action.escu.asset_at_risk = AWS Instance +action.escu.channel = ESCU +action.escu.confidence = medium +action.escu.eli5 = In this search, we query CloudTrail logs and specifically look for events where the multi factor authentication context of the user's session is false which basically means, that the user does not have MFA enabled on AWS. We then filter out all the known AWS service accounts since service accounts typically do not have MFA enabled. The search then creates a table of the first and last time a user without MFA was detected, the values and count of the API calls made, the type of user identity, ARN and the name of the user. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. Leverage the support search `Create a list of approved AWS service accounts`: run it once every 30 days to create a list of service accounts and validate them. +action.escu.full_search_name = ESCU - Detect API activity from users without MFA - Rule +action.escu.mappings = {"mitre_attack": ["Execution"], "cis20": ["CIS 16"], "nist": ["DE.DP", "PR.AC"]} +action.escu.known_false_positives = Many service accounts configured within an AWS infrastructure do not have multi factor authentication enabled. Please ignore the service accounts, if triggered and instead add them to the aws_service_accounts.csv file to fine tune the detection. It is also possible that the search detects users in your environment using Single Sign-On systems, since the MFA is not handled by AWS. +action.escu.search_type = detection +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["AWS User Monitoring"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Detect API activity from users without MFA +action.notable = 1 +action.notable.param.nes_fields = user +action.notable.param.rule_description = API Activity detected from $user$ without MFA enabled. +action.notable.param.rule_title = API Activity detected from $user$ without MFA enabled +action.notable.param.security_domain = network +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate AWS User Activities by user field\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = user +action.risk.param._risk_object_type = user +action.risk.param._risk_score = 30 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = user +alert.suppress.period = 84600s +cron_schedule = 0 8 * * * +description = This search looks for CloudTrail events where a user logged into the AWS account, is making API calls and has not enabled Multi Factor authentication. Multi factor authentication adds a layer of security by forcing the users to type a unique authentication code from an approved authentication device when they access AWS websites or services. AWS Best Practices recommend that you enable MFA for privileged IAM users. +dispatch.earliest_time = -1d@d +dispatch.latest_time = -10m@m +disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = sourcetype=aws:cloudtrail userIdentity.sessionContext.attributes.mfaAuthenticated=false | search NOT [| inputlookup aws_service_accounts | fields identity | rename identity as user]| stats count min(_time) as firstTime max(_time) as lastTime values(eventName) by userIdentity.arn userIdentity.type user | `ctime(firstTime)` | `ctime(lastTime)` [ESCU - Previously Seen Running Windows Services] action.escu = 0 @@ -2057,7 +2162,7 @@ action.escu.mappings = {"mitre_attack": ["Command and Control", "Exfiltration", action.escu.known_false_positives = It's possible that an enterprise has more than five DNS servers that are configured in a round-robin rotation. Please customize the search, as appropriate. action.escu.search_type = detection action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Suspicious DNS Traffic", "Command and Control"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Clients Connecting to Multiple DNS Servers action.notable = 1 @@ -2066,7 +2171,7 @@ action.notable.param.rule_description = This search allows you to identify the e action.notable.param.rule_title = Client $src$ Connecting to Multiple DNS Servers action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src @@ -2164,55 +2269,27 @@ schedule_window = auto is_visible = false search = sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode>18 EventCode<22 host=$dest$ | rename host as dest | table _time, dest, user, Name, Operation, EventType, Type, Query, Consumer, Filter -[ESCU - Detect Prohibited Applications Spawning cmd.exe - Rule] +[ESCU - Previously Seen AWS Regions] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-10-07 -action.escu.modification_date = 2018-11-15 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2018-01-08 +action.escu.modification_date = 2018-01-08 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = Obtaining access to the Command-Line Interface (CLI) is typically a primary attacker goal. Once an attacker has obtained the ability to execute code on a target system, they will often further manipulate the system via commands passed to the CLI. It is also unusual for many applications to spawn a command shell during normal operation, while it is often observed if an application has been compromised in some way. As such, it is often beneficial to look for cmd.exe being executed by processes that are often targeted for exploitation, or that would not spawn cmd.exe in any other circumstances. A lookup file is provided to easily modify the processes that are being watched for execution of cmd.exe. -action.escu.how_to_implement = You must be ingesting data that records process activity from your hosts and populates the Endpoint data model with the resultant dataset. This search includes a lookup file, `prohibited_apps_launching_cmd.csv`, that contains a list of processes that should not be spawning cmd.exe. You can modify this lookup to better suit your environment. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Detect Prohibited Applications Spawning cmd.exe - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -action.escu.known_false_positives = There are circumstances where an application may legitimately execute and interact with the Windows command-line interface. Investigate and modify the lookup file, as appropriate. -action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Suspicious Command-Line Executions", "Suspicious MSHTA Activity"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect Prohibited Applications Spawning cmd.exe -action.notable = 1 -action.notable.param.nes_fields = dest, process, parent_process -action.notable.param.rule_description = A prohibited application from prohibited_apps_launching_cmd.csv was leveraged to launch cmd.exe -action.notable.param.rule_title = Prohibited application($parent_process$) used to launch cmd.exe on $dest$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Registry Activities\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 80 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = dest, parent_process -alert.suppress.period = 86400s -cron_schedule = 0 * * * * -description = This search looks for executions of cmd.exe spawned by a process that is often abused by attackers and that does not typically launch cmd.exe. -dispatch.earliest_time = -70m@m +action.escu.eli5 = In this support search, we create a table of the first time (earliest) and most recent time (latest) that this region has been seen in our dataset, grouped by the value `awsRegion`. We only look for those events where an instance has been started. All of these entries will be added to the `previously_seen_aws_regions.csv` lookup file, which will act like a baseline for detections. Please validate the entries of region names in the lookup file. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. +action.escu.full_search_name = ESCU - Previously Seen AWS Regions +action.escu.known_false_positives = None at this time +action.escu.search_type = support +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["AWS Cryptomining", "Suspicious AWS EC2 Activities"] +description = This search looks for CloudTrail events where an AWS instance is started and creates a baseline of most recent time (latest) and the first time (earliest) we've seen this region in our dataset grouped by the value awsRegion for the last 30 days +dispatch.earliest_time = -30d@d dispatch.latest_time = -10m@m disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count values(Processes.user) as user values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=cmd.exe by Processes.parent_process Processes.process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` |search [`prohibited_apps_launching_cmd`] +search = sourcetype=aws:cloudtrail StartInstances | stats earliest(_time) as earliest latest(_time) as latest by awsRegion | outputlookup previously_seen_aws_regions.csv | stats count [ESCU - Detect USB device insertion - Rule] action.escu = 0 @@ -2264,28 +2341,28 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count earliest(_time) AS earliest latest(_time) AS latest from datamodel=Change_Analysis where (nodename = All_Changes) All_Changes.result="Removable Storage device" (All_Changes.result_id=4663 OR All_Changes.result_id=4656) (All_Changes.src_priority=high) by All_Changes.dest | `drop_dm_object_name("All_Changes")`| `ctime(earliest)`| `ctime(latest)` -[ESCU - Get Backup Logs For Endpoint] +[ESCU - Get User Information from Identity Table] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-08-24 -action.escu.modification_date = 2017-09-14 +action.escu.creation_date = 2017-04-10 +action.escu.modification_date = 2017-09-20 action.escu.channel = ESCU action.escu.eli5 = none -action.escu.how_to_implement = You must be ingesting your backup logs. -action.escu.full_search_name = ESCU - Get Backup Logs For Endpoint +action.escu.how_to_implement = To successfully implement this search you must have populated the identity table with information about your users. +action.escu.full_search_name = ESCU - Get User Information from Identity Table action.escu.known_false_positives = None at this time action.escu.search_type = contextual -action.escu.providing_technologies = ["Netbackup"] -action.escu.analytic_story = ["Ransomware", "SamSam Ransomware"] -action.escu.fields_required = ["dest"] -action.escu.earliest_time_offset = 604800 -action.escu.latest_time_offset = 0 -description = This search will tell you the backup status from your netbackup_logs of a specific endpoint for the last week. +action.escu.providing_technologies = ["Splunk Enterprise Security"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Ransomware", "Apache Struts Vulnerability", "Netsh Abuse", "Collection and Staging", "JBoss Vulnerability", "Suspicious AWS S3 Activities", "Orangeworm Attack Group", "Use of Cleartext Protocols", "Host Redirection", "Dynamic DNS", "Suspicious Windows Registry Activities", "AWS Network ACL Activity", "Credential Dumping", "Monitor for Unauthorized Software", "Brand Monitoring", "Malicious PowerShell", "Splunk Enterprise Vulnerability", "Lateral Movement", "Emotet Malware (TA18-201A)", "Suspicious Emails", "SamSam Ransomware", "Spectre And Meltdown Vulnerabilities", "Disabling Security Tools", "Suspicious WMI Use", "Suspicious DNS Traffic", "Unusual Processes", "Router & Infrastructure Security", "Monitor for Updates", "Windows Privilege Escalation", "Suspicious Command-Line Executions", "SQL Injection", "Windows Service Abuse", "ColdRoot MacOS RAT", "Command and Control", "ColdRoot MacOS RAT", "Windows File Extension and Association Abuse", "Suspicious AWS EC2 Activities", "Account Monitoring and Controls", "Windows Persistence Techniques", "Suspicious AWS Login Activities", "Windows Defense Evasion Tactics", "Hidden Cobra Malware", "Data Protection", "Asset Tracking", "Windows Log Manipulation", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] +action.escu.fields_required = ["user"] +action.escu.earliest_time_offset = 864000 +action.escu.latest_time_offset = 86400 +description = Gather more information about the user identified in the Notable Event. disabled=true realtime_schedule = 0 schedule_window = auto is_visible = false -search = | search sourcetype="netbackup_logs" COMPUTERNAME=$dest$ | rename COMPUTERNAME as dest, MESSAGE as signature | table _time, dest, signature +search = | `identities` | search identity=$user$ | table _time, identity, first, last, email, category, watchlist [ESCU - Get DNS Server History for a host] action.escu = 0 @@ -2299,7 +2376,7 @@ action.escu.full_search_name = ESCU - Get DNS Server History for a host action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Data Protection", "Brand Monitoring", "Dynamic DNS", "Host Redirection", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Host Redirection", "Dynamic DNS", "Brand Monitoring", "Suspicious DNS Traffic", "Command and Control", "Data Protection"] action.escu.fields_required = ["src_ip"] action.escu.earliest_time_offset = 0 action.escu.latest_time_offset = 86400 @@ -2398,7 +2475,7 @@ action.escu.mappings = {"mitre_attack": ["Defense Evasion", "Persistence", "Late action.escu.known_false_positives = This technique may be legitimately used by administrators to modify remote registries, so it's important to filter these events out. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -action.escu.analytic_story = ["Suspicious Windows Registry Activities", "Windows Persistence Techniques", "Windows Defense Evasion Tactics", "Lateral Movement"] +action.escu.analytic_story = ["Suspicious Windows Registry Activities", "Lateral Movement", "Windows Persistence Techniques", "Windows Defense Evasion Tactics"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Remote Registry Key modifications action.notable = 1 @@ -2407,7 +2484,7 @@ action.notable.param.rule_description = A registry key was modified remotely usi action.notable.param.rule_title = Remote Registry Key Modification detection on $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest @@ -2494,7 +2571,7 @@ action.escu.full_search_name = ESCU - Get Notable Info action.escu.known_false_positives = None at this time action.escu.search_type = contextual action.escu.providing_technologies = ["Splunk Enterprise Security"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "JBoss Vulnerability", "Orangeworm Attack Group", "AWS Network ACL Activity", "Command and Control", "Router & Infrastructure Security", "Emotet Malware (TA18-201A)", "Credential Dumping", "Data Protection", "Brand Monitoring", "Disabling Security Tools", "Spectre And Meltdown Vulnerabilities", "Suspicious AWS Traffic", "Windows Privilege Escalation", "Windows Persistence Techniques", "Asset Tracking", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Use of Cleartext Protocols", "Account Monitoring and Controls", "DNS Amplification Attacks", "SQL Injection", "Dynamic DNS", "Collection and Staging", "Suspicious AWS Login Activities", "Web Fraud Detection", "Suspicious Command-Line Executions", "Splunk Enterprise Vulnerability", "Windows Service Abuse", "Windows Defense Evasion Tactics", "Splunk Enterprise Vulnerability CVE-2018-11409", "Host Redirection", "DHS Report TA18-074A", "Suspicious AWS EC2 Activities", "Malicious PowerShell", "Lateral Movement", "Windows Log Manipulation", "Suspicious AWS S3 Activities", "Monitor for Updates", "Suspicious DNS Traffic", "AWS User Monitoring", "Apache Struts Vulnerability", "Suspicious WMI Use"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Apache Struts Vulnerability", "Collection and Staging", "Web Fraud Detection", "JBoss Vulnerability", "Suspicious AWS S3 Activities", "Orangeworm Attack Group", "Use of Cleartext Protocols", "Host Redirection", "Dynamic DNS", "AWS Network ACL Activity", "Credential Dumping", "Suspicious AWS Traffic", "Brand Monitoring", "Splunk Enterprise Vulnerability CVE-2018-11409", "Malicious PowerShell", "Splunk Enterprise Vulnerability", "Lateral Movement", "Emotet Malware (TA18-201A)", "Spectre And Meltdown Vulnerabilities", "Disabling Security Tools", "Suspicious WMI Use", "Suspicious DNS Traffic", "Router & Infrastructure Security", "Monitor for Updates", "Windows Privilege Escalation", "Suspicious Command-Line Executions", "SQL Injection", "Windows Service Abuse", "Command and Control", "Windows File Extension and Association Abuse", "Suspicious AWS EC2 Activities", "DNS Amplification Attacks", "Account Monitoring and Controls", "Windows Persistence Techniques", "Suspicious AWS Login Activities", "Windows Defense Evasion Tactics", "Hidden Cobra Malware", "Data Protection", "Asset Tracking", "Windows Log Manipulation", "AWS User Monitoring", "DHS Report TA18-074A"] action.escu.fields_required = ["event_id"] action.escu.earliest_time_offset = 3600 action.escu.latest_time_offset = 3600 @@ -2521,7 +2598,7 @@ action.escu.mappings = {"mitre_attack": ["Exfiltration", "Exfiltration Over Alte action.escu.known_false_positives = It is possible legitimate traffic can trigger this rule. Please investigate as appropriate. The threshold for generating an event can also be customized to better suit your environment. action.escu.search_type = detection action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Suspicious DNS Traffic", "Command and Control"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Excessive DNS Failures action.notable = 1 @@ -2530,7 +2607,7 @@ action.notable.param.rule_description = This search identifies DNS query failure action.notable.param.rule_title = Excessive DNS Failures action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src @@ -2571,7 +2648,7 @@ action.escu.mappings = {"mitre_attack": ["Command and Control", "Exfiltration", action.escu.known_false_positives = It's possible there can be long domain names that are legitimate. action.escu.search_type = detection action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Hidden Cobra Malware", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Suspicious DNS Traffic", "Command and Control", "Hidden Cobra Malware"] action.correlationsearch.enabled = 1 action.correlationsearch.label = DNS Query Length With High Standard Deviation action.notable = 1 @@ -2580,7 +2657,7 @@ action.notable.param.rule_description = Filter DNS requests and compute the stan action.notable.param.rule_title = DNS query length with high standard deviation action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Outbound Emails to Hidden Cobra Threat Actors\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest @@ -2655,27 +2732,55 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=fsutil.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` | search process="*deletejournal*" AND process="*usn*" -[ESCU - Previously Seen AWS Regions] +[ESCU - Detect Prohibited Applications Spawning cmd.exe - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-01-08 -action.escu.modification_date = 2018-01-08 +action.escu.creation_date = 2017-10-07 +action.escu.modification_date = 2018-11-15 +action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU -action.escu.eli5 = In this support search, we create a table of the first time (earliest) and most recent time (latest) that this region has been seen in our dataset, grouped by the value `awsRegion`. We only look for those events where an instance has been started. All of these entries will be added to the `previously_seen_aws_regions.csv` lookup file, which will act like a baseline for detections. Please validate the entries of region names in the lookup file. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. -action.escu.full_search_name = ESCU - Previously Seen AWS Regions -action.escu.known_false_positives = None at this time -action.escu.search_type = support -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Cryptomining", "Suspicious AWS EC2 Activities"] -description = This search looks for CloudTrail events where an AWS instance is started and creates a baseline of most recent time (latest) and the first time (earliest) we've seen this region in our dataset grouped by the value awsRegion for the last 30 days -dispatch.earliest_time = -30d@d +action.escu.confidence = medium +action.escu.eli5 = Obtaining access to the Command-Line Interface (CLI) is typically a primary attacker goal. Once an attacker has obtained the ability to execute code on a target system, they will often further manipulate the system via commands passed to the CLI. It is also unusual for many applications to spawn a command shell during normal operation, while it is often observed if an application has been compromised in some way. As such, it is often beneficial to look for cmd.exe being executed by processes that are often targeted for exploitation, or that would not spawn cmd.exe in any other circumstances. A lookup file is provided to easily modify the processes that are being watched for execution of cmd.exe. +action.escu.how_to_implement = You must be ingesting data that records process activity from your hosts and populates the Endpoint data model with the resultant dataset. This search includes a lookup file, `prohibited_apps_launching_cmd.csv`, that contains a list of processes that should not be spawning cmd.exe. You can modify this lookup to better suit your environment. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Detect Prohibited Applications Spawning cmd.exe - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +action.escu.known_false_positives = There are circumstances where an application may legitimately execute and interact with the Windows command-line interface. Investigate and modify the lookup file, as appropriate. +action.escu.search_type = detection +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Suspicious Command-Line Executions", "Suspicious MSHTA Activity"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Detect Prohibited Applications Spawning cmd.exe +action.notable = 1 +action.notable.param.nes_fields = dest, process, parent_process +action.notable.param.rule_description = A prohibited application from prohibited_apps_launching_cmd.csv was leveraged to launch cmd.exe +action.notable.param.rule_title = Prohibited application($parent_process$) used to launch cmd.exe on $dest$ +action.notable.param.security_domain = endpoint +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Registry Activities\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 80 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest, parent_process +alert.suppress.period = 86400s +cron_schedule = 0 * * * * +description = This search looks for executions of cmd.exe spawned by a process that is often abused by attackers and that does not typically launch cmd.exe. +dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail StartInstances | stats earliest(_time) as earliest latest(_time) as latest by awsRegion | outputlookup previously_seen_aws_regions.csv | stats count +search = | tstats `summariesonly` count values(Processes.user) as user values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=cmd.exe by Processes.parent_process Processes.process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` |search [`prohibited_apps_launching_cmd`] [ESCU - WMI Temporary Event Subscription - Rule] action.escu = 0 @@ -2891,7 +2996,7 @@ action.escu.mappings = {"mitre_attack": ["Defense Evasion", "Masquerading"], "ki action.escu.known_false_positives = None identified action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Unusual Processes", "Suspicious Command-Line Executions", "Ransomware"] +action.escu.analytic_story = ["Ransomware", "Unusual Processes", "Suspicious Command-Line Executions"] action.correlationsearch.enabled = 1 action.correlationsearch.label = System Processes Run From Unexpected Locations action.notable = 1 @@ -2900,7 +3005,7 @@ action.notable.param.rule_description = The system $dest$ has a process that nor action.notable.param.rule_title = System Processes Run From Unexpected Location on $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Backup Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get Update Logs For Endpoint\n - ESCU - Get User Information from Identity Table\n - ESCU - Get Vulnerability Logs For Endpoint\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Investigate Web Activity From Host\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest @@ -3064,44 +3169,43 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime values(Filesystem.user) as user values(Filesystem.dest) as dest values(Filesystem.file_path) as file_path from datamodel=Endpoint.Filesystem by Filesystem.file_name | `drop_dm_object_name(Filesystem)` | `ctime(lastTime)` | `ctime(firstTime)`|`ransomware_notes` -[ESCU - Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments - Rule] +[ESCU - Detect PsExec With accepteula Flag - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2016-09-18 -action.escu.modification_date = 2018-12-03 +action.escu.creation_date = 2018-03-28 +action.escu.modification_date = 2018-03-28 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = This search looks for PowerShell processes that have a number of suspicious flags on the command-line. It is looking for flags are passing encoded commands on the command-line. The flags `-EncodedCommand` and `-enc` are two different possible flags that can be used to pass base64 encoded commands to PowerShell. The `*-Exec*` flag looks to see it the default execution policy of PowerShell is being overridden, while the `*-NonI*` flag tells the PowerShell process that this will be a noninteractive process, so the user doesn't know about the process. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. -action.escu.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. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} -action.escu.known_false_positives = Legitimate process can have this combination of command-line options, but it's not common. +action.escu.eli5 = In this search, we are looking for the PsExec process with `accepteula` on the command line. +action.escu.how_to_implement = To successfully implement this search, you need to be ingesting logs with the process name, command-line arguments, and parent process from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon Technology Add-on (TA). +action.escu.full_search_name = ESCU - Detect PsExec With accepteula Flag - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +action.escu.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 action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Malicious PowerShell"] +action.escu.providing_technologies = ["Sysmon"] +action.escu.analytic_story = ["SamSam Ransomware", "DHS Report TA18-074A"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments +action.correlationsearch.label = Detect PsExec With accepteula Flag action.notable = 1 -action.notable.param.nes_fields = dest, user, process, process_name -action.notable.param.rule_description = The system $dest$ executed a PowerShell that had an encoded command on the command-line, attempted to bypass local execution policy, and prevented the display of an interactive prompt to the user. -action.notable.param.rule_title = PowerShell process with multiple suspicious command-line arguments detected on $dest$ +action.notable.param.nes_fields = dest,parent_process +action.notable.param.rule_description = The process pssxec.exe was run with the -accepteula flag on $dest$ by $user$. +action.notable.param.rule_title = PsExec executed with accepteula flag on $dest$. action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest action.risk.param._risk_object_type = system -action.risk.param._risk_score = 60 +action.risk.param._risk_score = 75 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest, process_name -alert.suppress.period = 14400s -cron_schedule = 50 * * * * -description = This search looks for PowerShell processes started with a base64 encoded command-line passed to it, with parameters to modify the execution policy for the process, and those that prevent the display of an interactive prompt to the user. This combination of command-line options is suspicious because it overrides the default PowerShell execution policy, attempts to hide itself from the user, and passes an encoded script to be run on the command-line. +alert.suppress.fields = dest, parent_process +alert.suppress.period = 86400s +cron_schedule = 0 * * * * +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. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -3112,7 +3216,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=powershell.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)`| search (process=*-EncodedCommand* OR process=*-enc*) process=*-Exec* AND process=*-NonI* +search = sourcetype=xmlwineventlog:microsoft-windows-sysmon/operational process=PsExec.exe accepteula | search cmdline=*accepteula* | stats count values(cmdline) as cmdlines, min(_time) as firstTime, max(_time) as lastTime by dest, user, parent_process | `ctime(firstTime)`| `ctime(lastTime)` | table firstTime, lastTime, count, dest, user, parent_process, cmdlines [ESCU - Malicious PowerShell Process - Execution Policy Bypass - Rule] action.escu = 0 @@ -3226,7 +3330,7 @@ action.escu.full_search_name = ESCU - Get Emails From Specific Sender action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["Microsoft Exchange"] -action.escu.analytic_story = ["Brand Monitoring", "Web Fraud Detection", "Suspicious Emails"] +action.escu.analytic_story = ["Web Fraud Detection", "Brand Monitoring", "Suspicious Emails"] action.escu.fields_required = ["src_user"] action.escu.earliest_time_offset = 86400 action.escu.latest_time_offset = 86400 @@ -3375,7 +3479,7 @@ action.escu.mappings = {"mitre_attack": ["Execution", "Scripting", "Persistence" action.escu.known_false_positives = Legitimate programs can also use command-line arguments to execute. Please verify the command-line arguments to check what command/program is being executed. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Orangeworm Attack Group", "Hidden Cobra Malware", "Suspicious Command-Line Executions", "DHS Report TA18-074A"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Orangeworm Attack Group", "Suspicious Command-Line Executions", "Hidden Cobra Malware", "DHS Report TA18-074A"] action.correlationsearch.enabled = 1 action.correlationsearch.label = First time seen command line argument action.notable = 1 @@ -3459,55 +3563,28 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Email where All_Email.file_name="*" by All_Email.src_user, All_Email.file_name All_Email.message_id | `ctime(firstTime)` | `ctime(lastTime)` | `drop_dm_object_name("All_Email")` | `suspicious_email_attachments` -[ESCU - Malicious PowerShell Process With Obfuscation Techniques - Rule] +[ESCU - Get Notable History] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-04-25 -action.escu.modification_date = 2018-12-03 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2017-03-15 +action.escu.modification_date = 2017-09-20 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = This search looks for PowerShell processes that are passing command-line arguments with unusual characters (backticks and carets) that are PowerShell specific escape characters. Attackers use this obfuscation technique since it does not affect the functionality of PowerShell and it will bypass standard security controls that look for straight up malicious strings and commands. The search counts the occurrence of these obfuscation characters and lists out destination IPs running these PowerShell commands. -action.escu.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. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Malicious PowerShell Process With Obfuscation Techniques - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} -action.escu.known_false_positives = These characters might be legitimately on the command-line, but it is not common. -action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Malicious PowerShell"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Malicious PowerShell Process With Obfuscation Techniques -action.notable = 1 -action.notable.param.nes_fields = dest, user, process_name, process -action.notable.param.rule_description = The system $dest$ executed a PowerShell process that has evidence of obfuscation on the command-line -action.notable.param.rule_title = PowerShell process with an obfuscation techniques detected on $dest$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 60 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = dest,process_name,process -alert.suppress.period = 14400s -cron_schedule = 0 * * * * -description = This search looks for PowerShell processes launched with arguments that have characters indicative of obfuscation on the command-line. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m +action.escu.eli5 = none +action.escu.how_to_implement = If you are using Enterprise Security you are likely already creating notable events with your correlation rules. No additional configuration is necessary. +action.escu.full_search_name = ESCU - Get Notable History +action.escu.known_false_positives = None at this time +action.escu.search_type = contextual +action.escu.providing_technologies = ["Splunk Enterprise Security"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Monitor Backup Solution", "Ransomware", "Apache Struts Vulnerability", "Netsh Abuse", "Collection and Staging", "Web Fraud Detection", "JBoss Vulnerability", "Suspicious AWS S3 Activities", "Orangeworm Attack Group", "Use of Cleartext Protocols", "Host Redirection", "Dynamic DNS", "Suspicious Windows Registry Activities", "AWS Network ACL Activity", "Credential Dumping", "Monitor for Unauthorized Software", "Suspicious AWS Traffic", "Brand Monitoring", "Splunk Enterprise Vulnerability CVE-2018-11409", "Malicious PowerShell", "Splunk Enterprise Vulnerability", "Lateral Movement", "AWS Cross Account Activity", "Emotet Malware (TA18-201A)", "Suspicious Emails", "SamSam Ransomware", "Spectre And Meltdown Vulnerabilities", "Disabling Security Tools", "Suspicious WMI Use", "Suspicious DNS Traffic", "Unusual Processes", "Router & Infrastructure Security", "Monitor for Updates", "Prohibited Traffic Allowed or Protocol Mismatch", "Windows Privilege Escalation", "Suspicious Command-Line Executions", "SQL Injection", "Windows Service Abuse", "ColdRoot MacOS RAT", "Command and Control", "ColdRoot MacOS RAT", "Windows File Extension and Association Abuse", "Suspicious AWS EC2 Activities", "Unusual AWS EC2 Modifications", "DNS Amplification Attacks", "Account Monitoring and Controls", "Windows Persistence Techniques", "Suspicious AWS Login Activities", "Windows Defense Evasion Tactics", "Hidden Cobra Malware", "Data Protection", "Asset Tracking", "Windows Log Manipulation", "AWS User Monitoring", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] +action.escu.fields_required = ["dest"] +action.escu.earliest_time_offset = 864000 +action.escu.latest_time_offset = 86400 +description = This search queries the notable index and returns all the Notable Events for the particular destination host, giving the analyst an overview of the incidents that may have occurred with the host under investigation. disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=powershell.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)`| eval num_obfuscation = (mvcount(split(process, "`"))-1) + (mvcount(split(process, "^"))-1) | search num_obfuscation > 0 +search = | search `notable` | search dest=$dest$ | table _time, rule_name, owner, priority, severity, status_description [ESCU - Create a list of approved AWS service accounts] action.escu = 0 @@ -3543,7 +3620,7 @@ action.escu.full_search_name = ESCU - Get All AWS Activity From IP Address action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["Command and Control", "Suspicious AWS Traffic", "AWS Suspicious Provisioning Activities", "Suspicious AWS S3 Activities"] +action.escu.analytic_story = ["Suspicious AWS S3 Activities", "Suspicious AWS Traffic", "AWS Suspicious Provisioning Activities", "Command and Control"] action.escu.fields_required = ["src_ip"] action.escu.earliest_time_offset = 14400 action.escu.latest_time_offset = 0 @@ -3663,7 +3740,7 @@ action.escu.full_search_name = ESCU - Get Process responsible for the DNS traffi action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Command and Control", "Data Protection", "Brand Monitoring", "Dynamic DNS", "Host Redirection", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Host Redirection", "Dynamic DNS", "Brand Monitoring", "Suspicious DNS Traffic", "Command and Control", "Data Protection"] action.escu.fields_required = ["dest"] action.escu.earliest_time_offset = 3600 action.escu.latest_time_offset = 86400 @@ -3674,29 +3751,6 @@ schedule_window = auto is_visible = false search = | tstats allow_old_summaries=true values(All_Application_State.process) as "process" from datamodel=Application_State where nodename=All_Application_State.Ports All_Application_State.Ports.dest_port=53 All_Application_State.dest=$dest$ -[ESCU - Systems Ready for Spectre-Meltdown Windows Patch] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-01-08 -action.escu.modification_date = 2018-01-08 -action.escu.channel = ESCU -action.escu.eli5 = This search looks to see if a registry key was created at `HKLM\Software\Microsoft\Windows\CurrentVersion\QualityCompat`. It will tell you when it was created and, if possible, what process created it. -action.escu.how_to_implement = You need to be ingesting logs with both the process name and command-line from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. -action.escu.data_models = ["Change_Analysis"] -action.escu.full_search_name = ESCU - Systems Ready for Spectre-Meltdown Windows Patch -action.escu.known_false_positives = None at this time -action.escu.search_type = support -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Spectre And Meltdown Vulnerabilities"] -description = Some AV applications can cause the Spectre/Meltdown patch for Windows not to install successfully. This registry key is supposed to be created by the AV engine when it has been patched to be able to handle the Windows patch. If this key has been written, the system can then be patched for Spectre and Meltdown. -dispatch.earliest_time = -1d@d -dispatch.latest_time = -10m@m -disabled=true -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Change_Analysis.All_Changes where All_Changes.object_category=registry AND (All_Changes.object_path="HKLM\Software\Microsoft\Windows\CurrentVersion\QualityCompat*") by All_Changes.dest, All_Changes.command, All_Changes.user, All_Changes.object, All_Changes.object_path | `ctime(lastTime)` | `ctime(firstTime)` | `drop_dm_object_name("All_Changes")` - [ESCU - Detect hosts connecting to dynamic domain providers - Rule] action.escu = 0 action.escu.enabled = 1 @@ -3713,7 +3767,7 @@ action.escu.mappings = {"mitre_attack": ["Exfiltration", "Exfiltration Over Comm action.escu.known_false_positives = Some users and applications may leverage Dynamic DNS to reach out to some domains on the Internet since dynamic DNS by itself is not malicious, however this activity must be verified. action.escu.search_type = detection action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Data Protection", "Dynamic DNS", "Prohibited Traffic Allowed or Protocol Mismatch", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Dynamic DNS", "Suspicious DNS Traffic", "Prohibited Traffic Allowed or Protocol Mismatch", "Command and Control", "Data Protection"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Detect hosts connecting to dynamic domain providers action.notable = 1 @@ -3722,7 +3776,7 @@ action.notable.param.rule_description = The search has detected a host making ou action.notable.param.rule_title = Host $src$ detected to make a query to a Dynamic DNS provider action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src @@ -3861,28 +3915,76 @@ schedule_window = auto is_visible = false search = | tstats summariesonly=true allow_old_summaries=true latest(_time) as latestTime from datamodel=Updates where Updates.status=Installed Updates.vendor_product="Microsoft Windows" by Updates.dest Updates.status Updates.vendor_product | rename Updates.dest as Host | rename Updates.status as "Update Status" | rename Updates.vendor_product as Product | eval isOutlier=if(latestTime <= relative_time(now(), "-60d@d"), 1, 0) | `ctime(latestTime)` | search isOutlier=1 | rename latestTime as "Last Update Time", | table Host, "Update Status", Product, "Last Update Time" -[ESCU - Get All AWS Activity From City] +[ESCU - Detect Spike in AWS API Activity - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-03-19 -action.escu.modification_date = 2018-03-19 +action.escu.creation_date = 2018-03-12 +action.escu.modification_date = 2018-04-09 +action.escu.asset_at_risk = AWS Instance action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. -action.escu.full_search_name = ESCU - Get All AWS Activity From City -action.escu.known_false_positives = None at this time -action.escu.search_type = investigative +action.escu.confidence = medium +action.escu.eli5 = This search and its corresponding subsearch run through a series of steps, as per the following: \ +\ +1. Retrieves all the AWS CloudTrail log entries that have recorded AWS API calls.\ +\ +1. Kicks off a subsearch that retrieves the same data and pulls out the ARN into a more friendly format.\ +\ +1. Counts the number of API calls per ARN.\ +\ +1. Loads the cache file that contains the number of data points, the count from the latest hour, the API call average, and the standard deviation for each ARN.\ +\ +1. Drops the count from the latest hour, since it is not necessary, and merges the rest of the data with the results of the stats command. \ +\ +1. Renames `apiCalls` as `latestCount`.\ +\ +1. Calculates the new average value for each ARN with the latest count, weighting the past much more heavily than the current hour. It does the same for the standard deviation--weighting the past more heavily than the current.\ +\ +1. Updates the cache file with the latest results.\ +\ +1. Sets the minimum threshold for the number of data points and sets the number of standard deviations away from the mean it must be to be considered a spike.\ +\ +1. Makes a determination regarding whether or not the current count is a spike by checking to see if the minimum data-point threshold has been met and the count is a sufficient number of standard deviations away from the average.\ +\ +1. Filters out anything that it determines is not a spike and returns the list of ARNs to the main search. The main search subsequently gets the names of all the API calls, the number of unique API calls, and the total number of API calls for each of these ARNs. Finally, it looks up the average and standard deviation and returns both the average and the number of standard deviations the spike is from the average. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. You can modify `dataPointThreshold` and `deviationThreshold` to better fit your environment. The `dataPointThreshold` variable is the minimum number of data points required to have a statistically significant amount of data to determine. The `deviationThreshold` variable is the number of standard deviations away from the mean that the value must be to be considered a spike. +action.escu.full_search_name = ESCU - Detect Spike in AWS API Activity - Rule +action.escu.mappings = {"mitre_attack": ["Credential Access", "Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 16"], "nist": ["DE.DP", "DE.CM", "PR.AC"]} +action.escu.known_false_positives = +action.escu.search_type = detection action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Suspicious Provisioning Activities"] -action.escu.fields_required = ["City"] -action.escu.earliest_time_offset = 14400 -action.escu.latest_time_offset = 0 -description = This search retrieves all the activity from a specific city and will create a table containing the time, city, ARN, username, the type of user, the source IP address, the AWS region the activity was in, the API called, and whether or not the API call was successful. +action.escu.analytic_story = ["AWS User Monitoring"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Detect Spike in AWS API Activity +action.notable = 1 +action.notable.param.nes_fields = user +action.notable.param.rule_description = A spike in the number of AWS API calls by $user$ was detected. +action.notable.param.rule_title = Spike in AWS API activity detected by $user$ +action.notable.param.security_domain = network +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate AWS User Activities by user field\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = user +action.risk.param._risk_object_type = user +action.risk.param._risk_score = 30 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = user +alert.suppress.period = 14400s +cron_schedule = 0 * * * * +description = This search will detect users creating spikes of API activity in your AWS environment. It will also update the cache file that factors in the latest data. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | search sourcetype=aws:cloudtrail | iplocation sourceIPAddress | search City=$City$ | spath output=user path=userIdentity.arn | spath output=awsUserName path=userIdentity.userName | spath output=userType path=userIdentity.type | rename sourceIPAddress as src_ip | table _time, City, user, userName, userType, src_ip, awsRegion, eventName, errorCode +search = sourcetype=aws:cloudtrail eventType=AwsApiCall [search sourcetype=aws:cloudtrail eventType=AwsApiCall | spath output=arn path=userIdentity.arn | stats count as apiCalls by arn | inputlookup api_call_by_user_baseline append=t | fields - latestCount | stats values(*) as * by arn | rename apiCalls as latestCount | eval newAvgApiCalls=avgApiCalls + (latestCount-avgApiCalls)/720 | eval newStdevApiCalls=sqrt(((pow(stdevApiCalls, 2)*719 + (latestCount-newAvgApiCalls)*(latestCount-avgApiCalls))/720)) | eval avgApiCalls=coalesce(newAvgApiCalls, avgApiCalls), stdevApiCalls=coalesce(newStdevApiCalls, stdevApiCalls), numDataPoints=if(isnull(latestCount), numDataPoints, numDataPoints+1) | table arn, latestCount, numDataPoints, avgApiCalls, stdevApiCalls | outputlookup api_call_by_user_baseline | eval dataPointThreshold = 15, deviationThreshold = 3 | eval isSpike=if((latestCount > avgApiCalls+deviationThreshold*stdevApiCalls) AND numDataPoints > dataPointThreshold, 1, 0) | where isSpike=1 | rename arn as userIdentity.arn | table userIdentity.arn] | spath output=user userIdentity.arn | stats values(eventName) as eventNames, count as numberOfApiCalls, dc(eventName) as uniqueApisCalled by user [ESCU - Email files written outside of the Outlook directory - Rule] action.escu = 0 @@ -4081,76 +4183,29 @@ schedule_window = auto is_visible = false search = sourcetype=WinEventLog:Security EventCode=4740 | stats count min(_time) as firstTime max(_time) as lastTime by user, signature | `ctime(firstTime)` | `ctime(lastTime)` | search count > 5 -[ESCU - Detect Spike in AWS API Activity - Rule] +[ESCU - Get Vulnerability Logs For Endpoint] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-03-12 -action.escu.modification_date = 2018-04-09 -action.escu.asset_at_risk = AWS Instance +action.escu.creation_date = 2017-08-24 +action.escu.modification_date = 2017-09-10 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = This search and its corresponding subsearch run through a series of steps, as per the following: \ -\ -1. Retrieves all the AWS CloudTrail log entries that have recorded AWS API calls.\ -\ -1. Kicks off a subsearch that retrieves the same data and pulls out the ARN into a more friendly format.\ -\ -1. Counts the number of API calls per ARN.\ -\ -1. Loads the cache file that contains the number of data points, the count from the latest hour, the API call average, and the standard deviation for each ARN.\ -\ -1. Drops the count from the latest hour, since it is not necessary, and merges the rest of the data with the results of the stats command. \ -\ -1. Renames `apiCalls` as `latestCount`.\ -\ -1. Calculates the new average value for each ARN with the latest count, weighting the past much more heavily than the current hour. It does the same for the standard deviation--weighting the past more heavily than the current.\ -\ -1. Updates the cache file with the latest results.\ -\ -1. Sets the minimum threshold for the number of data points and sets the number of standard deviations away from the mean it must be to be considered a spike.\ -\ -1. Makes a determination regarding whether or not the current count is a spike by checking to see if the minimum data-point threshold has been met and the count is a sufficient number of standard deviations away from the average.\ -\ -1. Filters out anything that it determines is not a spike and returns the list of ARNs to the main search. The main search subsequently gets the names of all the API calls, the number of unique API calls, and the total number of API calls for each of these ARNs. Finally, it looks up the average and standard deviation and returns both the average and the number of standard deviations the spike is from the average. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. You can modify `dataPointThreshold` and `deviationThreshold` to better fit your environment. The `dataPointThreshold` variable is the minimum number of data points required to have a statistically significant amount of data to determine. The `deviationThreshold` variable is the number of standard deviations away from the mean that the value must be to be considered a spike. -action.escu.full_search_name = ESCU - Detect Spike in AWS API Activity - Rule -action.escu.mappings = {"mitre_attack": ["Credential Access", "Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 16"], "nist": ["DE.DP", "DE.CM", "PR.AC"]} -action.escu.known_false_positives = -action.escu.search_type = detection -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS User Monitoring"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect Spike in AWS API Activity -action.notable = 1 -action.notable.param.nes_fields = user -action.notable.param.rule_description = A spike in the number of AWS API calls by $user$ was detected. -action.notable.param.rule_title = Spike in AWS API activity detected by $user$ -action.notable.param.security_domain = network -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate AWS User Activities by user field\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = user -action.risk.param._risk_object_type = user -action.risk.param._risk_score = 30 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = user -alert.suppress.period = 14400s -cron_schedule = 0 * * * * -description = This search will detect users creating spikes of API activity in your AWS environment. It will also update the cache file that factors in the latest data. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m +action.escu.eli5 = none +action.escu.how_to_implement = You need to be ingesting the logs from your vulnerability scanner. +action.escu.data_models = ["Vulnerabilities"] +action.escu.full_search_name = ESCU - Get Vulnerability Logs For Endpoint +action.escu.known_false_positives = None at this time +action.escu.search_type = contextual +action.escu.providing_technologies = ["Nessus"] +action.escu.analytic_story = ["Ransomware", "SamSam Ransomware", "ColdRoot MacOS RAT", "ColdRoot MacOS RAT"] +action.escu.fields_required = ["dest"] +action.escu.earliest_time_offset = 604800 +action.escu.latest_time_offset = 0 +description = This search will show you any vulnerabilities noted for a specific endpoint for the last week. disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail eventType=AwsApiCall [search sourcetype=aws:cloudtrail eventType=AwsApiCall | spath output=arn path=userIdentity.arn | stats count as apiCalls by arn | inputlookup api_call_by_user_baseline append=t | fields - latestCount | stats values(*) as * by arn | rename apiCalls as latestCount | eval newAvgApiCalls=avgApiCalls + (latestCount-avgApiCalls)/720 | eval newStdevApiCalls=sqrt(((pow(stdevApiCalls, 2)*719 + (latestCount-newAvgApiCalls)*(latestCount-avgApiCalls))/720)) | eval avgApiCalls=coalesce(newAvgApiCalls, avgApiCalls), stdevApiCalls=coalesce(newStdevApiCalls, stdevApiCalls), numDataPoints=if(isnull(latestCount), numDataPoints, numDataPoints+1) | table arn, latestCount, numDataPoints, avgApiCalls, stdevApiCalls | outputlookup api_call_by_user_baseline | eval dataPointThreshold = 15, deviationThreshold = 3 | eval isSpike=if((latestCount > avgApiCalls+deviationThreshold*stdevApiCalls) AND numDataPoints > dataPointThreshold, 1, 0) | where isSpike=1 | rename arn as userIdentity.arn | table userIdentity.arn] | spath output=user userIdentity.arn | stats values(eventName) as eventNames, count as numberOfApiCalls, dc(eventName) as uniqueApisCalled by user +search = | from datamodel Vulnerabilities.Vulnerabilities | search dest=$dest$ [ESCU - RunDLL Loading DLL By Ordinal - Rule] action.escu = 0 @@ -4251,56 +4306,6 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` sum(All_Traffic.bytes_out) as bytes_out from datamodel=Network_Traffic where All_Traffic.src_category=email_server by All_Traffic.dest_ip _time span=1d | `drop_dm_object_name("All_Traffic")` | eventstats avg(bytes_out) as avg_bytes_out stdev(bytes_out) as stdev_bytes_out | eventstats count as num_data_samples avg(eval(if(_time < relative_time(now(), "@d"), bytes_out, null))) as per_source_avg_bytes_out stdev(eval(if(_time < relative_time(now(), "@d"), bytes_out, null))) as per_source_stdev_bytes_out by dest_ip | eval minimum_data_samples = 4, deviation_threshold = 3 | where num_data_samples >= minimum_data_samples AND bytes_out > (avg_bytes_out + (deviation_threshold * stdev_bytes_out)) AND bytes_out > (per_source_avg_bytes_out + (deviation_threshold * per_source_stdev_bytes_out)) AND _time >= relative_time(now(), "@d") | eval num_standard_deviations_away_from_server_average = round(abs(bytes_out - avg_bytes_out) / stdev_bytes_out, 2), num_standard_deviations_away_from_client_average = round(abs(bytes_out - per_source_avg_bytes_out) / per_source_stdev_bytes_out, 2) | table dest_ip, _time, bytes_out, avg_bytes_out, per_source_avg_bytes_out, num_standard_deviations_away_from_server_average, num_standard_deviations_away_from_client_average -[ESCU - Large Volume of DNS ANY Queries - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2016-08-24 -action.escu.modification_date = 2017-09-20 -action.escu.asset_at_risk = DNS Servers -action.escu.channel = ESCU -action.escu.confidence = high -action.escu.eli5 = This search counts the number of DNS ANY queries received in 5 minutes, and generates a Notable Event if the count exceeds a predefined threshold. The search returns the count, the first time, and the last time a DNS packet was observed with the ANY flag set. -action.escu.how_to_implement = To successfully implement this search you must ensure that DNS data is populating the Network_Resolution data model. -action.escu.data_models = ["Network_Resolution"] -action.escu.full_search_name = ESCU - Large Volume of DNS ANY Queries - Rule -action.escu.mappings = {"kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 11", "CIS 12"], "nist": ["PR.PT", "DE.AE", "PR.IP"]} -action.escu.known_false_positives = Legitimate ANY requests may trigger this search, however it is unusual to see a large volume of them under typical circumstances. You may modify the threshold in the search to better suit your environment. -action.escu.search_type = detection -action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["DNS Amplification Attacks"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Large Volume of DNS ANY Queries -action.notable = 1 -action.notable.param.nes_fields = dest -action.notable.param.rule_description = The search is used to identify attempts to use your DNS Infrastructure for DDoS purposes via a DNS amplification attack leveraging ANY queries. -action.notable.param.rule_title = Large Volume of DNS ANY Queries -action.notable.param.security_domain = network -action.notable.param.severity = high -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 60 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = dest -alert.suppress.period = 7200s -cron_schedule = */5 * * * * -description = The search is used to identify attempts to use your DNS Infrastructure for DDoS purposes via a DNS amplification attack leveraging ANY queries. -dispatch.earliest_time = -15m@m -dispatch.latest_time = -10m@m -disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | tstats `summariesonly` count from datamodel=Network_Resolution where nodename=DNS "DNS.message_type"="QUERY" "DNS.record_type"="ANY" by "DNS.dest" | `drop_dm_object_name("DNS")` | where count>200 - [ESCU - Detect Spike in blocked Outbound Traffic from your AWS - Rule] action.escu = 0 action.escu.enabled = 1 @@ -4334,7 +4339,7 @@ action.escu.mappings = {"mitre_attack": ["Exfiltration", "Command and Control"], action.escu.known_false_positives = The false-positive rate may vary based on the values of`dataPointThreshold` and `deviationThreshold`. Additionally, false positives may result when AWS administrators roll out policies enforcing network blocks, causing sudden increases in the number of blocked outbound connections. action.escu.search_type = detection action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Network ACL Activity", "Command and Control", "Suspicious AWS Traffic"] +action.escu.analytic_story = ["AWS Network ACL Activity", "Suspicious AWS Traffic", "Command and Control"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Detect Spike in blocked Outbound Traffic from your AWS action.notable = 1 @@ -4343,7 +4348,7 @@ action.notable.param.rule_description = A spike in the blocked outbound connecti action.notable.param.rule_title = Spike in blocked outbound network connections from $src_ip$ detected. action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src_ip @@ -4418,55 +4423,6 @@ schedule_window = auto is_visible = false search = | from datamodel Identity_Management.All_Identities | eval empStatus=case((now()-startDate)<604800, "Accounts created in last week") | search empStatus="Accounts created in last week"| `ctime(endDate)` | `ctime(startDate)`| table identity empStatus endDate startDate -[ESCU - Detect S3 access from a new IP - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-06-25 -action.escu.modification_date = 2018-06-28 -action.escu.asset_at_risk = S3 Bucket -action.escu.channel = ESCU -action.escu.confidence = low -action.escu.eli5 = Here the subsearch executes first and returns all successful S3 bucket-access attempts (HTTP code "200") within the last hour. It groups the results by the earliest and latest times it has seen a remote IP accessing a particular bucket. It appends this information to the historical data from the lookup file and then recalculates the `firstTime` and `lastTime` field for each remote IP accessing an S3 bucket. Next, it returns only those remote IP addresses that have first been seen accessing a specific bucket within the past hour. This is combined with the main search to return the time, bucket name, source IP, city, and country operations performed, as well as the requested URI of the resource -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your S3 access logs' inputs. This search works best when you run the "Previously Seen S3 Bucket Access by Remote IP" support search once to create a history of previously seen remote IPs and bucket names. -action.escu.full_search_name = ESCU - Detect S3 access from a new IP - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13", "CIS 14"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} -action.escu.known_false_positives = S3 buckets can be accessed from any IP, as long as it can make a successful connection. This will be a false postive, since the search is looking for a new IP within the past hour -action.escu.search_type = detection -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["Suspicious AWS S3 Activities"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect S3 access from a new IP -action.notable = 1 -action.notable.param.nes_fields = bucket_name, src_ip -action.notable.param.rule_description = A remote IP, $src_ip$, has made a successful connection with an S3 $bucket_name$. -action.notable.param.rule_title = S3 bucket $bucketName$ was accessed by a new $src_ip$ -action.notable.param.security_domain = network -action.notable.param.severity = low -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS S3 Bucket details via bucketName\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Investigate AWS activities via region name\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = src_ip -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 20 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = bucket_name, src_ip -alert.suppress.period = 86400s -cron_schedule = 5 * * * * -description = This search looks at S3 bucket-access logs and detects new or previously unseen remote IP addresses that have successfully accessed an S3 bucket. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m -disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = sourcetype=aws:s3:accesslogs http_status=200 [search sourcetype=aws:s3:accesslogs http_status=200 | stats earliest(_time) as firstTime latest(_time) as lastTime by bucket_name remote_ip | inputlookup append=t previously_seen_S3_access_from_remote_ip.csv | stats min(firstTime) as firstTime, max(lastTime) as lastTime by bucket_name remote_ip | outputlookup previously_seen_S3_access_from_remote_ip.csv | eval newIP=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newIP=1 | convert ctime(firstTime) ctime(lastTime) | table bucket_name remote_ip]| iplocation remote_ip |rename remote_ip as src_ip | table _time bucket_name src_ip City Country operation request_uri - [ESCU - Detect Large Outbound ICMP Packets - Rule] action.escu = 0 action.escu.enabled = 1 @@ -4540,66 +4496,93 @@ schedule_window = auto is_visible = false search = | search sourcetype=WinEventLog:Security (EventCode=4718 OR EventCode=4717) user=$user$ | rename user as "Account Modified" | table _time, dest, "Account Modified", Access_Right, signature -[ESCU - Identify Systems Using Remote Desktop] +[ESCU - Abnormally High AWS Instances Terminated by User - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-04-18 -action.escu.modification_date = 2017-09-15 +action.escu.creation_date = 2018-02-26 +action.escu.modification_date = 2018-02-26 +action.escu.asset_at_risk = AWS Instance action.escu.channel = ESCU -action.escu.eli5 = This search counts the numbers of times the remote desktop process, mstsc.exe, has run on each system. It does this by looking for the process in the Application_State data model. -action.escu.how_to_implement = To successfully implement this search you must be ingesting endpoint data that records process activity. -action.escu.data_models = ["Application_State"] -action.escu.full_search_name = ESCU - Identify Systems Using Remote Desktop -action.escu.known_false_positives = None at this time -action.escu.search_type = support -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Lateral Movement"] -description = This search counts the numbers of times the remote desktop process, mstsc.exe, has run on each system. +action.escu.confidence = medium +action.escu.eli5 = In this search, we query CloudTrail logs to look for events where an instance is successfully terminated by a particular user. Since we want to detect a high number of instances terminated within a short period, we create event buckets for 10-minute windows. We then calculate the total number of instances terminated by a particular user, as well as the average- and standard-deviation values. Assign a `threshold_value` in the search. Try starting with 3 (but it will likely need to be tweaked for your environment). The `eval` function will set the outlier to 1 if the number of instances is greater than the average number of instances terminated, added to the multiplied value of threshold and standard deviation. We then filter out outliers with a value of 1 and show only those instance-termination events that happened within the previous 10 minutes. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. +action.escu.full_search_name = ESCU - Abnormally High AWS Instances Terminated by User - Rule +action.escu.mappings = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["DE.DP", "DE.AE"]} +action.escu.known_false_positives = Many service accounts configured with your AWS infrastructure are known to exhibit this behavior. Please adjust the threshold values and filter out service accounts from the output. Always verify whether this search alerted on a human user. +action.escu.search_type = detection +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["Suspicious AWS EC2 Activities"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Abnormally High AWS Instances Terminated by User +action.notable = 1 +action.notable.param.nes_fields = userName +action.notable.param.rule_description = An abnormally high number of instances were terminated by a user in a 10-minute window +action.notable.param.rule_title = High number of instances terminated by $userName$ +action.notable.param.security_domain = network +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get EC2 Instance Details by instanceId\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n - ESCU - Investigate AWS activities via region name\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = userName +action.risk.param._risk_object_type = user +action.risk.param._risk_score = 30 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = userName +alert.suppress.period = 3600s +cron_schedule = */10 * * * * +description = This search looks for CloudTrail events where an abnormally high number of instances were successfully terminated by a user in a 10-minute window dispatch.earliest_time = -30d@d dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count from datamodel=Application_State where All_Application_State.process="*mstsc.exe*" by All_Application_State.dest All_Application_State.process | `drop_dm_object_name("All_Application_State")` | sort - count +search = sourcetype=aws:cloudtrail eventName=TerminateInstances errorCode=success | bucket span=10m _time | stats count AS instances_terminated by _time userName | eventstats avg(instances_terminated) as total_terminations_avg, stdev(instances_terminated) as total_terminations_stdev | eval threshold_value = 4 | eval isOutlier=if(instances_terminated > total_terminations_avg+(total_terminations_stdev * threshold_value), 1, 0) | search isOutlier=1 AND _time >= relative_time(now(), "-10m@m")| eval num_standard_deviations_away = round(abs(instances_terminated - total_terminations_avg) / total_terminations_stdev, 2) |table _time, userName, instances_terminated, num_standard_deviations_away, total_terminations_avg, total_terminations_stdev -[ESCU - WMI Permanent Event Subscription - Rule] +[ESCU - Scheduled Task Name Used by Dragonfly Threat Actors - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-10-23 -action.escu.modification_date = 2018-10-23 +action.escu.creation_date = 2018-03-19 +action.escu.modification_date = 2018-12-03 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = Attackers are increasingly abusing Windows Management Infrastructure (WMI) for stealth, persistence, lateral movement, or just to leverage its functionality. This search looks for the creation of a WMI event subscription by watching for Windows event ID 5861. -action.escu.how_to_implement = To successfully implement this search, you must be ingesting the Windows WMI activity logs. This can be done by adding a stanza to inputs.conf on the system generating logs with a title of [WinEventLog://Microsoft-Windows-WMI-Activity/Operational]. -action.escu.full_search_name = ESCU - WMI Permanent Event Subscription - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Windows Management Instrumentation", "Persistence", "Windows Management Instrumentation Event Subscription"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} -action.escu.known_false_positives = Although unlikely, administrators may use event subscriptions for legitimate purposes. +action.escu.eli5 = The search looks for execution of schtasks.exe with parameters that indicate that a specific task "reset," whose name is associated with the Dragonfly threat actor--has been created or deleted. Schtasks.exe is a native Windows program that is used to schedule tasks on local or remote systems. Attackers often leverage this capability to schedule the execution of commands or establish persistence. +action.escu.how_to_implement = You must be ingesting endpoint data that tracks process activity, including parent-child relationships from your endpoints to populate the Endpoint data model in the Processes node. The command-line arguments are mapped to the "process" field in the Endpoint data model. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Scheduled Task Name Used by Dragonfly Threat Actors - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Scheduled Task"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3"], "nist": ["PR.IP"]} +action.escu.known_false_positives = No known false positives action.escu.search_type = detection -action.escu.providing_technologies = ["Microsoft Windows"] -action.escu.analytic_story = ["Suspicious WMI Use"] +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["DHS Report TA18-074A"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = WMI Permanent Event Subscription +action.correlationsearch.label = Scheduled Task Name Used by Dragonfly Threat Actors action.notable = 1 -action.notable.param.nes_fields = dest -action.notable.param.rule_description = This search looks for the creation of a permanent WMI event subscription via Windows event logs. -action.notable.param.rule_title = WMI Event Subscription Detected on $dest$ +action.notable.param.nes_fields = dest, user, process_name +action.notable.param.rule_description = This search looks for flags passed to schtasks.exe on the command line that indicate that a task--whose name is associated with the Dragonfly threat actor--has been created or deleted +action.notable.param.rule_title = Scheduled task used by Dragonfly threat actor detected on $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n - ESCU - Get Sysmon WMI Activity for Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest action.risk.param._risk_object_type = system -action.risk.param._risk_score = 70 +action.risk.param._risk_score = 80 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest +alert.suppress.fields = dest, process_name, process alert.suppress.period = 28800s cron_schedule = 0 * * * * -description = This search looks for the creation of WMI permanent event subscriptions. +description = This search looks for flags passed to schtasks.exe on the command-line that indicate a task name associated with the Dragonfly threat actor was created or deleted. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -4610,7 +4593,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype="wineventlog:microsoft-windows-wmi-activity/operational" EventCode=5861 Binding | rex field=Message "Consumer =\s+(?[^;|^$]+)" | search consumer!="NTEventLogEventConsumer=\"SCM Event Log Consumer\"" | stats count min(_time) as firstTime max(_time) as lastTime by ComputerName, consumer, Message | `ctime(firstTime)`| `ctime(lastTime)` | rename ComputerName as dest +search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=schtasks.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` | search (process=*delete* OR process=*create*) process=*reset* [ESCU - Investigate Web Activity From src_ip] action.escu = 0 @@ -4625,7 +4608,7 @@ action.escu.full_search_name = ESCU - Investigate Web Activity From src_ip action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] -action.escu.analytic_story = ["ColdRoot MacOS RAT", "ColdRoot MacOS RAT", "Dynamic DNS", "Splunk Enterprise Vulnerability CVE-2018-11409"] +action.escu.analytic_story = ["Dynamic DNS", "Splunk Enterprise Vulnerability CVE-2018-11409", "ColdRoot MacOS RAT", "ColdRoot MacOS RAT"] action.escu.fields_required = ["src_ip"] action.escu.earliest_time_offset = 3600 action.escu.latest_time_offset = 3600 @@ -4649,7 +4632,7 @@ action.escu.full_search_name = ESCU - Get Risk Modifiers For User action.escu.known_false_positives = None at this time action.escu.search_type = contextual action.escu.providing_technologies = ["Splunk Enterprise Security"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "JBoss Vulnerability", "Orangeworm Attack Group", "Monitor for Unauthorized Software", "ColdRoot MacOS RAT", "Command and Control", "Router & Infrastructure Security", "Emotet Malware (TA18-201A)", "Credential Dumping", "Data Protection", "ColdRoot MacOS RAT", "Brand Monitoring", "Disabling Security Tools", "Spectre And Meltdown Vulnerabilities", "Suspicious Windows Registry Activities", "Windows Privilege Escalation", "Windows Persistence Techniques", "Asset Tracking", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Use of Cleartext Protocols", "Account Monitoring and Controls", "DNS Amplification Attacks", "Unusual Processes", "SQL Injection", "Dynamic DNS", "Collection and Staging", "Prohibited Traffic Allowed or Protocol Mismatch", "Splunk Enterprise Vulnerability", "Ransomware", "Windows Service Abuse", "Netsh Abuse", "Monitor Backup Solution", "SamSam Ransomware", "Host Redirection", "DHS Report TA18-074A", "Suspicious MSHTA Activity", "Malicious PowerShell", "Lateral Movement", "Windows Log Manipulation", "Monitor for Updates", "Suspicious DNS Traffic", "Apache Struts Vulnerability", "Suspicious WMI Use", "Suspicious Emails"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Monitor Backup Solution", "Ransomware", "Apache Struts Vulnerability", "Netsh Abuse", "Collection and Staging", "JBoss Vulnerability", "Orangeworm Attack Group", "Use of Cleartext Protocols", "Host Redirection", "Dynamic DNS", "Suspicious Windows Registry Activities", "Credential Dumping", "Monitor for Unauthorized Software", "Brand Monitoring", "Malicious PowerShell", "Splunk Enterprise Vulnerability", "Lateral Movement", "Emotet Malware (TA18-201A)", "Suspicious Emails", "SamSam Ransomware", "Spectre And Meltdown Vulnerabilities", "Disabling Security Tools", "Suspicious WMI Use", "Suspicious DNS Traffic", "Unusual Processes", "Router & Infrastructure Security", "Monitor for Updates", "Prohibited Traffic Allowed or Protocol Mismatch", "Windows Privilege Escalation", "SQL Injection", "Windows Service Abuse", "ColdRoot MacOS RAT", "Command and Control", "ColdRoot MacOS RAT", "Windows File Extension and Association Abuse", "DNS Amplification Attacks", "Account Monitoring and Controls", "Windows Persistence Techniques", "Hidden Cobra Malware", "Data Protection", "Asset Tracking", "Windows Log Manipulation", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] action.escu.fields_required = ["user"] action.escu.earliest_time_offset = 604800 action.escu.latest_time_offset = 0 @@ -4673,7 +4656,7 @@ action.escu.full_search_name = ESCU - Get Process Info action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Orangeworm Attack Group", "Monitor for Unauthorized Software", "Command and Control", "Emotet Malware (TA18-201A)", "Credential Dumping", "Disabling Security Tools", "Suspicious Windows Registry Activities", "Windows Privilege Escalation", "Windows Persistence Techniques", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Unusual Processes", "Collection and Staging", "Suspicious Command-Line Executions", "Ransomware", "Windows Service Abuse", "Netsh Abuse", "Windows Defense Evasion Tactics", "SamSam Ransomware", "DHS Report TA18-074A", "Suspicious MSHTA Activity", "Malicious PowerShell", "Lateral Movement", "Windows Log Manipulation", "Suspicious WMI Use"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Ransomware", "Netsh Abuse", "Collection and Staging", "Orangeworm Attack Group", "Suspicious Windows Registry Activities", "Credential Dumping", "Monitor for Unauthorized Software", "Malicious PowerShell", "Lateral Movement", "Emotet Malware (TA18-201A)", "SamSam Ransomware", "Disabling Security Tools", "Suspicious WMI Use", "Unusual Processes", "Windows Privilege Escalation", "Suspicious Command-Line Executions", "Windows Service Abuse", "Command and Control", "Windows File Extension and Association Abuse", "Windows Persistence Techniques", "Windows Defense Evasion Tactics", "Hidden Cobra Malware", "Windows Log Manipulation", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] action.escu.fields_required = ["process", "dest"] action.escu.earliest_time_offset = 7200 action.escu.latest_time_offset = 7200 @@ -4706,43 +4689,43 @@ schedule_window = auto is_visible = false search = sourcetype=aws:cloudtrail eventType=AwsApiCall errorCode=success userIdentity.type=AssumedRole | stats earliest(_time) as earliest latest(_time) as latest by userName eventName | outputlookup previously_seen_api_calls_from_user_roles | stats count -[ESCU - Detect New Open S3 buckets - Rule] +[ESCU - Detect new API calls from user roles - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-07-25 -action.escu.modification_date = 2018-07-25 -action.escu.asset_at_risk = S3 Bucket +action.escu.creation_date = 2018-04-01 +action.escu.modification_date = 2018-04-16 +action.escu.asset_at_risk = AWS Instance action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = This search queries CloudTrail logs for events with S3 bucket access controls given to the "All Users" group, which allows anyone in the world access to the resource. This search generates a table displaying the time when the bucket was made public, the permission of the S3 bucket, the bucket name, and the ARN of the user who created the bucket. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), and then configure your CloudTrail inputs. The threshold value should be tuned to your environment. -action.escu.full_search_name = ESCU - Detect New Open S3 buckets - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Initial Access", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} -action.escu.known_false_positives = While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group. +action.escu.eli5 = The subsearch will execute first and return the user roles and names of the API calls completed within the last hour, where the type of user identity is `AssumedRole`. It then appends the historical data to those results in the lookup file. Next, it recalculates the `earliest` and `latest` fields for each user role, as well as the name of the API call, and returns only those roles and API calls that have first been seen in the past hour. This is combined with the main search to return the values of API calls, name of the user role, and the earliest and latest time of this activity. It is worth noting that the name of the role of a particular user is parsed as "userName" in the CloudTrail logs. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously seen API call per user roles in CloudTrail" support search once to create a history of previously seen user roles. +action.escu.full_search_name = ESCU - Detect new API calls from user roles - Rule +action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +action.escu.known_false_positives = It is possible that there are legitimate user roles making new or infrequently used API calls in your infrastructure, causing the search to trigger. action.escu.search_type = detection action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["Suspicious AWS S3 Activities"] +action.escu.analytic_story = ["AWS User Monitoring"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect New Open S3 buckets +action.correlationsearch.label = Detect new API calls from user roles action.notable = 1 action.notable.param.nes_fields = user -action.notable.param.rule_description = An open/public S3 bucket, $bucketName$, was created by $user$. -action.notable.param.rule_title = Public S3 bucket $bucketName$ created by $user$ -action.notable.param.security_domain = network +action.notable.param.rule_description = A new API call made by $user$ has been detected. This API activity has either never been seen before or has not been seen within the last hour. +action.notable.param.rule_title = New API call by $user$ detected +action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS S3 Bucket details via bucketName\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Investigate AWS activities via region name\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate AWS User Activities by user field\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = user action.risk.param._risk_object_type = user -action.risk.param._risk_score = 70 +action.risk.param._risk_score = 10 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = user,bucketName +alert.suppress.fields = user alert.suppress.period = 86400s -cron_schedule = 5 * * * * -description = This search looks for CloudTrail events where a user has created an open/public S3 bucket. +cron_schedule = 30 * * * * +description = This search detects new API calls that have either never been seen before or that have not been seen in the previous hour, where the identity type is `AssumedRole`. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -4753,7 +4736,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail AllUsers eventName=PutBucketAcl | spath output=userIdentityArn path=userIdentity.arn | spath output=bucketName path=requestParameters.bucketName | spath output=aclControlList path=requestParameters.AccessControlPolicy.AccessControlList | spath input=aclControlList output=grantee path=Grant{} | mvexpand grantee | spath input=grantee | search Grantee.URI=*AllUsers | rename userIdentityArn as user| table _time, src,awsRegion Permission, Grantee.URI, bucketName, user +search = sourcetype=aws:cloudtrail eventType=AwsApiCall errorCode=success userIdentity.type=AssumedRole [search sourcetype=aws:cloudtrail eventType=AwsApiCall errorCode=success userIdentity.type=AssumedRole | stats earliest(_time) as earliest latest(_time) as latest by userName eventName | inputlookup append=t previously_seen_api_calls_from_user_roles | stats min(earliest) as earliest, max(latest) as latest by userName eventName | outputlookup previously_seen_api_calls_from_user_roles| eval newApiCallfromUserRole=if(earliest>=relative_time(now(), "-70m@m"), 1, 0) | where newApiCallfromUserRole=1 | `ctime(earliest)` | `ctime(latest)` | table eventName userName] |rename userName as user| stats values(eventName) earliest(_time) as earliest latest(_time) as latest by user | `ctime(earliest)` | `ctime(latest)` [ESCU - Hiding Files And Directories With Attrib.exe - Rule] action.escu = 0 @@ -4854,95 +4837,67 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count from datamodel=Web where Web.dest_category=web_server AND (Web.url_length > 1024 OR Web.http_user_agent_length > 200) by Web.src Web.dest Web.url Web.url_length Web.http_user_agent | `drop_dm_object_name("Web")` | eval num_sql_cmds=mvcount(split(url, "alter%20table")) + mvcount(split(url, "between")) + mvcount(split(url, "create%20table")) + mvcount(split(url, "create%20database")) + mvcount(split(url, "create%20index")) + mvcount(split(url, "create%20view")) + mvcount(split(url, "delete")) + mvcount(split(url, "drop%20database")) + mvcount(split(url, "drop%20index")) + mvcount(split(url, "drop%20table")) + mvcount(split(url, "exists")) + mvcount(split(url, "exec")) + mvcount(split(url, "group%20by")) + mvcount(split(url, "having")) + mvcount(split(url, "insert%20into")) + mvcount(split(url, "inner%20join")) + mvcount(split(url, "left%20join")) + mvcount(split(url, "right%20join")) + mvcount(split(url, "full%20join")) + mvcount(split(url, "select")) + mvcount(split(url, "distinct")) + mvcount(split(url, "select%20top")) + mvcount(split(url, "union")) + mvcount(split(url, "xp_cmdshell")) - 24 | where num_sql_cmds > 3 -[ESCU - AWS Cloud Provisioning From Previously Unseen IP Address - Rule] +[ESCU - Get Web Session Information via session_id] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-03-16 -action.escu.modification_date = 2018-03-16 -action.escu.asset_at_risk = AWS Instance +action.escu.creation_date = 2018-10-08 +action.escu.modification_date = 2018-10-08 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = The subsearch returns all events with event names that start with "Run" or "Create," and then does a `GeoIP` lookup on the IP address that initiated the action within the last hour. It appends the historical data to those results in the lookup file. Next, it recalculates the `firstTime` and `lastTime` field for each country, region, city, and IP address and outputs this data to the lookup file to update the local cache. It then calculates the `firstTime` and `lastTime` for each city. It returns only those events from IP addresses that have first been seen in the past hour. This is combined with the main search to return the time, user, IP address, city, event name, and error code from the action. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen AWS Provisioning Activity Sources" support search once to create a history of previously seen locations that have provisioned AWS resources. -action.escu.full_search_name = ESCU - AWS Cloud Provisioning From Previously Unseen IP Address - Rule -action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -action.escu.known_false_positives = This is a strictly behavioral search, so we define "false positive" slightly differently. Every time this fires, it will accurately reflect the first occurrence in the time period you're searching within, plus what is stored in the cache feature. But while there are really no "false positives" in a traditional sense, there is definitely lots of noise.\ -\ - This search will fire any time a new IP address is seen in the **GeoIP** database for any kind of provisioning activity. If you typically do all provisioning from tools inside of your country, there should be few false positives. If you are located in countries where the free version of **MaxMind GeoIP** that ships by default with Splunk has weak resolution (particularly small countries in less economically powerful regions), this may be much less valuable to you. -action.escu.search_type = detection -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Suspicious Provisioning Activities"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = AWS Cloud Provisioning From Previously Unseen IP Address -action.notable = 1 -action.notable.param.nes_fields = src_ip -action.notable.param.rule_description = Your AWS infrastructure was provisioned from an IP, $src_ip$, which has never before been seen provisioning your infrastructure. -action.notable.param.rule_title = AWS Provision Activity From $src_ip$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From City\n - ESCU - Get All AWS Activity From Country\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get All AWS Activity From Region\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = src_ip -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 30 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = src_ip -alert.suppress.period = 14400s -cron_schedule = 0 * * * * -description = This search looks for AWS provisioning activities from previously unseen IP addresses. Provisioning activities are defined broadly as any event that begins with "Run" or "Create." -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m +action.escu.eli5 = none +action.escu.how_to_implement = This search leverages data extracted from Stream:HTTP. You must configure the HTTP stream using the Splunk Stream App on your Splunk Stream deployment server. +action.escu.full_search_name = ESCU - Get Web Session Information via session_id +action.escu.known_false_positives = None at this time +action.escu.search_type = investigative +action.escu.providing_technologies = ["Splunk Stream"] +action.escu.analytic_story = ["Web Fraud Detection"] +action.escu.fields_required = ["session_id"] +action.escu.earliest_time_offset = 3600 +action.escu.latest_time_offset = 3600 +description = This search helps an analyst investigate a notable event to find out more about a specific web session. The search looks for a specific web session ID in the HTTP web traffic and outputs the URL and user agents, grouped by source IP address and HTTP status code. disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail (eventName=Run* OR eventName=Create*) | iplocation sourceIPAddress | search Country=* [search sourcetype=aws:cloudtrail (eventName=Run* OR eventName=Create*) | iplocation sourceIPAddress | search Country=* | stats earliest(_time) as firstTime, latest(_time) as lastTime by sourceIPAddress, City, Region, Country | inputlookup append=t previously_seen_provisioning_activity_src.csv | stats min(firstTime) as firstTime max(lastTime) as lastTime by sourceIPAddress, City, Region, Country | outputlookup previously_seen_provisioning_activity_src.csv | stats min(firstTime) as firstTime max(lastTime) as lastTime by sourceIPAddress | eval newIP=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newIP=1 | table sourceIPAddress] | spath output=user userIdentity.arn | rename sourceIPAddress as src_ip | table _time, user, src_ip, eventName, errorCode +search = | search sourcetype=stream:http $session_id$ | stats values(url) values(http_user_agent) by src_ip status -[ESCU - Remote Desktop Network Traffic - Rule] +[ESCU - Execution of File With Spaces Before Extension - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2016-09-13 -action.escu.modification_date = 2017-09-15 +action.escu.creation_date = 2018-01-26 +action.escu.modification_date = 2018-01-26 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = This search finds systems that do not commonly communicate use remote desktop. It does this by filtering out all systems that have the "common_rdp_source" or "common_rdp_destination" category applied to that system. Categories are applied to systems using the Assets and Identity framework. -action.escu.how_to_implement = To successfully implement this search you need to identify systems that commonly originate remote desktop traffic and that commonly receive remote desktop traffic. You can use the included support search "Identify Systems Creating Remote Desktop Traffic" to identify systems that originate the traffic and the search "Identify Systems Receiving Remote Desktop Traffic" to identify systems that receive a lot of remote desktop traffic. After identifying these systems, you will need to add the "common_rdp_source" or "common_rdp_destination" category to that system depending on the usage, using the Enterprise Security Assets and Identities framework. This can be done by adding an entry in the assets.csv file located in SA-IdentityManagement/lookups. -action.escu.data_models = ["Network_Traffic"] -action.escu.full_search_name = ESCU - Remote Desktop Network Traffic - Rule -action.escu.mappings = {"mitre_attack": ["Lateral Movement", "Remote Desktop Protocol", "Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 9", "CIS 16"], "nist": ["DE.AE", "PR.AC", "PR.IP"]} -action.escu.known_false_positives = Remote Desktop may be used legitimately by users on the network. +action.escu.eli5 = This search uses the endpoint data model to look for process names with at least five spaces between the file name and its extension. +action.escu.how_to_implement = To successfully implement this search, you must be ingesting data that records process activity from your hosts to populate the endpoint data model in the processes node. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Execution of File With Spaces Before Extension - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Persistence", "Change Default File Association"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 8"], "nist": ["DE.CM", "PR.PT", "PR.IP"]} +action.escu.known_false_positives = None identified. action.escu.search_type = detection -action.escu.providing_technologies = ["Bro", "Splunk Stream"] -action.escu.analytic_story = ["Hidden Cobra Malware", "SamSam Ransomware", "Lateral Movement"] +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Windows File Extension and Association Abuse"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Remote Desktop Network Traffic +action.correlationsearch.label = Execution of File With Spaces Before Extension action.notable = 1 -action.notable.param.nes_fields = dest, src -action.notable.param.rule_description = Remote Desktop Traffic detected between $src$ and $dest$. These two systems typically do not communicate with RDP -action.notable.param.rule_title = Uncommon Remote Desktop Network Traffic between $src$ and $dest$ -action.notable.param.security_domain = network +action.notable.param.nes_fields = dest +action.notable.param.rule_description = The system $dest$ executed a file with spaces before its extension. +action.notable.param.rule_title = Process $process$ with spaces before extension Launched on $dest$ +action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = src +action.risk.param._risk_object = dest action.risk.param._risk_object_type = system -action.risk.param._risk_score = 50 +action.risk.param._risk_score = 60 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest,src +alert.suppress.fields = dest,process alert.suppress.period = 28800s cron_schedule = 0 * * * * -description = This search looks for network traffic on TCP/3389, the default port used by remote desktop. While remote desktop traffic is not uncommon on a network, it is usually associated with known hosts. This search allows for whitelisting both source and destination hosts to remove them from the output of the search so you can focus on the uncommon uses of remote desktop on your network. +description = This search looks for processes launched from files with at least five spaces in the name before the extension. This is typically done to obfuscate the file extension by pushing it outside of the default view. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -4953,7 +4908,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Network_Traffic where All_Traffic.dest_port=3389 AND All_Traffic.dest_category!=common_rdp_destination AND All_Traffic.src_category!=common_rdp_source by All_Traffic.src All_Traffic.dest All_Traffic.dest_port | `drop_dm_object_name("All_Traffic")` | `ctime(firstTime)`| `ctime(lastTime)` +search = | tstats `summariesonly` count values(Processes.process_path) as process_path min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process = "* .*" by Processes.dest Processes.user Processes.process Processes.process_name | `ctime(firstTime)`| `ctime(lastTime)` | `drop_dm_object_name(Processes)` [ESCU - Investigate Network Traffic From src_ip] action.escu = 0 @@ -4968,7 +4923,7 @@ action.escu.full_search_name = ESCU - Investigate Network Traffic From src_ip action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["Splunk Stream", "Bro", "Palo Alto Firewall"] -action.escu.analytic_story = ["ColdRoot MacOS RAT", "ColdRoot MacOS RAT", "Splunk Enterprise Vulnerability CVE-2018-11409"] +action.escu.analytic_story = ["Splunk Enterprise Vulnerability CVE-2018-11409", "ColdRoot MacOS RAT", "ColdRoot MacOS RAT"] action.escu.fields_required = ["src_ip"] action.escu.earliest_time_offset = 3600 action.escu.latest_time_offset = 3600 @@ -5029,54 +4984,27 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count values(Registry.registry_key_name) as registry_key_name values(Registry.registry_path) as registry_path min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry where (Registry.registry_path="*Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options*") by Registry.dest , Registry.status, Registry.user | `ctime(lastTime)` | `ctime(firstTime)` | `drop_dm_object_name(Registry)` -[ESCU - EC2 Instance Modified With Previously Unseen User - Rule] +[ESCU - Baseline of Network ACL Activity by ARN] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-04-09 -action.escu.modification_date = 2018-04-09 -action.escu.asset_at_risk = AWS Instance +action.escu.creation_date = 2018-05-21 +action.escu.modification_date = 2018-05-21 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = The subsearch returns the ARNs of all successful EC2 instance modifications within the last hour and then appends the historical data in the lookup file to those results. EC2 modification APIs are defined by the macro `ec2ModificationAPIs`. The search then recalculates the `firstTime` and `lastTime` field for each ARN and returns only those ARNs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance ID of those systems. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 Launches By User" support search once to create a history of previously seen ARNs. To add or remove APIs that modify an EC2 instance, edit the macro `ec2ModificationAPIs`. -action.escu.full_search_name = ESCU - EC2 Instance Modified With Previously Unseen User - Rule -action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -action.escu.known_false_positives = It's possible that a new user will start to modify EC2 instances when they haven't before for any number of reasons. Verify with the user that is modifying instances that this is the intended behavior. -action.escu.search_type = detection +action.escu.eli5 = Use this search to create a baseline for API calls related to network ACLs for the users who initiated this activity. It returns all logged API calls for network activity, pulls out the ARN that initiated each call, and collects the `eventNames` in one-hour groupings. Next, it calculates the number of API calls made per ARN per-hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points for each ARN. This table is stored in a lookup file. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. To add or remove API event names for network ACLs, edit the macro `NetworkACLEvents`. +action.escu.full_search_name = ESCU - Baseline of Network ACL Activity by ARN +action.escu.known_false_positives = None at this time +action.escu.search_type = support action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["Unusual AWS EC2 Modifications"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = EC2 Instance Modified With Previously Unseen User -action.notable = 1 -action.notable.param.nes_fields = user, dest -action.notable.param.rule_description = The EC2 instance $dest$ was modified by $user$. This user has never modified an EC2 instance before. -action.notable.param.rule_title = EC2 Instance Modified By Previously Unseen User $user$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get EC2 Instance Details by instanceId\n - ESCU - Get Notable History\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 30 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = user, dest -alert.suppress.period = 14400s -cron_schedule = 0 * * * * -description = This search looks for EC2 instances being modified by users who have not previously modified them. -dispatch.earliest_time = -70m@m +action.escu.analytic_story = ["AWS Network ACL Activity"] +description = This search establishes, on a per-hour basis, the average and the standard deviation of the number of API calls that were related to network ACLs made by each user. Also recorded is the number of data points for each user. This table is then outputted to a lookup file to allow the detection search to operate quickly. +dispatch.earliest_time = -30d@d dispatch.latest_time = -10m@m disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail `ec2ModificationAPIs` [search sourcetype=aws:cloudtrail `ec2ModificationAPIs` errorCode=success | stats earliest(_time) as firstTime latest(_time) as lastTime by userIdentity.arn | rename userIdentity.arn as arn | inputlookup append=t previously_seen_ec2_modifications_by_user | stats min(firstTime) as firstTime, max(lastTime) as lastTime by arn | outputlookup previously_seen_ec2_modifications_by_user | eval newUser=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newUser=1 | `ctime(firstTime)` | `ctime(lastTime)` | rename arn as userIdentity.arn | table userIdentity.arn] | spath output=dest responseElements.instancesSet.items{}.instanceId | spath output=user userIdentity.arn | table _time, user, dest +search = sourcetype=aws:cloudtrail `NetworkACLEvents` | spath output=arn path=userIdentity.arn | bucket _time span=1h | stats count as apiCalls by _time, arn | stats count(apiCalls) as numDataPoints, latest(apiCalls) as latestCount, avg(apiCalls) as avgApiCalls, stdev(apiCalls) as stdevApiCalls by arn | table arn, latestCount, numDataPoints, avgApiCalls, stdevApiCalls | outputlookup network_acl_activity_baseline | stats count [ESCU - AWS S3 Bucket details via bucketName] action.escu = 0 @@ -5151,30 +5079,6 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Change_Analysis where All_Changes.result_id=4720 OR All_Changes.result_id=4726 by All_Changes.result_id All_Changes.user All_Changes.dest | `ctime(lastTime)` | `ctime(firstTime)` | `drop_dm_object_name("All_Changes")` | transaction user maxspan=240m | search result_id=4720 result_id=4726 -[ESCU - Get Vulnerability Logs For Endpoint] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2017-08-24 -action.escu.modification_date = 2017-09-10 -action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = You need to be ingesting the logs from your vulnerability scanner. -action.escu.data_models = ["Vulnerabilities"] -action.escu.full_search_name = ESCU - Get Vulnerability Logs For Endpoint -action.escu.known_false_positives = None at this time -action.escu.search_type = contextual -action.escu.providing_technologies = ["Nessus"] -action.escu.analytic_story = ["ColdRoot MacOS RAT", "ColdRoot MacOS RAT", "Ransomware", "SamSam Ransomware"] -action.escu.fields_required = ["dest"] -action.escu.earliest_time_offset = 604800 -action.escu.latest_time_offset = 0 -description = This search will show you any vulnerabilities noted for a specific endpoint for the last week. -disabled=true -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | from datamodel Vulnerabilities.Vulnerabilities | search dest=$dest$ - [ESCU - Remote WMI Command Attempt - Rule] action.escu = 0 action.escu.enabled = 1 @@ -5498,6 +5402,29 @@ schedule_window = auto is_visible = false search = sourcetype=aws:cloudtrail eventName=RunInstances [search sourcetype=aws:cloudtrail eventName=RunInstances errorCode=success | stats earliest(_time) as firstTime latest(_time) as lastTime by userIdentity.arn | rename userIdentity.arn as arn | inputlookup append=t previously_seen_ec2_launches_by_user.csv | stats min(firstTime) as firstTime, max(lastTime) as lastTime by arn | outputlookup previously_seen_ec2_launches_by_user.csv | eval newUser=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newUser=1 | `ctime(firstTime)` | `ctime(lastTime)` | rename arn as userIdentity.arn | table userIdentity.arn] | rename requestParameters.instanceType as instanceType, responseElements.instancesSet.items{}.instanceId as dest, userIdentity.arn as user | table _time, user, dest, instanceType +[ESCU - Identify Systems Using Remote Desktop] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2017-04-18 +action.escu.modification_date = 2017-09-15 +action.escu.channel = ESCU +action.escu.eli5 = This search counts the numbers of times the remote desktop process, mstsc.exe, has run on each system. It does this by looking for the process in the Application_State data model. +action.escu.how_to_implement = To successfully implement this search you must be ingesting endpoint data that records process activity. +action.escu.data_models = ["Application_State"] +action.escu.full_search_name = ESCU - Identify Systems Using Remote Desktop +action.escu.known_false_positives = None at this time +action.escu.search_type = support +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Lateral Movement"] +description = This search counts the numbers of times the remote desktop process, mstsc.exe, has run on each system. +dispatch.earliest_time = -30d@d +dispatch.latest_time = -10m@m +disabled=true +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | tstats `summariesonly` count from datamodel=Application_State where All_Application_State.process="*mstsc.exe*" by All_Application_State.dest All_Application_State.process | `drop_dm_object_name("All_Application_State")` | sort - count + [ESCU - Previously seen command line arguments] action.escu = 0 action.escu.enabled = 1 @@ -5510,7 +5437,7 @@ action.escu.full_search_name = ESCU - Previously seen command line arguments action.escu.known_false_positives = None at this time action.escu.search_type = support action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Orangeworm Attack Group", "Hidden Cobra Malware", "Suspicious Command-Line Executions", "DHS Report TA18-074A"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Orangeworm Attack Group", "Suspicious Command-Line Executions", "Hidden Cobra Malware", "DHS Report TA18-074A"] description = This search looks for command-line arguments where `cmd.exe /c` is used to execute a program, then creates a baseline of the earliest and latest times we have encountered this command-line argument in our dataset within the last 30 days. dispatch.earliest_time = -30d@d dispatch.latest_time = -10m@m @@ -5520,43 +5447,44 @@ schedule_window = auto is_visible = false search = sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational process=cmd.exe cmdline="* /c *" | stats earliest(_time) as firstTime latest(_time) as lastTime by cmdline | outputlookup previously_seen_cmd_line_arguments | stats count -[ESCU - Detect Mimikatz Via PowerShell And EventCode 4663 - Rule] +[ESCU - DNS Query Requests Resolved by Unauthorized DNS Servers - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-08-28 -action.escu.modification_date = 2018-08-28 -action.escu.asset_at_risk = Windows +action.escu.creation_date = 2017-07-08 +action.escu.modification_date = 2017-09-18 +action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = This search looks for Windows Event Code 4663 (object access), where the process performing the access is PowerShell.exe, the target process of the access is lsass.exe, and the access mask is given as 0x10. This is consistent with the use of PowerShell to execute Mimikatz using sekurlsa::logonpasswords. It will return the host where the activity occurred, the process and associated id, the enabled privilege, and the message in the event. -action.escu.how_to_implement = You must be ingesting Windows Security logs. You must also enable the account change auditing here: http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/MonitorWindowseventlogdata. Additionally, this search requires you to enable your Group Management Audit Logs in your Local Windows Security Policy and to be ingesting those logs. More information on how to enable them can be found here: http://whatevernetworks.com/auditing-group-membership-changes-in-active-directory/. Finally, please make sure that the local administrator group name is "Administrators" to be able to look for the right group membership changes. -action.escu.full_search_name = ESCU - Detect Mimikatz Via PowerShell And EventCode 4663 - Rule -action.escu.mappings = {"mitre_attack": ["Credential Access", "Credential Dumping"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.IP", "PR.AC", "DE.CM"]} -action.escu.known_false_positives = The activity may be legitimate. PowerShell is often used by administrators to perform various tasks, and it's possible this event could be generated in those cases. In these cases, false positives should be fairly obvious and you may need to tweak the search to eliminate noise. +action.escu.eli5 = Clients should be resolving their DNS requests via a trusted DNS server. This search will identify DNS queries being sent to unauthorized DNS servers by comparing the destination and source of the traffic with assets marked as DNS servers. +action.escu.how_to_implement = To successfully implement this search you will need to ensure that DNS data is populating the Network_Resolution data model. It also requires that your DNS servers are identified correctly in the Assets and Identity table of Enterprise Security. +action.escu.data_models = ["Network_Resolution"] +action.escu.full_search_name = ESCU - DNS Query Requests Resolved by Unauthorized DNS Servers - Rule +action.escu.mappings = {"mitre_attack": ["Exfiltration", "Command and Control", "Defense Evasion", "Commonly Used Port"], "kill_chain_phases": ["Command and Control"], "cis20": ["CIS 1", "CIS 3", "CIS 8", "CIS 12"], "nist": ["ID.AM", "PR.DS", "PR.IP", "DE.AE", "DE.CM"]} +action.escu.known_false_positives = Legitimate DNS activity can be detected in this search. Investigate, verify and update the list of authorized DNS servers as appropriate. action.escu.search_type = detection -action.escu.providing_technologies = ["Microsoft Windows"] -action.escu.analytic_story = ["Credential Dumping"] +action.escu.providing_technologies = ["Splunk Stream", "Bro"] +action.escu.analytic_story = ["Suspicious DNS Traffic", "Command and Control"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect Mimikatz Via PowerShell And EventCode 4663 +action.correlationsearch.label = DNS Query Requests Resolved by Unauthorized DNS Servers action.notable = 1 -action.notable.param.nes_fields = user, dest -action.notable.param.rule_description = Possible attempt at credential dumping via PowerShell was detected on $dest$ by $user$. -action.notable.param.rule_title = Event ID 4663 Specifying PowerShell Reading From LSASS.exe Identified on $dest$. -action.notable.param.security_domain = access +action.notable.param.nes_fields = dest, src +action.notable.param.rule_description = The table represents a list of unauthorized DNS servers interacting with hosts in your network +action.notable.param.rule_title = DNS requests resolved by unauthorized DNS servers +action.notable.param.security_domain = network action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS Network Interface details via resourceId\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = dest +action.risk.param._risk_object = src action.risk.param._risk_object_type = system action.risk.param._risk_score = 40 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = user, dest, process -alert.suppress.period = 86400s +alert.suppress.fields = dest,src +alert.suppress.period = 28800s cron_schedule = 0 * * * * -description = This search looks for PowerShell reading lsass memory consistent with credential dumping. +description = This search will detect DNS requests resolved by unauthorized DNS servers. Legitimate DNS servers should be identified in the Enterprise Security Assets and Identity Framework. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -5567,7 +5495,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=wineventlog:security EventCode=4663 Process_Name=*powershell.exe Object_Name=*lsass.exe Access_Mask=0x10 | stats count min(_time) as firstTime max(_time) as lastTime by dest, Process_Name, Process_ID, Message | rename Process_Name as process | `ctime(firstTime)`| `ctime(lastTime)` +search = | tstats `summariesonly` count from datamodel=Network_Resolution where DNS.dest_category != dns_server AND DNS.src_category != dns_server by DNS.src DNS.dest | `drop_dm_object_name("DNS")` [ESCU - Registry Keys for Creating SHIM Databases - Rule] action.escu = 0 @@ -5619,67 +5547,43 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Change_Analysis.All_Changes where All_Changes.object_category=registry AND (All_Changes.object_path="*CurrentVersion\\AppCompatFlags\\Custom*" OR All_Changes.object_path="*CurrentVersion\\AppCompatFlags\\InstalledSDB*") by All_Changes.dest, All_Changes.command, All_Changes.user, All_Changes.object, All_Changes.object_path | `drop_dm_object_name("All_Changes")` -[ESCU - Get User Information from Identity Table] +[ESCU - Detect Mimikatz Via PowerShell And EventCode 4663 - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-04-10 -action.escu.modification_date = 2017-09-20 -action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = To successfully implement this search you must have populated the identity table with information about your users. -action.escu.full_search_name = ESCU - Get User Information from Identity Table -action.escu.known_false_positives = None at this time -action.escu.search_type = contextual -action.escu.providing_technologies = ["Splunk Enterprise Security"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "JBoss Vulnerability", "Orangeworm Attack Group", "Monitor for Unauthorized Software", "AWS Network ACL Activity", "ColdRoot MacOS RAT", "Command and Control", "Router & Infrastructure Security", "Emotet Malware (TA18-201A)", "Credential Dumping", "Data Protection", "ColdRoot MacOS RAT", "Brand Monitoring", "Disabling Security Tools", "Spectre And Meltdown Vulnerabilities", "Suspicious Windows Registry Activities", "Windows Privilege Escalation", "Windows Persistence Techniques", "Asset Tracking", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Use of Cleartext Protocols", "Account Monitoring and Controls", "Unusual Processes", "SQL Injection", "Dynamic DNS", "Collection and Staging", "Suspicious AWS Login Activities", "Suspicious Command-Line Executions", "Splunk Enterprise Vulnerability", "Ransomware", "Windows Service Abuse", "Netsh Abuse", "Windows Defense Evasion Tactics", "SamSam Ransomware", "Host Redirection", "DHS Report TA18-074A", "Suspicious AWS EC2 Activities", "Suspicious MSHTA Activity", "Malicious PowerShell", "Lateral Movement", "Windows Log Manipulation", "Suspicious AWS S3 Activities", "Monitor for Updates", "Suspicious DNS Traffic", "Apache Struts Vulnerability", "Suspicious WMI Use", "Suspicious Emails"] -action.escu.fields_required = ["user"] -action.escu.earliest_time_offset = 864000 -action.escu.latest_time_offset = 86400 -description = Gather more information about the user identified in the Notable Event. -disabled=true -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | `identities` | search identity=$user$ | table _time, identity, first, last, email, category, watchlist - -[ESCU - DNS Query Requests Resolved by Unauthorized DNS Servers - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2017-07-08 -action.escu.modification_date = 2017-09-18 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2018-08-28 +action.escu.modification_date = 2018-08-28 +action.escu.asset_at_risk = Windows action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = Clients should be resolving their DNS requests via a trusted DNS server. This search will identify DNS queries being sent to unauthorized DNS servers by comparing the destination and source of the traffic with assets marked as DNS servers. -action.escu.how_to_implement = To successfully implement this search you will need to ensure that DNS data is populating the Network_Resolution data model. It also requires that your DNS servers are identified correctly in the Assets and Identity table of Enterprise Security. -action.escu.data_models = ["Network_Resolution"] -action.escu.full_search_name = ESCU - DNS Query Requests Resolved by Unauthorized DNS Servers - Rule -action.escu.mappings = {"mitre_attack": ["Exfiltration", "Command and Control", "Defense Evasion", "Commonly Used Port"], "kill_chain_phases": ["Command and Control"], "cis20": ["CIS 1", "CIS 3", "CIS 8", "CIS 12"], "nist": ["ID.AM", "PR.DS", "PR.IP", "DE.AE", "DE.CM"]} -action.escu.known_false_positives = Legitimate DNS activity can be detected in this search. Investigate, verify and update the list of authorized DNS servers as appropriate. +action.escu.eli5 = This search looks for Windows Event Code 4663 (object access), where the process performing the access is PowerShell.exe, the target process of the access is lsass.exe, and the access mask is given as 0x10. This is consistent with the use of PowerShell to execute Mimikatz using sekurlsa::logonpasswords. It will return the host where the activity occurred, the process and associated id, the enabled privilege, and the message in the event. +action.escu.how_to_implement = You must be ingesting Windows Security logs. You must also enable the account change auditing here: http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/MonitorWindowseventlogdata. Additionally, this search requires you to enable your Group Management Audit Logs in your Local Windows Security Policy and to be ingesting those logs. More information on how to enable them can be found here: http://whatevernetworks.com/auditing-group-membership-changes-in-active-directory/. Finally, please make sure that the local administrator group name is "Administrators" to be able to look for the right group membership changes. +action.escu.full_search_name = ESCU - Detect Mimikatz Via PowerShell And EventCode 4663 - Rule +action.escu.mappings = {"mitre_attack": ["Credential Access", "Credential Dumping"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5", "CIS 16"], "nist": ["PR.IP", "PR.AC", "DE.CM"]} +action.escu.known_false_positives = The activity may be legitimate. PowerShell is often used by administrators to perform various tasks, and it's possible this event could be generated in those cases. In these cases, false positives should be fairly obvious and you may need to tweak the search to eliminate noise. action.escu.search_type = detection -action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Suspicious DNS Traffic"] +action.escu.providing_technologies = ["Microsoft Windows"] +action.escu.analytic_story = ["Credential Dumping"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = DNS Query Requests Resolved by Unauthorized DNS Servers +action.correlationsearch.label = Detect Mimikatz Via PowerShell And EventCode 4663 action.notable = 1 -action.notable.param.nes_fields = dest, src -action.notable.param.rule_description = The table represents a list of unauthorized DNS servers interacting with hosts in your network -action.notable.param.rule_title = DNS requests resolved by unauthorized DNS servers -action.notable.param.security_domain = network +action.notable.param.nes_fields = user, dest +action.notable.param.rule_description = Possible attempt at credential dumping via PowerShell was detected on $dest$ by $user$. +action.notable.param.rule_title = Event ID 4663 Specifying PowerShell Reading From LSASS.exe Identified on $dest$. +action.notable.param.security_domain = access action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Investigate Web Activity From Host\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = src +action.risk.param._risk_object = dest action.risk.param._risk_object_type = system action.risk.param._risk_score = 40 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest,src -alert.suppress.period = 28800s +alert.suppress.fields = user, dest, process +alert.suppress.period = 86400s cron_schedule = 0 * * * * -description = This search will detect DNS requests resolved by unauthorized DNS servers. Legitimate DNS servers should be identified in the Enterprise Security Assets and Identity Framework. +description = This search looks for PowerShell reading lsass memory consistent with credential dumping. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -5690,7 +5594,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count from datamodel=Network_Resolution where DNS.dest_category != dns_server AND DNS.src_category != dns_server by DNS.src DNS.dest | `drop_dm_object_name("DNS")` +search = sourcetype=wineventlog:security EventCode=4663 Process_Name=*powershell.exe Object_Name=*lsass.exe Access_Mask=0x10 | stats count min(_time) as firstTime max(_time) as lastTime by dest, Process_Name, Process_ID, Message | rename Process_Name as process | `ctime(firstTime)`| `ctime(lastTime)` [ESCU - Get All AWS Activity From Country] action.escu = 0 @@ -5715,6 +5619,56 @@ schedule_window = auto is_visible = false search = | search sourcetype=aws:cloudtrail | iplocation sourceIPAddress | search Country=$Country$ | spath output=user path=userIdentity.arn | spath output=awsUserName path=userIdentity.userName | spath output=userType path=userIdentity.type | rename sourceIPAddress as src_ip | table _time, Country, user, userName, userType, src_ip, awsRegion, eventName, errorCode +[ESCU - Shim Database File Creation - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2017-10-03 +action.escu.modification_date = 2018-11-02 +action.escu.asset_at_risk = Endpoint +action.escu.channel = ESCU +action.escu.confidence = high +action.escu.eli5 = This search looks for files being created in `Windows\AppPatch\Custom and Windows\AppPatch\Custom64`, the location where shim databases are installed. It will return all the files created, as well as the time of creation for the first and last file for each endpoint. +action.escu.how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Shim Database File Creation - Rule +action.escu.mappings = {"mitre_attack": ["Persistence", "Application Shimming"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} +action.escu.known_false_positives = Because legitimate shim files are created and used all the time, this event, in itself, is not suspicious. However, if there are other correlating events, it may warrant further investigation. +action.escu.search_type = detection +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] +action.escu.analytic_story = ["Windows Persistence Techniques"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Shim Database File Creation +action.notable = 1 +action.notable.param.nes_fields = dest, file_name +action.notable.param.rule_description = A file, $file_name$, was created in the default shim database directory on $dest. +action.notable.param.rule_title = Shim database file created on $dest$ +action.notable.param.security_domain = endpoint +action.notable.param.severity = high +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 20 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest +alert.suppress.period = 14400s +cron_schedule = 0 * * * * +description = This search looks for shim database files being written to default directories. The sdbinst.exe application is used to install shim database files (.sdb). According to Microsoft, a shim is a small library that transparently intercepts an API, changes the parameters passed, handles the operation itself, or redirects the operation elsewhere. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m +disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | tstats `summariesonly` count values(Filesystem.action) values(Filesystem.file_hash) as file_hash values(Filesystem.file_path) as file_path min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.file_path=*Windows\AppPatch\Custom* by Filesystem.file_name Filesystem.dest | `ctime(lastTime)` | `ctime(firstTime)` |`drop_dm_object_name(Filesystem)` + [ESCU - Script Execution via WMI - Rule] action.escu = 0 action.escu.enabled = 1 @@ -5848,7 +5802,7 @@ action.escu.full_search_name = ESCU - Get Authentication Logs For Endpoint action.escu.known_false_positives = None at this time action.escu.search_type = contextual action.escu.providing_technologies = ["Microsoft Windows", "Linux", "macOS"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "JBoss Vulnerability", "Orangeworm Attack Group", "Monitor for Unauthorized Software", "ColdRoot MacOS RAT", "Command and Control", "Router & Infrastructure Security", "Emotet Malware (TA18-201A)", "Credential Dumping", "Data Protection", "ColdRoot MacOS RAT", "Brand Monitoring", "Disabling Security Tools", "Spectre And Meltdown Vulnerabilities", "Suspicious Windows Registry Activities", "Windows Privilege Escalation", "Windows Persistence Techniques", "Asset Tracking", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Account Monitoring and Controls", "Unusual Processes", "SQL Injection", "Dynamic DNS", "Collection and Staging", "Prohibited Traffic Allowed or Protocol Mismatch", "Suspicious Command-Line Executions", "Splunk Enterprise Vulnerability", "Ransomware", "Windows Service Abuse", "Netsh Abuse", "Windows Defense Evasion Tactics", "SamSam Ransomware", "Host Redirection", "DHS Report TA18-074A", "Suspicious MSHTA Activity", "Malicious PowerShell", "Lateral Movement", "Windows Log Manipulation", "Monitor for Updates", "Suspicious DNS Traffic", "Apache Struts Vulnerability", "Suspicious WMI Use", "Suspicious Emails"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Ransomware", "Apache Struts Vulnerability", "Netsh Abuse", "Collection and Staging", "JBoss Vulnerability", "Orangeworm Attack Group", "Host Redirection", "Dynamic DNS", "Suspicious Windows Registry Activities", "Credential Dumping", "Monitor for Unauthorized Software", "Brand Monitoring", "Malicious PowerShell", "Splunk Enterprise Vulnerability", "Lateral Movement", "Emotet Malware (TA18-201A)", "Suspicious Emails", "SamSam Ransomware", "Spectre And Meltdown Vulnerabilities", "Disabling Security Tools", "Suspicious WMI Use", "Suspicious DNS Traffic", "Unusual Processes", "Router & Infrastructure Security", "Monitor for Updates", "Prohibited Traffic Allowed or Protocol Mismatch", "Windows Privilege Escalation", "Suspicious Command-Line Executions", "SQL Injection", "Windows Service Abuse", "ColdRoot MacOS RAT", "Command and Control", "ColdRoot MacOS RAT", "Windows File Extension and Association Abuse", "Account Monitoring and Controls", "Windows Persistence Techniques", "Windows Defense Evasion Tactics", "Hidden Cobra Malware", "Data Protection", "Asset Tracking", "Windows Log Manipulation", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] action.escu.fields_required = ["dest"] action.escu.earliest_time_offset = 43200 action.escu.latest_time_offset = 1 @@ -6041,7 +5995,7 @@ action.escu.full_search_name = ESCU - AWS Network Interface details via resource action.escu.known_false_positives = None at this time action.escu.search_type = contextual action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Network ACL Activity", "Command and Control", "Suspicious AWS Traffic"] +action.escu.analytic_story = ["AWS Network ACL Activity", "Suspicious AWS Traffic", "Command and Control"] action.escu.fields_required = ["resourceId"] action.escu.earliest_time_offset = 86400 action.escu.latest_time_offset = 0 @@ -6140,7 +6094,7 @@ action.escu.mappings = {"mitre_attack": ["Persistence", "Privilege Escalation", action.escu.known_false_positives = Using sc.exe to manipulate Windows services is uncommon. However, there may be legitimate instances of this behavior. It is important to validate and investigate as appropriate. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Orangeworm Attack Group", "Disabling Security Tools", "Windows Persistence Techniques", "Windows Service Abuse", "DHS Report TA18-074A"] +action.escu.analytic_story = ["Orangeworm Attack Group", "Disabling Security Tools", "Windows Service Abuse", "Windows Persistence Techniques", "DHS Report TA18-074A"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Sc.exe Manipulating Windows Services action.notable = 1 @@ -6309,7 +6263,7 @@ action.escu.full_search_name = ESCU - AWS Investigate User Activities By ARN action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Network ACL Activity", "Suspicious AWS Login Activities", "Suspicious AWS EC2 Activities", "Suspicious AWS S3 Activities", "Unusual AWS EC2 Modifications"] +action.escu.analytic_story = ["Suspicious AWS S3 Activities", "AWS Network ACL Activity", "Suspicious AWS EC2 Activities", "Unusual AWS EC2 Modifications", "Suspicious AWS Login Activities"] action.escu.fields_required = ["arn"] action.escu.earliest_time_offset = 14400 action.escu.latest_time_offset = 0 @@ -6335,7 +6289,7 @@ action.escu.mappings = {"mitre_attack": ["Persistence", "Execution", "Scheduled action.escu.known_false_positives = Administrators may create jobs on systems forcing reboots to perform updates, maintenance, etc. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Windows Persistence Techniques", "Ransomware"] +action.escu.analytic_story = ["Ransomware", "Windows Persistence Techniques"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Schtasks used for forcing a reboot action.notable = 1 @@ -6344,7 +6298,7 @@ action.notable.param.rule_description = This search looks for flags passed to sc action.notable.param.rule_title = Schtasks used for scheduling a force reboot action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Backup Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get Update Logs For Endpoint\n - ESCU - Get User Information from Identity Table\n - ESCU - Get Vulnerability Logs For Endpoint\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest @@ -6454,7 +6408,7 @@ action.escu.full_search_name = ESCU - Monitor Unsuccessful Backups action.escu.known_false_positives = None at this time action.escu.search_type = support action.escu.providing_technologies = ["Netbackup"] -action.escu.analytic_story = ["Ransomware", "Monitor Backup Solution", "SamSam Ransomware"] +action.escu.analytic_story = ["Monitor Backup Solution", "Ransomware", "SamSam Ransomware"] description = This search is intended to give you a feel for how often backup failures happen in your environments. Fluctuations in these numbers will allow you to determine when you should investigate. dispatch.earliest_time = -30d@d dispatch.latest_time = -10m@m @@ -6536,55 +6490,6 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime values(Filesystem.user) as user values(Filesystem.dest) as dest values(Filesystem.file_path) as file_path from datamodel=Endpoint.Filesystem by Filesystem.file_name | `drop_dm_object_name(Filesystem)` | `ctime(lastTime)` | `ctime(firstTime)`| rex field=file_name "(?\.[^\.]+)$" | `ransomware_extensions` -[ESCU - Abnormally High AWS Instances Terminated by User - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-02-26 -action.escu.modification_date = 2018-02-26 -action.escu.asset_at_risk = AWS Instance -action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = In this search, we query CloudTrail logs to look for events where an instance is successfully terminated by a particular user. Since we want to detect a high number of instances terminated within a short period, we create event buckets for 10-minute windows. We then calculate the total number of instances terminated by a particular user, as well as the average- and standard-deviation values. Assign a `threshold_value` in the search. Try starting with 3 (but it will likely need to be tweaked for your environment). The `eval` function will set the outlier to 1 if the number of instances is greater than the average number of instances terminated, added to the multiplied value of threshold and standard deviation. We then filter out outliers with a value of 1 and show only those instance-termination events that happened within the previous 10 minutes. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. -action.escu.full_search_name = ESCU - Abnormally High AWS Instances Terminated by User - Rule -action.escu.mappings = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["DE.DP", "DE.AE"]} -action.escu.known_false_positives = Many service accounts configured with your AWS infrastructure are known to exhibit this behavior. Please adjust the threshold values and filter out service accounts from the output. Always verify whether this search alerted on a human user. -action.escu.search_type = detection -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["Suspicious AWS EC2 Activities"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Abnormally High AWS Instances Terminated by User -action.notable = 1 -action.notable.param.nes_fields = userName -action.notable.param.rule_description = An abnormally high number of instances were terminated by a user in a 10-minute window -action.notable.param.rule_title = High number of instances terminated by $userName$ -action.notable.param.security_domain = network -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get EC2 Instance Details by instanceId\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n - ESCU - Investigate AWS activities via region name\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = userName -action.risk.param._risk_object_type = user -action.risk.param._risk_score = 30 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = userName -alert.suppress.period = 3600s -cron_schedule = */10 * * * * -description = This search looks for CloudTrail events where an abnormally high number of instances were successfully terminated by a user in a 10-minute window -dispatch.earliest_time = -30d@d -dispatch.latest_time = -10m@m -disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = sourcetype=aws:cloudtrail eventName=TerminateInstances errorCode=success | bucket span=10m _time | stats count AS instances_terminated by _time userName | eventstats avg(instances_terminated) as total_terminations_avg, stdev(instances_terminated) as total_terminations_stdev | eval threshold_value = 4 | eval isOutlier=if(instances_terminated > total_terminations_avg+(total_terminations_stdev * threshold_value), 1, 0) | search isOutlier=1 AND _time >= relative_time(now(), "-10m@m")| eval num_standard_deviations_away = round(abs(instances_terminated - total_terminations_avg) / total_terminations_stdev, 2) |table _time, userName, instances_terminated, num_standard_deviations_away, total_terminations_avg, total_terminations_stdev - [ESCU - Extended Period Without Successful Netbackup Backups - Rule] action.escu = 0 action.escu.enabled = 1 @@ -6657,54 +6562,28 @@ schedule_window = auto is_visible = false search = | search sourcetype=aws:description id=$networkAclId$ | table id account_id vpc_id network_acl_entries{}.* -[ESCU - Detect PsExec With accepteula Flag - Rule] +[ESCU - Get EC2 Instance Details by instanceId] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-03-28 -action.escu.modification_date = 2018-03-28 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2018-02-12 +action.escu.modification_date = 2018-02-12 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = In this search, we are looking for the PsExec process with `accepteula` on the command line. -action.escu.how_to_implement = To successfully implement this search, you need to be ingesting logs with the process name, command-line arguments, and parent process from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon Technology Add-on (TA). -action.escu.full_search_name = ESCU - Detect PsExec With accepteula Flag - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Command-Line Interface"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -action.escu.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 -action.escu.search_type = detection -action.escu.providing_technologies = ["Sysmon"] -action.escu.analytic_story = ["SamSam Ransomware", "DHS Report TA18-074A"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect PsExec With accepteula Flag -action.notable = 1 -action.notable.param.nes_fields = dest,parent_process -action.notable.param.rule_description = The process pssxec.exe was run with the -accepteula flag on $dest$ by $user$. -action.notable.param.rule_title = PsExec executed with accepteula flag on $dest$. -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 75 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = dest, parent_process -alert.suppress.period = 86400s -cron_schedule = 0 * * * * -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. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m +action.escu.eli5 = none +action.escu.how_to_implement = In order to implement this search, you must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS(version 4.4.0 or later) and configure your AWS description inputs. +action.escu.full_search_name = ESCU - Get EC2 Instance Details by instanceId +action.escu.known_false_positives = None at this time +action.escu.search_type = contextual +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["Suspicious AWS EC2 Activities", "Unusual AWS EC2 Modifications"] +action.escu.fields_required = ["instanceId"] +action.escu.earliest_time_offset = 86400 +action.escu.latest_time_offset = 0 +description = This search queries AWS description logs and returns all the information about a specific instance via the instanceId field disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=xmlwineventlog:microsoft-windows-sysmon/operational process=PsExec.exe accepteula | search cmdline=*accepteula* | stats count values(cmdline) as cmdlines, min(_time) as firstTime, max(_time) as lastTime by dest, user, parent_process | `ctime(firstTime)`| `ctime(lastTime)` | table firstTime, lastTime, count, dest, user, parent_process, cmdlines +search = | search sourcetype="aws:description" source="*:ec2_instances"| dedup id sortby -_time | search id=$instanceId$ | spath output=tags path=tags | eval tags=mvzip(key,value," = "), ip_address=if((ip_address == "null"),private_ip_address,ip_address) | table id, tags.Name, aws_account_id, placement, instance_type, key_name, ip_address, launch_time, state, vpc_id, subnet_id, tags | rename aws_account_id as "Account ID", id as ID, instance_type as Type, ip_address as "IP Address", key_name as "Key Pair", launch_time as "Launch Time", placement as "Availability Zone", state as State, subnet_id as Subnet, "tags.Name" as Name, vpc_id as VPC [ESCU - Reg.exe Manipulating Windows Services Registry Keys - Rule] action.escu = 0 @@ -6721,7 +6600,7 @@ action.escu.mappings = {"mitre_attack": ["Persistence", "Privilege Escalation", action.escu.known_false_positives = It is unusual for a service to be created or modified by directly manipulating the registry. However, there may be legitimate instances of this behavior. It is important to validate and investigate, as appropriate. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Windows Persistence Techniques", "Windows Service Abuse"] +action.escu.analytic_story = ["Windows Service Abuse", "Windows Persistence Techniques"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Reg.exe Manipulating Windows Services Registry Keys action.notable = 1 @@ -6856,43 +6735,44 @@ schedule_window = auto is_visible = false search = sourcetype=aws:cloudtrail (eventName=Run* OR eventName=Create*) | iplocation sourceIPAddress | search Country=* [search sourcetype=aws:cloudtrail (eventName=Run* OR eventName=Create*) | iplocation sourceIPAddress | search Country=* | stats earliest(_time) as firstTime, latest(_time) as lastTime by sourceIPAddress, City, Region, Country | inputlookup append=t previously_seen_provisioning_activity_src.csv | stats min(firstTime) as firstTime max(lastTime) as lastTime by sourceIPAddress, City, Region, Country | outputlookup previously_seen_provisioning_activity_src.csv | stats min(firstTime) as firstTime max(lastTime) as lastTime by Country | eval newCountry=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newCountry=1 | table Country] | spath output=user userIdentity.arn | rename sourceIPAddress as src_ip | table _time, user, src_ip, Country, eventName, errorCode -[ESCU - Suspicious Java Classes - Rule] +[ESCU - Processes created by netsh - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-12-06 -action.escu.modification_date = 2018-12-06 +action.escu.creation_date = 2018-01-04 +action.escu.modification_date = 2018-11-02 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = The search leverages HTTP form data from typically POST events that can be captured with Splunk streams or similar wire data capture tools. The search looks for java classes like `processbuilder` and `runtime` are used to create a new process and execute commands inside java, and are synonymous with spawning a shell. There are very exceptional reasons to ever these classes in Java via an HTTP API and hence when seen are highly suspicious. Also, this is a common vectors leverage to exploit Apache Struts. -action.escu.how_to_implement = In order to properly run this search, Splunk needs to ingest data from your web-traffic appliances that serve or sit in the path of your Struts application servers. This can be accomplished by indexing data from a web proxy, or by using network traffic-analysis tools, such as Splunk Stream or Bro. -action.escu.full_search_name = ESCU - Suspicious Java Classes - Rule -action.escu.mappings = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 7", "CIS 12"], "nist": ["DE.AE"]} -action.escu.known_false_positives = There are no known false positives. +action.escu.eli5 = This search looks for all processes with the parent process "c:\Windows\System32\netsh.exe" and returns the process, the command line used to execute it, the host name, and the user context under which it ran. +action.escu.how_to_implement = To successfully implement this search, you must be ingesting logs with the process name, command-line arguments, and parent processes from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Processes created by netsh - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Command-Line Interface", "Persistence"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +action.escu.known_false_positives = It is unusual for netsh.exe to have any child processes in most environments. It makes sense to investigate the child process and verify whether the process spawned is legitimate. action.escu.search_type = detection -action.escu.providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Apache"] -action.escu.analytic_story = ["Apache Struts Vulnerability"] +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Netsh Abuse"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Suspicious Java Classes +action.correlationsearch.label = Processes created by netsh action.notable = 1 -action.notable.param.nes_fields = src, url, http_user_agent -action.notable.param.rule_description = The host $src$ with user agent $http_user_agent$ is sending web traffic to $url$, which contains suspicious Java classes. These classes may be indicative of remote code execution in Java frameworks, such as Apache Struts. -action.notable.param.rule_title = Suspicious Java Classes: Possible RCE against Struts or similar Java framework from $src$ -action.notable.param.security_domain = threat +action.notable.param.nes_fields = dest, process, parent_process +action.notable.param.rule_description = A process, $process$, is spawned by netsh.exe. It is highly unlikely for netsh to have any child processes. +action.notable.param.rule_title = Process spawned by netsh.exe detected on $dest$ +action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate Suspicious Strings in HTTP Header\n - ESCU - Investigate Web POSTs From src\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Investigate Web Activity From Host\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = src +action.risk.param._risk_object = dest action.risk.param._risk_object_type = system action.risk.param._risk_score = 50 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = src, url, http_user_agent -alert.suppress.period = 3600s +alert.suppress.fields = dest, process +alert.suppress.period = 86400s cron_schedule = 0 * * * * -description = This search looks for suspicious Java classes that are often used to exploit remote command execution in common Java frameworks, such as Apache Struts. +description = This search looks for processes launching netsh.exe to execute various commands via the netsh command-line utility. Netsh.exe is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh can be used as a persistence proxy technique to execute a helper .dll when netsh.exe is executed. In this search, we are looking for processes spawned by netsh.exe that are executing commands via the command line. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -6903,7 +6783,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype="stream:http" http_method=POST http_content_length>1 | regex form_data="(?i)java\.lang\.(?:runtime|processbuilder)" | rename src_ip as src | stats count earliest(_time) as firstTime, latest(_time) as lastTime, values(url) as uri, values(status) as status, values(http_user_agent) as http_user_agent by src, dest | convert ctime(firstTime) ctime(lastTime) +search = | tstats `summariesonly` count values(Processes.process) min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.parent_process="C:\Windows\System32\netsh.exe" by Processes.parent_process Processes.process_name Processes.user Processes.dest | `drop_dm_object_name("Processes")` | `ctime(firstTime)`|`ctime(lastTime)` [ESCU - Web Fraud - Account Harvesting - Rule] action.escu = 0 @@ -6954,94 +6834,91 @@ schedule_window = auto is_visible = false search = sourcetype=stream:http http_content_type=text* uri="/magento2/customer/account/loginPost/" | rex field=cookie "form_key=(?\w+)" | rex field=form_data "login\[username\]=(?[^&|^$]+)" | search Username=* | rex field=Username "@(?.*)"|stats dc(Username) as UniqueUsernames list(Username) as src_user by email_domain|where UniqueUsernames> 25 -[ESCU - Scheduled Task Name Used by Dragonfly Threat Actors - Rule] +[ESCU - Investigate Web Activity From Host] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2017-04-21 +action.escu.modification_date = 2017-11-09 +action.escu.channel = ESCU +action.escu.eli5 = none +action.escu.how_to_implement = To successfully implement this search you must be ingesting your web traffic and populating the Web data model. +action.escu.data_models = ["Web"] +action.escu.full_search_name = ESCU - Investigate Web Activity From Host +action.escu.known_false_positives = None at this time +action.escu.search_type = investigative +action.escu.providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Palo Alto Firewall"] +action.escu.analytic_story = ["Ransomware", "Netsh Abuse", "Orangeworm Attack Group", "Host Redirection", "Credential Dumping", "Monitor for Unauthorized Software", "Brand Monitoring", "Emotet Malware (TA18-201A)", "Suspicious Emails", "SamSam Ransomware", "Unusual Processes", "Suspicious Command-Line Executions"] +action.escu.fields_required = ["dest"] +action.escu.earliest_time_offset = 3600 +action.escu.latest_time_offset = 3600 +description = This search allows you to find all the web activity from a specific host. During an investigation, it is important to profile web activity to characterize user or host activity. +disabled=true +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | from datamodel Web.Web | search src=$dest$ + +[ESCU - Get All AWS Activity From City] action.escu = 0 action.escu.enabled = 1 action.escu.creation_date = 2018-03-19 +action.escu.modification_date = 2018-03-19 +action.escu.channel = ESCU +action.escu.eli5 = none +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. +action.escu.full_search_name = ESCU - Get All AWS Activity From City +action.escu.known_false_positives = None at this time +action.escu.search_type = investigative +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["AWS Suspicious Provisioning Activities"] +action.escu.fields_required = ["City"] +action.escu.earliest_time_offset = 14400 +action.escu.latest_time_offset = 0 +description = This search retrieves all the activity from a specific city and will create a table containing the time, city, ARN, username, the type of user, the source IP address, the AWS region the activity was in, the API called, and whether or not the API call was successful. +disabled=true +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | search sourcetype=aws:cloudtrail | iplocation sourceIPAddress | search City=$City$ | spath output=user path=userIdentity.arn | spath output=awsUserName path=userIdentity.userName | spath output=userType path=userIdentity.type | rename sourceIPAddress as src_ip | table _time, City, user, userName, userType, src_ip, awsRegion, eventName, errorCode + +[ESCU - Malicious PowerShell Process - Encoded Command - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2016-09-18 action.escu.modification_date = 2018-12-03 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = The search looks for execution of schtasks.exe with parameters that indicate that a specific task "reset," whose name is associated with the Dragonfly threat actor--has been created or deleted. Schtasks.exe is a native Windows program that is used to schedule tasks on local or remote systems. Attackers often leverage this capability to schedule the execution of commands or establish persistence. -action.escu.how_to_implement = You must be ingesting endpoint data that tracks process activity, including parent-child relationships from your endpoints to populate the Endpoint data model in the Processes node. The command-line arguments are mapped to the "process" field in the Endpoint data model. +action.escu.eli5 = This search looks for PowerShell processes that are passing encoded commands on the command-line. The flags "-EncodedCommand" and "-enc" are two different possible flags that can be used to pass base64 encoded commands to PowerShell. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. +action.escu.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. action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Scheduled Task Name Used by Dragonfly Threat Actors - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Scheduled Task"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3"], "nist": ["PR.IP"]} -action.escu.known_false_positives = No known false positives +action.escu.full_search_name = ESCU - Malicious PowerShell Process - Encoded Command - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} +action.escu.known_false_positives = System administrators may use this option, but it's not common. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["DHS Report TA18-074A"] +action.escu.analytic_story = ["Malicious PowerShell"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Scheduled Task Name Used by Dragonfly Threat Actors +action.correlationsearch.label = Malicious PowerShell Process - Encoded Command action.notable = 1 action.notable.param.nes_fields = dest, user, process_name -action.notable.param.rule_description = This search looks for flags passed to schtasks.exe on the command line that indicate that a task--whose name is associated with the Dragonfly threat actor--has been created or deleted -action.notable.param.rule_title = Scheduled task used by Dragonfly threat actor detected on $dest$ +action.notable.param.rule_description = The system $dest$ executed a PowerShell process that has an encoded command on the command-line +action.notable.param.rule_title = PowerShell process with an encoded command detected on $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest action.risk.param._risk_object_type = system -action.risk.param._risk_score = 80 +action.risk.param._risk_score = 20 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest, process_name, process -alert.suppress.period = 28800s -cron_schedule = 0 * * * * -description = This search looks for flags passed to schtasks.exe on the command-line that indicate a task name associated with the Dragonfly threat actor was created or deleted. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m -disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=schtasks.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` | search (process=*delete* OR process=*create*) process=*reset* - -[ESCU - Prohibited Network Traffic Allowed - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2017-04-18 -action.escu.modification_date = 2017-09-11 -action.escu.asset_at_risk = Endpoint -action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = The search looks for traffic marked 'is_prohibited' in the Enterprise Security lookup table 'interesting_ports_lookup', and then determines if any network devices have an associated 'allow' action on that traffic by checking the Network_Traffic data model. -action.escu.how_to_implement = In order to properly run this search, Splunk needs to ingest data from firewalls or other network control devices that mediate the traffic allowed into an environment. This is necessary so that the search can identify an 'action' taken on the traffic of interest. The search requires the Network_Traffic data model be populated. -action.escu.data_models = ["Network_Traffic"] -action.escu.full_search_name = ESCU - Prohibited Network Traffic Allowed - Rule -action.escu.mappings = {"mitre_attack": ["Command and Control", "Commonly Used Port", "Exfiltration", "Exfiltration Over Alternative Protocol"], "kill_chain_phases": ["Delivery", "Command and Control"], "cis20": ["CIS 9", "CIS 12"], "nist": ["DE.AE", "PR.AC"]} -action.escu.known_false_positives = None identified -action.escu.search_type = detection -action.escu.providing_technologies = ["Palo Alto Firewall", "Bro", "Splunk Stream"] -action.escu.analytic_story = ["Command and Control", "Prohibited Traffic Allowed or Protocol Mismatch", "Ransomware"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Prohibited Network Traffic Allowed -action.notable = 1 -action.notable.param.nes_fields = src_ip, dest_ip -action.notable.param.rule_description = This search looks for network traffic defined by port and transport in the ES lookup table "lookup_interesting_ports", that is marked as prohibited, and yet has an 'allow' action in the Network_Traffic data model. This should help to identify areas where a network device is not properly configured. -action.notable.param.rule_title = Prohibited Network Traffic Allowed from $src_ip$ -action.notable.param.security_domain = network -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Backup Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get Update Logs For Endpoint\n - ESCU - Get User Information from Identity Table\n - ESCU - Get Vulnerability Logs For Endpoint\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Investigate Web Activity From Host\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = src_ip -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 40 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = dest_ip,src_ip +alert.suppress.fields = dest, user, process_name alert.suppress.period = 14400s cron_schedule = 0 * * * * -description = This search looks for network traffic defined by port and transport layer protocol in the Enterprise Security lookup table "lookup_interesting_ports", that is marked as prohibited, and has an associated 'allow' action in the Network_Traffic data model. This could be indicative of a misconfigured network device. +description = This search looks for PowerShell processes that have encoded the script within the command-line. Malware has been seen using this parameter, as it obfuscates the code and makes it relatively easy to pass a script on the command-line. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -7052,7 +6929,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Network_Traffic where All_Traffic.action = allowed by All_Traffic.src_ip All_Traffic.dest_ip All_Traffic.dest_port All_Traffic.action | lookup update=true interesting_ports_lookup dest_port as All_Traffic.dest_port OUTPUT app is_prohibited note transport | search is_prohibited=true | `ctime(firstTime)` | `ctime(lastTime)` | `drop_dm_object_name("All_Traffic")` +search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=powershell.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` | search process=*-EncodedCommand* OR process=*-enc* [ESCU - Monitor Email For Brand Abuse - Rule] action.escu = 0 @@ -7325,67 +7202,43 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Network_Traffic where All_Traffic.protocol="tcp" AND (All_Traffic.dest_port="23" OR All_Traffic.dest_port="143" OR All_Traffic.dest_port="110" OR (All_Traffic.dest_port="21" AND All_Traffic.user != "anonymous")) groupby All_Traffic.user All_Traffic.src All_Traffic.dest All_Traffic.dest_port | `ctime(firstTime)` | `ctime(lastTime)` | `drop_dm_object_name("All_Traffic")` -[ESCU - Get Web Session Information via session_id] +[ESCU - Suspicious Java Classes - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-10-08 -action.escu.modification_date = 2018-10-08 -action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = This search leverages data extracted from Stream:HTTP. You must configure the HTTP stream using the Splunk Stream App on your Splunk Stream deployment server. -action.escu.full_search_name = ESCU - Get Web Session Information via session_id -action.escu.known_false_positives = None at this time -action.escu.search_type = investigative -action.escu.providing_technologies = ["Splunk Stream"] -action.escu.analytic_story = ["Web Fraud Detection"] -action.escu.fields_required = ["session_id"] -action.escu.earliest_time_offset = 3600 -action.escu.latest_time_offset = 3600 -description = This search helps an analyst investigate a notable event to find out more about a specific web session. The search looks for a specific web session ID in the HTTP web traffic and outputs the URL and user agents, grouped by source IP address and HTTP status code. -disabled=true -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | search sourcetype=stream:http $session_id$ | stats values(url) values(http_user_agent) by src_ip status - -[ESCU - Processes created by netsh - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-01-04 -action.escu.modification_date = 2018-11-02 +action.escu.creation_date = 2018-12-06 +action.escu.modification_date = 2018-12-06 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU action.escu.confidence = medium -action.escu.eli5 = This search looks for all processes with the parent process "c:\Windows\System32\netsh.exe" and returns the process, the command line used to execute it, the host name, and the user context under which it ran. -action.escu.how_to_implement = To successfully implement this search, you must be ingesting logs with the process name, command-line arguments, and parent processes from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Processes created by netsh - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Command-Line Interface", "Persistence"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -action.escu.known_false_positives = It is unusual for netsh.exe to have any child processes in most environments. It makes sense to investigate the child process and verify whether the process spawned is legitimate. +action.escu.eli5 = The search leverages HTTP form data from typically POST events that can be captured with Splunk streams or similar wire data capture tools. The search looks for java classes like `processbuilder` and `runtime` are used to create a new process and execute commands inside java, and are synonymous with spawning a shell. There are very exceptional reasons to ever these classes in Java via an HTTP API and hence when seen are highly suspicious. Also, this is a common vectors leverage to exploit Apache Struts. +action.escu.how_to_implement = In order to properly run this search, Splunk needs to ingest data from your web-traffic appliances that serve or sit in the path of your Struts application servers. This can be accomplished by indexing data from a web proxy, or by using network traffic-analysis tools, such as Splunk Stream or Bro. +action.escu.full_search_name = ESCU - Suspicious Java Classes - Rule +action.escu.mappings = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Exploitation"], "cis20": ["CIS 7", "CIS 12"], "nist": ["DE.AE"]} +action.escu.known_false_positives = There are no known false positives. action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Netsh Abuse"] +action.escu.providing_technologies = ["Splunk Stream", "Bro", "Bluecoat", "Apache"] +action.escu.analytic_story = ["Apache Struts Vulnerability"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Processes created by netsh +action.correlationsearch.label = Suspicious Java Classes action.notable = 1 -action.notable.param.nes_fields = dest, process, parent_process -action.notable.param.rule_description = A process, $process$, is spawned by netsh.exe. It is highly unlikely for netsh to have any child processes. -action.notable.param.rule_title = Process spawned by netsh.exe detected on $dest$ -action.notable.param.security_domain = endpoint +action.notable.param.nes_fields = src, url, http_user_agent +action.notable.param.rule_description = The host $src$ with user agent $http_user_agent$ is sending web traffic to $url$, which contains suspicious Java classes. These classes may be indicative of remote code execution in Java frameworks, such as Apache Struts. +action.notable.param.rule_title = Suspicious Java Classes: Possible RCE against Struts or similar Java framework from $src$ +action.notable.param.security_domain = threat action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate Suspicious Strings in HTTP Header\n - ESCU - Investigate Web POSTs From src\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = dest +action.risk.param._risk_object = src action.risk.param._risk_object_type = system action.risk.param._risk_score = 50 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest, process -alert.suppress.period = 86400s +alert.suppress.fields = src, url, http_user_agent +alert.suppress.period = 3600s cron_schedule = 0 * * * * -description = This search looks for processes launching netsh.exe to execute various commands via the netsh command-line utility. Netsh.exe is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh can be used as a persistence proxy technique to execute a helper .dll when netsh.exe is executed. In this search, we are looking for processes spawned by netsh.exe that are executing commands via the command line. +description = This search looks for suspicious Java classes that are often used to exploit remote command execution in common Java frameworks, such as Apache Struts. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -7396,30 +7249,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count values(Processes.process) min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.parent_process="C:\Windows\System32\netsh.exe" by Processes.parent_process Processes.process_name Processes.user Processes.dest | `drop_dm_object_name("Processes")` | `ctime(firstTime)`|`ctime(lastTime)` - -[ESCU - Get Logon Rights Modifications For Endpoint] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2017-08-16 -action.escu.modification_date = 2017-09-12 -action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = To successfully implement this search you must be ingesting your Windows event logs -action.escu.full_search_name = ESCU - Get Logon Rights Modifications For Endpoint -action.escu.known_false_positives = None at this time -action.escu.search_type = investigative -action.escu.providing_technologies = ["Microsoft Windows"] -action.escu.analytic_story = ["Account Monitoring and Controls"] -action.escu.fields_required = ["dest"] -action.escu.earliest_time_offset = 86400 -action.escu.latest_time_offset = 86400 -description = This search allows you to retrieve any modifications to logon rights associated with a specific host. -disabled=true -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | search sourcetype=WinEventLog:Security (EventCode=4718 OR EventCode=4717) dest=$dest$ | rename user as "Account Modified" | table _time, dest, "Account Modified", Access_Right, signature +search = sourcetype="stream:http" http_method=POST http_content_length>1 | regex form_data="(?i)java\.lang\.(?:runtime|processbuilder)" | rename src_ip as src | stats count earliest(_time) as firstTime, latest(_time) as lastTime, values(url) as uri, values(status) as status, values(http_user_agent) as http_user_agent by src, dest | convert ctime(firstTime) ctime(lastTime) [ESCU - Add Prohibited Processes to Enterprise Security] action.escu = 0 @@ -7494,44 +7324,44 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` values(DNS.answer) as IPs min(_time) as firstTime from datamodel=Network_Resolution by DNS.src, DNS.query | `drop_dm_object_name("DNS")` | `ctime(firstTime)`| `brand_abuse_dns` -[ESCU - Suspicious File Write - Rule] +[ESCU - Remote Desktop Network Traffic - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-06-14 -action.escu.modification_date = 2018-11-14 +action.escu.creation_date = 2016-09-13 +action.escu.modification_date = 2017-09-15 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU -action.escu.confidence = high -action.escu.eli5 = This search looks at files being created or modified in the Endpoint file-system data model. The names of those files are checked against an included lookup file, which contains the names of files associated with malware or attack activity. The search returns any files with matching names, along with a note (also specified in the lookup file) that gives or points to more information about the files. -action.escu.how_to_implement = You must be ingesting data that records the filesystem activity from your hosts to populate the Endpoint file-system data model node. This is typically populated via endpoint detection-and-response products, such as Carbon Black, or via other endpoint data sources, such as Sysmon. The data used for this search is typically generated via logs that report file system reads and writes. In addition, this search leverages an included lookup file that contains the names of the files to watch for, as well as a note to communicate why that file name is being monitored. This lookup file can be edited to add or remove file the file names you want to monitor. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Suspicious File Write - Rule -action.escu.mappings = {"mitre_attack": [], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -action.escu.known_false_positives = It's possible for a legitimate file to be created with the same name as one noted in the lookup file. Filenames listed in the lookup file should be unique enough that collisions are rare. Looking at the location of the file and the process responsible for the activity can help determine whether or not the activity is legitimate. +action.escu.confidence = medium +action.escu.eli5 = This search finds systems that do not commonly communicate use remote desktop. It does this by filtering out all systems that have the "common_rdp_source" or "common_rdp_destination" category applied to that system. Categories are applied to systems using the Assets and Identity framework. +action.escu.how_to_implement = To successfully implement this search you need to identify systems that commonly originate remote desktop traffic and that commonly receive remote desktop traffic. You can use the included support search "Identify Systems Creating Remote Desktop Traffic" to identify systems that originate the traffic and the search "Identify Systems Receiving Remote Desktop Traffic" to identify systems that receive a lot of remote desktop traffic. After identifying these systems, you will need to add the "common_rdp_source" or "common_rdp_destination" category to that system depending on the usage, using the Enterprise Security Assets and Identities framework. This can be done by adding an entry in the assets.csv file located in SA-IdentityManagement/lookups. +action.escu.data_models = ["Network_Traffic"] +action.escu.full_search_name = ESCU - Remote Desktop Network Traffic - Rule +action.escu.mappings = {"mitre_attack": ["Lateral Movement", "Remote Desktop Protocol", "Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 9", "CIS 16"], "nist": ["DE.AE", "PR.AC", "PR.IP"]} +action.escu.known_false_positives = Remote Desktop may be used legitimately by users on the network. action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -action.escu.analytic_story = ["Hidden Cobra Malware"] +action.escu.providing_technologies = ["Bro", "Splunk Stream"] +action.escu.analytic_story = ["Lateral Movement", "SamSam Ransomware", "Hidden Cobra Malware"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Suspicious File Write +action.correlationsearch.label = Remote Desktop Network Traffic action.notable = 1 -action.notable.param.nes_fields = dest, file_name -action.notable.param.rule_description = A write to a filename associated with malicious activity detected on $dest$. -action.notable.param.rule_title = Suspicious File Write Detected on $dest$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = high +action.notable.param.nes_fields = dest, src +action.notable.param.rule_description = Remote Desktop Traffic detected between $src$ and $dest$. These two systems typically do not communicate with RDP +action.notable.param.rule_title = Uncommon Remote Desktop Network Traffic between $src$ and $dest$ +action.notable.param.security_domain = network +action.notable.param.severity = medium action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Outbound Emails to Hidden Cobra Threat Actors\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = dest +action.risk.param._risk_object = src action.risk.param._risk_object_type = system -action.risk.param._risk_score = 80 +action.risk.param._risk_score = 50 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest,file_name -alert.suppress.period = 14400s +alert.suppress.fields = dest,src +alert.suppress.period = 28800s cron_schedule = 0 * * * * -description = The search looks for files created with names that have been linked to malicious activity. +description = This search looks for network traffic on TCP/3389, the default port used by remote desktop. While remote desktop traffic is not uncommon on a network, it is usually associated with known hosts. This search allows for whitelisting both source and destination hosts to remove them from the output of the search so you can focus on the uncommon uses of remote desktop on your network. dispatch.earliest_time = -70m@m dispatch.latest_time = -10m@m disabled=true @@ -7542,7 +7372,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count values(Filesystem.action) as action values(Filesystem.file_path) as file_path min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem by Filesystem.file_name Filesystem.dest | `ctime(lastTime)` | `ctime(firstTime)` | `drop_dm_object_name(Filesystem)` +search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Network_Traffic where All_Traffic.dest_port=3389 AND All_Traffic.dest_category!=common_rdp_destination AND All_Traffic.src_category!=common_rdp_source by All_Traffic.src All_Traffic.dest All_Traffic.dest_port | `drop_dm_object_name("All_Traffic")` | `ctime(firstTime)`| `ctime(lastTime)` [ESCU - Create local admin accounts using net.exe - Rule] action.escu = 0 @@ -7616,55 +7446,6 @@ schedule_window = auto is_visible = false search = sourcetype=aws:cloudtrail `ec2ModificationAPIs` errorCode=success | spath output=arn userIdentity.arn | stats earliest(_time) as firstTime latest(_time) as lastTime by arn | outputlookup previously_seen_ec2_modifications_by_user | stats count -[ESCU - Detect new API calls from user roles - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-04-01 -action.escu.modification_date = 2018-04-16 -action.escu.asset_at_risk = AWS Instance -action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = The subsearch will execute first and return the user roles and names of the API calls completed within the last hour, where the type of user identity is `AssumedRole`. It then appends the historical data to those results in the lookup file. Next, it recalculates the `earliest` and `latest` fields for each user role, as well as the name of the API call, and returns only those roles and API calls that have first been seen in the past hour. This is combined with the main search to return the values of API calls, name of the user role, and the earliest and latest time of this activity. It is worth noting that the name of the role of a particular user is parsed as "userName" in the CloudTrail logs. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously seen API call per user roles in CloudTrail" support search once to create a history of previously seen user roles. -action.escu.full_search_name = ESCU - Detect new API calls from user roles - Rule -action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} -action.escu.known_false_positives = It is possible that there are legitimate user roles making new or infrequently used API calls in your infrastructure, causing the search to trigger. -action.escu.search_type = detection -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS User Monitoring"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Detect new API calls from user roles -action.notable = 1 -action.notable.param.nes_fields = user -action.notable.param.rule_description = A new API call made by $user$ has been detected. This API activity has either never been seen before or has not been seen within the last hour. -action.notable.param.rule_title = New API call by $user$ detected -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Investigate AWS User Activities by user field\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = user -action.risk.param._risk_object_type = user -action.risk.param._risk_score = 10 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = user -alert.suppress.period = 86400s -cron_schedule = 30 * * * * -description = This search detects new API calls that have either never been seen before or that have not been seen in the previous hour, where the identity type is `AssumedRole`. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m -disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = sourcetype=aws:cloudtrail eventType=AwsApiCall errorCode=success userIdentity.type=AssumedRole [search sourcetype=aws:cloudtrail eventType=AwsApiCall errorCode=success userIdentity.type=AssumedRole | stats earliest(_time) as earliest latest(_time) as latest by userName eventName | inputlookup append=t previously_seen_api_calls_from_user_roles | stats min(earliest) as earliest, max(latest) as latest by userName eventName | outputlookup previously_seen_api_calls_from_user_roles| eval newApiCallfromUserRole=if(earliest>=relative_time(now(), "-70m@m"), 1, 0) | where newApiCallfromUserRole=1 | `ctime(earliest)` | `ctime(latest)` | table eventName userName] |rename userName as user| stats values(eventName) earliest(_time) as earliest latest(_time) as latest by user | `ctime(earliest)` | `ctime(latest)` - [ESCU - Detection of tools built by NirSoft - Rule] action.escu = 0 action.escu.enabled = 1 @@ -7788,27 +7569,28 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=reg.exe by Processes.user Processes.process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` | search process=*save* (process=*HKLM\\sam* OR process=*HKLM\\system*) -[ESCU - Baseline of API Calls per User ARN] +[ESCU - Systems Ready for Spectre-Meltdown Windows Patch] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-04-09 -action.escu.modification_date = 2018-04-09 +action.escu.creation_date = 2018-01-08 +action.escu.modification_date = 2018-01-08 action.escu.channel = ESCU -action.escu.eli5 = This search returns all log events that are API calls, pulls out the ARN that initiated each call, and collects them in one-hour groupings. Next, it calculates the number of API calls made per ARN per hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points each ARN had. This table is then stored in a lookup file. -action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. -action.escu.full_search_name = ESCU - Baseline of API Calls per User ARN +action.escu.eli5 = This search looks to see if a registry key was created at `HKLM\Software\Microsoft\Windows\CurrentVersion\QualityCompat`. It will tell you when it was created and, if possible, what process created it. +action.escu.how_to_implement = You need to be ingesting logs with both the process name and command-line from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. +action.escu.data_models = ["Change_Analysis"] +action.escu.full_search_name = ESCU - Systems Ready for Spectre-Meltdown Windows Patch action.escu.known_false_positives = None at this time action.escu.search_type = support -action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS User Monitoring"] -description = This search establishes, on a per-hour basis, the average and the standard deviation of the number of API calls made by each user. Also recorded is the number of data points for each user. This table is then outputted to a lookup file to allow the detection search to operate quickly. -dispatch.earliest_time = -90d@d +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Spectre And Meltdown Vulnerabilities"] +description = Some AV applications can cause the Spectre/Meltdown patch for Windows not to install successfully. This registry key is supposed to be created by the AV engine when it has been patched to be able to handle the Windows patch. If this key has been written, the system can then be patched for Spectre and Meltdown. +dispatch.earliest_time = -1d@d dispatch.latest_time = -10m@m disabled=true realtime_schedule = 0 schedule_window = auto is_visible = false -search = sourcetype=aws:cloudtrail eventType=AwsApiCall | spath output=arn path=userIdentity.arn | bucket _time span=1h | stats count as apiCalls by _time, arn | stats count(apiCalls) as numDataPoints, latest(apiCalls) as latestCount, avg(apiCalls) as avgApiCalls, stdev(apiCalls) as stdevApiCalls by arn | table arn, latestCount, numDataPoints, avgApiCalls, stdevApiCalls | outputlookup api_call_by_user_baseline | stats count +search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Change_Analysis.All_Changes where All_Changes.object_category=registry AND (All_Changes.object_path="HKLM\Software\Microsoft\Windows\CurrentVersion\QualityCompat*") by All_Changes.dest, All_Changes.command, All_Changes.user, All_Changes.object, All_Changes.object_path | `ctime(lastTime)` | `ctime(firstTime)` | `drop_dm_object_name("All_Changes")` [ESCU - Get EC2 Launch Details] action.escu = 0 @@ -7883,6 +7665,29 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) values(Processes.process) as process max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=certutil.exe (Processes.process=*-addstore* AND Processes.process=*disallowed* ) by Processes.parent_process Processes.process_name Processes.user | `drop_dm_object_name("Processes")` | `ctime(firstTime)`|`ctime(lastTime)` +[ESCU - Get Backup Logs For Endpoint] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2017-08-24 +action.escu.modification_date = 2017-09-14 +action.escu.channel = ESCU +action.escu.eli5 = none +action.escu.how_to_implement = You must be ingesting your backup logs. +action.escu.full_search_name = ESCU - Get Backup Logs For Endpoint +action.escu.known_false_positives = None at this time +action.escu.search_type = contextual +action.escu.providing_technologies = ["Netbackup"] +action.escu.analytic_story = ["Ransomware", "SamSam Ransomware"] +action.escu.fields_required = ["dest"] +action.escu.earliest_time_offset = 604800 +action.escu.latest_time_offset = 0 +description = This search will tell you the backup status from your netbackup_logs of a specific endpoint for the last week. +disabled=true +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | search sourcetype="netbackup_logs" COMPUTERNAME=$dest$ | rename COMPUTERNAME as dest, MESSAGE as signature | table _time, dest, signature + [ESCU - Baseline of blocked outbound traffic from AWS] action.escu = 0 action.escu.enabled = 1 @@ -7895,7 +7700,7 @@ action.escu.full_search_name = ESCU - Baseline of blocked outbound traffic from action.escu.known_false_positives = None at this time action.escu.search_type = support action.escu.providing_technologies = ["AWS"] -action.escu.analytic_story = ["AWS Network ACL Activity", "Command and Control", "Suspicious AWS Traffic"] +action.escu.analytic_story = ["AWS Network ACL Activity", "Suspicious AWS Traffic", "Command and Control"] description = This search establishes, on a per-hour basis, the average and the standard deviation of the number of outbound connections blocked in your VPC flow logs by each source IP address (IP address of your EC2 instances). Also recorded is the number of data points for each source IP. This table outputs to a lookup file to allow the detection search to operate quickly. dispatch.earliest_time = -30d@d dispatch.latest_time = -10m@m @@ -7950,6 +7755,55 @@ schedule_window = auto is_visible = false search = | search sourcetype=aws:cloudtrail userIdentity.arn=$src_user$ | spath output=user path=userIdentity.arn | rename sourceIPAddress as src_ip | table _time, user, src_ip, awsRegion, eventName, errorCode, errorMessage +[ESCU - Detect New Open S3 buckets - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2018-07-25 +action.escu.modification_date = 2018-07-25 +action.escu.asset_at_risk = S3 Bucket +action.escu.channel = ESCU +action.escu.confidence = medium +action.escu.eli5 = This search queries CloudTrail logs for events with S3 bucket access controls given to the "All Users" group, which allows anyone in the world access to the resource. This search generates a table displaying the time when the bucket was made public, the permission of the S3 bucket, the bucket name, and the ARN of the user who created the bucket. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), and then configure your CloudTrail inputs. The threshold value should be tuned to your environment. +action.escu.full_search_name = ESCU - Detect New Open S3 buckets - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Initial Access", "Exfiltration"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 13"], "nist": ["PR.DS", "PR.AC", "DE.CM"]} +action.escu.known_false_positives = While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group. +action.escu.search_type = detection +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["Suspicious AWS S3 Activities"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Detect New Open S3 buckets +action.notable = 1 +action.notable.param.nes_fields = user +action.notable.param.rule_description = An open/public S3 bucket, $bucketName$, was created by $user$. +action.notable.param.rule_title = Public S3 bucket $bucketName$ created by $user$ +action.notable.param.security_domain = network +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - AWS S3 Bucket details via bucketName\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n - ESCU - Get All AWS Activity From IP Address\n - ESCU - Investigate AWS activities via region name\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = user +action.risk.param._risk_object_type = user +action.risk.param._risk_score = 70 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = user,bucketName +alert.suppress.period = 86400s +cron_schedule = 5 * * * * +description = This search looks for CloudTrail events where a user has created an open/public S3 bucket. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m +disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = sourcetype=aws:cloudtrail AllUsers eventName=PutBucketAcl | spath output=userIdentityArn path=userIdentity.arn | spath output=bucketName path=requestParameters.bucketName | spath output=aclControlList path=requestParameters.AccessControlPolicy.AccessControlList | spath input=aclControlList output=grantee path=Grant{} | mvexpand grantee | spath input=grantee | search Grantee.URI=*AllUsers | rename userIdentityArn as user| table _time, src,awsRegion Permission, Grantee.URI, bucketName, user + [ESCU - Get DNS traffic ratio] action.escu = 0 action.escu.enabled = 1 @@ -7963,7 +7817,7 @@ action.escu.full_search_name = ESCU - Get DNS traffic ratio action.escu.known_false_positives = None at this time action.escu.search_type = investigative action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Dynamic DNS", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Dynamic DNS", "Suspicious DNS Traffic", "Command and Control"] action.escu.fields_required = ["src_ip", "dest_ip"] action.escu.earliest_time_offset = 0 action.escu.latest_time_offset = 86400 @@ -8293,6 +8147,56 @@ schedule_window = auto is_visible = false search = sourcetype=WinEventLog:System EventCode=7036 | rex field=Message "The (?[\w\s-]*) service entered the (?\w*) state" | where action="running" | inputlookup append=t previously_seen_running_windows_services | multireport [| stats earliest(eval(coalesce(_time, firstTime))) as firstTime, latest(eval(coalesce(_time, lastTime))) as lastTime by serviceName | outputlookup previously_seen_running_windows_services | where fact=fiction] [| eventstats earliest(eval(coalesce(_time, firstTime))) as firstTime, latest(eval(coalesce(_time, lastTime))) as lastTime by serviceName | where firstTime >= relative_time(now(), "-60m@m") AND isnotnull(_time) | stats values(dest) as dest by _time, serviceName] | table _time, serviceName, dest +[ESCU - Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2016-09-18 +action.escu.modification_date = 2018-12-03 +action.escu.asset_at_risk = Endpoint +action.escu.channel = ESCU +action.escu.confidence = medium +action.escu.eli5 = This search looks for PowerShell processes that have a number of suspicious flags on the command-line. It is looking for flags are passing encoded commands on the command-line. The flags `-EncodedCommand` and `-enc` are two different possible flags that can be used to pass base64 encoded commands to PowerShell. The `*-Exec*` flag looks to see it the default execution policy of PowerShell is being overridden, while the `*-NonI*` flag tells the PowerShell process that this will be a noninteractive process, so the user doesn't know about the process. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. +action.escu.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. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} +action.escu.known_false_positives = Legitimate process can have this combination of command-line options, but it's not common. +action.escu.search_type = detection +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] +action.escu.analytic_story = ["Malicious PowerShell"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Malicious PowerShell Process - Multiple Suspicious Command-Line Arguments +action.notable = 1 +action.notable.param.nes_fields = dest, user, process, process_name +action.notable.param.rule_description = The system $dest$ executed a PowerShell that had an encoded command on the command-line, attempted to bypass local execution policy, and prevented the display of an interactive prompt to the user. +action.notable.param.rule_title = PowerShell process with multiple suspicious command-line arguments detected on $dest$ +action.notable.param.security_domain = endpoint +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 60 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest, process_name +alert.suppress.period = 14400s +cron_schedule = 50 * * * * +description = This search looks for PowerShell processes started with a base64 encoded command-line passed to it, with parameters to modify the execution policy for the process, and those that prevent the display of an interactive prompt to the user. This combination of command-line options is suspicious because it overrides the default PowerShell execution policy, attempts to hide itself from the user, and passes an encoded script to be run on the command-line. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m +disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=powershell.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)`| search (process=*-EncodedCommand* OR process=*-enc*) process=*-Exec* AND process=*-NonI* + [ESCU - Registry Keys Used For Persistence - Rule] action.escu = 0 action.escu.enabled = 1 @@ -8309,7 +8213,7 @@ action.escu.mappings = {"mitre_attack": ["Persistence", "Registry Run Keys / Sta action.escu.known_false_positives = There are many legitimate applications that must execute on system startup and will use these registry keys to accomplish that task. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Emotet Malware (TA18-201A)", "Suspicious Windows Registry Activities", "Windows Persistence Techniques", "Ransomware", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Ransomware", "Suspicious Windows Registry Activities", "Emotet Malware (TA18-201A)", "Windows Persistence Techniques", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Registry Keys Used For Persistence action.notable = 1 @@ -8343,45 +8247,45 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count values(Registry.registry_key_name) as registry_key_name values(Registry.registry_path) as registry_path min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry where (Registry.registry_path=*currentversion\\run* OR Registry.registry_path=*currentVersion\\Windows\\Appinit_Dlls* OR Registry.registry_path=CurrentVersion\\Winlogon\\Shell* OR Registry.registry_path=*CurrentVersion\\Winlogon\\Userinit* OR Registry.registry_path=*CurrentVersion\\Winlogon\\VmApplet* OR Registry.registry_path=*currentversion\\policies\\explorer\\run* OR Registry.registry_path=*currentversion\\runservices* OR Registry.registry_path=*\\CurrentControlSet\\Control\\Lsa\\* OR Registry.registry_path="*Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options*" OR Registry.registry_path=HKLM\\SOFTWARE\\Microsoft\\Netsh\\*) by Registry.dest , Registry.status, Registry.user | `ctime(lastTime)` | `ctime(firstTime)` | `drop_dm_object_name(Registry)` -[ESCU - Batch File Write to System32 - Rule] +[ESCU - SMB Traffic Spike - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2018-12-14 -action.escu.modification_date = 2018-12-14 +action.escu.creation_date = 2017-08-20 +action.escu.modification_date = 2017-09-10 action.escu.asset_at_risk = Endpoint action.escu.channel = ESCU -action.escu.confidence = high -action.escu.eli5 = This search looks at file modifications across your hosts, as well as for evidence of batch files being written to paths that include "system32." This activity is consistent with some SamSam attacks and is, in general, suspicious. -action.escu.how_to_implement = You must be ingesting data that records the file-system activity from your hosts to populate the Endpoint file-system data-model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Batch File Write to System32 - Rule -action.escu.mappings = {"mitre_attack": [], "kill_chain_phases": ["Delivery"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} -action.escu.known_false_positives = It is possible for this search to generate a notable event for a batch file write to a path that includes the string "system32", but is not the actual Windows system directory. As such, you should confirm the path of the batch file identified by the search. In addition, a false positive may be generated by an administrator copying a legitimate batch file in this directory tree. You should confirm that the activity is legitimate and modify the search to add exclusions, as necessary. +action.escu.confidence = medium +action.escu.eli5 = Server Message Block (SMB) traffic, a protocol used for Windows file sharing-activity, is often leveraged by attackers. One example of SMB abuse was the WannaCry ransomware, which leveraged a vulnerability in the SMB protocol to propagate to other systems. Attackers have also used SMB for lateral movement with a target environment and to test credentials against target systems. While SMB is highly prevalent in Windows environments, a spike in SMB traffic may still be indicative of this type of malicious activity. This search looks for a traffic spike in SMB traffic from a particular system. If such a spike is detected, you may want to investigate the source and analyze the cause of the abnormal traffic. +action.escu.how_to_implement = This search requires you to be ingesting your network traffic logs and populating the `Network_Traffic` data model. +action.escu.data_models = ["Network_Traffic"] +action.escu.full_search_name = ESCU - SMB Traffic Spike - Rule +action.escu.mappings = {"mitre_attack": ["Commonly Used Port"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 8"], "nist": ["DE.CM"]} +action.escu.known_false_positives = A file server may experience high-demand loads that could cause this analytic to trigger. action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] -action.escu.analytic_story = ["SamSam Ransomware"] +action.escu.providing_technologies = ["Bro", "Splunk Stream"] +action.escu.analytic_story = ["Ransomware", "Emotet Malware (TA18-201A)", "Hidden Cobra Malware", "DHS Report TA18-074A"] action.correlationsearch.enabled = 1 -action.correlationsearch.label = Batch File Write to System32 +action.correlationsearch.label = SMB Traffic Spike action.notable = 1 -action.notable.param.nes_fields = dest, file_name -action.notable.param.rule_description = A batch file was written to the system directory on $dest$. -action.notable.param.rule_title = Batch file write to system32 detected on $dest$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = high -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Backup Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get Update Logs For Endpoint\n - ESCU - Get User Information from Identity Table\n - ESCU - Get Vulnerability Logs For Endpoint\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Investigate Successful Remote Desktop Authentications\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.nes_fields = src +action.notable.param.rule_description = There was a spike in SMB traffic from $src$. +action.notable.param.rule_title = SMB Traffic Spike from $src$ +action.notable.param.security_domain = network +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 -action.risk.param._risk_object = dest +action.risk.param._risk_object = src action.risk.param._risk_object_type = system -action.risk.param._risk_score = 80 +action.risk.param._risk_score = 50 action.risk.param.verbose = 0 alert.digest_mode = 1 alert.suppress = 1 -alert.suppress.fields = dest,file_name -alert.suppress.period = 14400s +alert.suppress.fields = src +alert.suppress.period = 28800s cron_schedule = 0 * * * * -description = The search looks for a batch file (.bat) written to the Windows system directory tree. -dispatch.earliest_time = -70m@m +description = This search looks for spikes in the number of Server Message Block (SMB) traffic connections. +dispatch.earliest_time = -7d@d dispatch.latest_time = -10m@m disabled=true enableSched = 1 @@ -8391,7 +8295,7 @@ quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime values(Filesystem.dest) as dest values(Filesystem.file_name) as file_name values(Filesystem.user) as user from datamodel=Endpoint.Filesystem by Filesystem.file_path | `drop_dm_object_name(Filesystem)` | `ctime(lastTime)` | `ctime(firstTime)`| rex field=file_name "(?\.[^\.]+)$" | search file_path=*system32* AND file_extension=.bat +search = | tstats `summariesonly` count from datamodel=Network_Traffic where All_Traffic.dest_port=139 OR All_Traffic.dest_port=445 OR All_Traffic.app=smb by _time span=1h, All_Traffic.src | `drop_dm_object_name("All_Traffic")` | eventstats max(_time) as maxtime | stats count as num_data_samples max(eval(if(_time >= relative_time(maxtime, "-70m@m"), count, null))) as count avg(eval(if(_time upperBound AND num_data_samples >=50, 1, 0) | where isOutlier=1 | table src count [ESCU - AWS Investigate User Activities By AccessKeyId] action.escu = 0 @@ -8638,6 +8542,55 @@ schedule_window = auto is_visible = false search = sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational (process=net.exe OR process=sc.exe) cmdline="* stop *" | lookup security_services_lookup service as cmdline OUTPUTNEW category, description | search category=security | table _time, dest, user, parent_process, cmdline, description +[ESCU - WMI Permanent Event Subscription - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2018-10-23 +action.escu.modification_date = 2018-10-23 +action.escu.asset_at_risk = Endpoint +action.escu.channel = ESCU +action.escu.confidence = medium +action.escu.eli5 = Attackers are increasingly abusing Windows Management Infrastructure (WMI) for stealth, persistence, lateral movement, or just to leverage its functionality. This search looks for the creation of a WMI event subscription by watching for Windows event ID 5861. +action.escu.how_to_implement = To successfully implement this search, you must be ingesting the Windows WMI activity logs. This can be done by adding a stanza to inputs.conf on the system generating logs with a title of [WinEventLog://Microsoft-Windows-WMI-Activity/Operational]. +action.escu.full_search_name = ESCU - WMI Permanent Event Subscription - Rule +action.escu.mappings = {"mitre_attack": ["Execution", "Windows Management Instrumentation", "Persistence", "Windows Management Instrumentation Event Subscription"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 5"], "nist": ["PR.PT", "PR.AT", "PR.AC", "PR.IP"]} +action.escu.known_false_positives = Although unlikely, administrators may use event subscriptions for legitimate purposes. +action.escu.search_type = detection +action.escu.providing_technologies = ["Microsoft Windows"] +action.escu.analytic_story = ["Suspicious WMI Use"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = WMI Permanent Event Subscription +action.notable = 1 +action.notable.param.nes_fields = dest +action.notable.param.rule_description = This search looks for the creation of a permanent WMI event subscription via Windows event logs. +action.notable.param.rule_title = WMI Event Subscription Detected on $dest$ +action.notable.param.security_domain = endpoint +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n - ESCU - Get Sysmon WMI Activity for Host\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 70 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest +alert.suppress.period = 28800s +cron_schedule = 0 * * * * +description = This search looks for the creation of WMI permanent event subscriptions. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m +disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = sourcetype="wineventlog:microsoft-windows-wmi-activity/operational" EventCode=5861 Binding | rex field=Message "Consumer =\s+(?[^;|^$]+)" | search consumer!="NTEventLogEventConsumer=\"SCM Event Log Consumer\"" | stats count min(_time) as firstTime max(_time) as lastTime by ComputerName, consumer, Message | `ctime(firstTime)`| `ctime(lastTime)` | rename ComputerName as dest + [ESCU - Spike in File Writes - Rule] action.escu = 0 action.escu.enabled = 1 @@ -8704,7 +8657,7 @@ action.escu.mappings = {"mitre_attack": ["Execution", "Accessibility Features"], action.escu.known_false_positives = None identified action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Windows Privilege Escalation", "Unusual Processes"] +action.escu.analytic_story = ["Unusual Processes", "Windows Privilege Escalation"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Uncommon Processes On Endpoint action.notable = 1 @@ -8713,7 +8666,7 @@ action.notable.param.rule_description = Prohibited software $process_name$ has b action.notable.param.rule_title = Prohibited Software Detected On $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = high -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src @@ -8787,6 +8740,55 @@ schedule_window = auto is_visible = false search = (sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational OR tag=process) parent_process=*WmiPrvSE.exe | stats count min(_time) as firstTime max(_time) as lastTime by dest, user, parent_process, process, cmdline | `ctime(firstTime)`| `ctime(lastTime)` +[ESCU - EC2 Instance Modified With Previously Unseen User - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2018-04-09 +action.escu.modification_date = 2018-04-09 +action.escu.asset_at_risk = AWS Instance +action.escu.channel = ESCU +action.escu.confidence = medium +action.escu.eli5 = The subsearch returns the ARNs of all successful EC2 instance modifications within the last hour and then appends the historical data in the lookup file to those results. EC2 modification APIs are defined by the macro `ec2ModificationAPIs`. The search then recalculates the `firstTime` and `lastTime` field for each ARN and returns only those ARNs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance ID of those systems. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 Launches By User" support search once to create a history of previously seen ARNs. To add or remove APIs that modify an EC2 instance, edit the macro `ec2ModificationAPIs`. +action.escu.full_search_name = ESCU - EC2 Instance Modified With Previously Unseen User - Rule +action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +action.escu.known_false_positives = It's possible that a new user will start to modify EC2 instances when they haven't before for any number of reasons. Verify with the user that is modifying instances that this is the intended behavior. +action.escu.search_type = detection +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["Unusual AWS EC2 Modifications"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = EC2 Instance Modified With Previously Unseen User +action.notable = 1 +action.notable.param.nes_fields = user, dest +action.notable.param.rule_description = The EC2 instance $dest$ was modified by $user$. This user has never modified an EC2 instance before. +action.notable.param.rule_title = EC2 Instance Modified By Previously Unseen User $user$ +action.notable.param.security_domain = endpoint +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get EC2 Instance Details by instanceId\n - ESCU - Get Notable History\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - AWS Investigate User Activities By ARN\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 30 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = user, dest +alert.suppress.period = 14400s +cron_schedule = 0 * * * * +description = This search looks for EC2 instances being modified by users who have not previously modified them. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m +disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = sourcetype=aws:cloudtrail `ec2ModificationAPIs` [search sourcetype=aws:cloudtrail `ec2ModificationAPIs` errorCode=success | stats earliest(_time) as firstTime latest(_time) as lastTime by userIdentity.arn | rename userIdentity.arn as arn | inputlookup append=t previously_seen_ec2_modifications_by_user | stats min(firstTime) as firstTime, max(lastTime) as lastTime by arn | outputlookup previously_seen_ec2_modifications_by_user | eval newUser=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) | where newUser=1 | `ctime(firstTime)` | `ctime(lastTime)` | rename arn as userIdentity.arn | table userIdentity.arn] | spath output=dest responseElements.instancesSet.items{}.instanceId | spath output=user userIdentity.arn | table _time, user, dest + [ESCU - Remote Process Instantiation via WMI - Rule] action.escu = 0 action.escu.enabled = 1 @@ -8836,6 +8838,56 @@ schedule_window = auto is_visible = false search = (sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational OR tag=process) process=*wmic* cmdline="*/node*" cmdline="*process*" cmdline="*call*" cmdline="*create*" | stats count min(_time) as firstTime max(_time) as lastTime by dest, user, process, cmdline | `ctime(firstTime)`| `ctime(lastTime)` +[ESCU - Batch File Write to System32 - Rule] +action.escu = 0 +action.escu.enabled = 1 +action.escu.creation_date = 2018-12-14 +action.escu.modification_date = 2018-12-14 +action.escu.asset_at_risk = Endpoint +action.escu.channel = ESCU +action.escu.confidence = high +action.escu.eli5 = This search looks at file modifications across your hosts, as well as for evidence of batch files being written to paths that include "system32." This activity is consistent with some SamSam attacks and is, in general, suspicious. +action.escu.how_to_implement = You must be ingesting data that records the file-system activity from your hosts to populate the Endpoint file-system data-model node. If you are using Sysmon, you will need a Splunk Universal Forwarder on each endpoint from which you want to collect data. +action.escu.data_models = ["Endpoint"] +action.escu.full_search_name = ESCU - Batch File Write to System32 - Rule +action.escu.mappings = {"mitre_attack": [], "kill_chain_phases": ["Delivery"], "cis20": ["CIS 8"], "nist": ["PR.PT", "DE.CM"]} +action.escu.known_false_positives = It is possible for this search to generate a notable event for a batch file write to a path that includes the string "system32", but is not the actual Windows system directory. As such, you should confirm the path of the batch file identified by the search. In addition, a false positive may be generated by an administrator copying a legitimate batch file in this directory tree. You should confirm that the activity is legitimate and modify the search to add exclusions, as necessary. +action.escu.search_type = detection +action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon"] +action.escu.analytic_story = ["SamSam Ransomware"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = Batch File Write to System32 +action.notable = 1 +action.notable.param.nes_fields = dest, file_name +action.notable.param.rule_description = A batch file was written to the system directory on $dest$. +action.notable.param.rule_title = Batch file write to system32 detected on $dest$ +action.notable.param.security_domain = endpoint +action.notable.param.severity = high +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Backup Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get Update Logs For Endpoint\n - ESCU - Get User Information from Identity Table\n - ESCU - Get Vulnerability Logs For Endpoint\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Investigate Successful Remote Desktop Authentications\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 80 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest,file_name +alert.suppress.period = 14400s +cron_schedule = 0 * * * * +description = The search looks for a batch file (.bat) written to the Windows system directory tree. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m +disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 +realtime_schedule = 0 +schedule_window = auto +is_visible = false +search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime values(Filesystem.dest) as dest values(Filesystem.file_name) as file_name values(Filesystem.user) as user from datamodel=Endpoint.Filesystem by Filesystem.file_path | `drop_dm_object_name(Filesystem)` | `ctime(lastTime)` | `ctime(firstTime)`| rex field=file_name "(?\.[^\.]+)$" | search file_path=*system32* AND file_extension=.bat + [ESCU - Windows Updates Install Successes] action.escu = 0 action.escu.enabled = 1 @@ -8909,28 +8961,54 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process = *.doc.exe OR Processes.process = *.htm.exe OR Processes.process = *.html.exe OR Processes.process = *.txt.exe OR Processes.process = *.pdf.exe OR Processes.process = *.doc.exe by Processes.dest Processes.user Processes.process Processes.parent_process | `ctime(firstTime)` | `ctime(lastTime)` | `drop_dm_object_name(Processes)` -[ESCU - Get Parent Process Info] +[ESCU - EC2 Instance Started With Previously Unseen AMI - Rule] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2017-08-22 -action.escu.modification_date = 2017-09-10 +action.escu.creation_date = 2018-03-12 +action.escu.modification_date = 2018-03-12 +action.escu.asset_at_risk = AWS Instance action.escu.channel = ESCU -action.escu.eli5 = none -action.escu.how_to_implement = To successfully implement this search you must be ingesting endpoint data via Microsoft-Windows-Sysmon and extract the Image and Parent Image field. -action.escu.full_search_name = ESCU - Get Parent Process Info -action.escu.known_false_positives = None at this time -action.escu.search_type = investigative -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Orangeworm Attack Group", "Emotet Malware (TA18-201A)", "Credential Dumping", "Disabling Security Tools", "Suspicious Windows Registry Activities", "Windows Privilege Escalation", "Windows Persistence Techniques", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Collection and Staging", "Suspicious Command-Line Executions", "Ransomware", "Windows Service Abuse", "Netsh Abuse", "Windows Defense Evasion Tactics", "SamSam Ransomware", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] -action.escu.fields_required = ["process", "dest"] -action.escu.earliest_time_offset = 0 -action.escu.latest_time_offset = 86400 -description = This search queries the Application State data model to give you details about the parent process of a process running on a host which is under investigation. Enter the values of the process name in question and the dest_ip +action.escu.confidence = medium +action.escu.eli5 = The subsearch returns the AMI image ID of all successful EC2 instance launches within the last hour and then appends the historical data from the lookup file to those results. It then recalculates the earliest and latest seen time field for each AMI image ID and returns only those AMI image IDs that have first been seen in the past hour. This is combined with the main search to return the time, user, and instance id of those systems. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your CloudTrail inputs. This search works best when you run the "Previously Seen EC2 AMIs" support search once to create a history of previously seen AMIs. +action.escu.full_search_name = ESCU - EC2 Instance Started With Previously Unseen AMI - Rule +action.escu.mappings = {"cis20": ["CIS 1"], "nist": ["ID.AM"]} +action.escu.known_false_positives = After a new AMI is created, the first systems created with that AMI will cause this alert to fire. Verify that the AMI being used was created by a legitimate user. +action.escu.search_type = detection +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["AWS Cryptomining"] +action.correlationsearch.enabled = 1 +action.correlationsearch.label = EC2 Instance Started With Previously Unseen AMI +action.notable = 1 +action.notable.param.nes_fields = dest +action.notable.param.rule_description = The EC2 instance $dest$ was created with previously unused AMI $amiID$ +action.notable.param.rule_title = EC2 Instance Type $dest$ Created With New AMI +action.notable.param.security_domain = endpoint +action.notable.param.severity = medium +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get EC2 Launch Details\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n"} +action.notable.param.recommended_actions = escu_contextualize, escu_investigate +action.risk = 1 +action.risk.param._risk_object = dest +action.risk.param._risk_object_type = system +action.risk.param._risk_score = 30 +action.risk.param.verbose = 0 +alert.digest_mode = 1 +alert.suppress = 1 +alert.suppress.fields = dest +alert.suppress.period = 14400s +cron_schedule = 0 * * * * +description = This search looks for EC2 instances being created with previously unseen AMIs. +dispatch.earliest_time = -70m@m +dispatch.latest_time = -10m@m disabled=true +enableSched = 1 +counttype = number of events +relation = greater than +quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | search sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational process=$process$ dest=$dest$ | table parent_process parent_process_id +search = sourcetype=aws:cloudtrail eventName=RunInstances [search sourcetype=aws:cloudtrail eventName=RunInstances errorCode=success | stats earliest(_time) as earliest latest(_time) as latest by requestParameters.instancesSet.items{}.imageId | rename requestParameters.instancesSet.items{}.imageId as amiID | inputlookup append=t previously_seen_ec2_amis.csv | stats min(earliest) as earliest max(latest) as latest by amiID | outputlookup previously_seen_ec2_amis.csv | eval newAMI=if(earliest >= relative_time(now(), "-70m@m"), 1, 0) | convert ctime(earliest) ctime(latest) | where newAMI=1 | rename amiID as requestParameters.instancesSet.items{}.imageId | table requestParameters.instancesSet.items{}.imageId] | rename requestParameters.instanceType as instanceType, responseElements.instancesSet.items{}.instanceId as dest, userIdentity.arn as arn, requestParameters.instancesSet.items{}.imageId as amiID | table _time, arn, amiID, dest, instanceType [ESCU - DNSTwist Domain Names] action.escu = 0 @@ -8970,7 +9048,7 @@ action.escu.mappings = {"mitre_attack": ["Command and Control", "Exfiltration", action.escu.known_false_positives = It's possible that normal DNS traffic will exhibit this behavior. If an alert is generated, please investigate and validate as appropriate. The threshold can also be modified to better suit your environment. action.escu.search_type = detection action.escu.providing_technologies = ["Splunk Stream", "Bro"] -action.escu.analytic_story = ["Command and Control", "Data Protection", "Suspicious DNS Traffic"] +action.escu.analytic_story = ["Suspicious DNS Traffic", "Command and Control", "Data Protection"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Detection of DNS Tunnels action.notable = 1 @@ -8979,7 +9057,7 @@ action.notable.param.rule_description = Potential DNS tunnel detected from $src$ action.notable.param.rule_title = DNS tunnel detected on $src$ action.notable.param.security_domain = network action.notable.param.severity = low -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get DNS traffic ratio\n - ESCU - Get Process responsible for the DNS traffic\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get DNS Server History for a host\n - ESCU - Get Process responsible for the DNS traffic\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = src @@ -9004,55 +9082,27 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` dc("DNS.query") as count from datamodel=Network_Resolution where nodename=DNS "DNS.message_type"="QUERY" NOT (`cim_corporate_web_domain_search("DNS.query")`) NOT "DNS.query"="*.in-addr.arpa" NOT ("DNS.src_category"="svc_infra_dns" OR "DNS.src_category"="svc_infra_webproxy" OR "DNS.src_category"="svc_infra_email*" ) by "DNS.src","DNS.query" | rename "DNS.src" as src "DNS.query" as message | eval length=len(message) | stats sum(length) as length by src | append [ tstats `summariesonly` dc("DNS.answer") as count from datamodel=Network_Resolution where nodename=DNS "DNS.message_type"="QUERY" NOT (`cim_corporate_web_domain_search("DNS.query")`) NOT "DNS.query"="*.in-addr.arpa" NOT ("DNS.src_category"="svc_infra_dns" OR "DNS.src_category"="svc_infra_webproxy" OR "DNS.src_category"="svc_infra_email*" ) by "DNS.src","DNS.answer" | rename "DNS.src" as src "DNS.answer" as message | eval message=if(message=="unknown","", message) | eval length=len(message) | stats sum(length) as length by src ] | stats sum(length) as length by src | where length > 10000 -[ESCU - Malicious PowerShell Process - Encoded Command - Rule] +[ESCU - Baseline of API Calls per User ARN] action.escu = 0 action.escu.enabled = 1 -action.escu.creation_date = 2016-09-18 -action.escu.modification_date = 2018-12-03 -action.escu.asset_at_risk = Endpoint +action.escu.creation_date = 2018-04-09 +action.escu.modification_date = 2018-04-09 action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = This search looks for PowerShell processes that are passing encoded commands on the command-line. The flags "-EncodedCommand" and "-enc" are two different possible flags that can be used to pass base64 encoded commands to PowerShell. This search will return the host, the user the process ran under, the process and it's command-line arguments, the number of times it's seen this process, and the first and last times it saw this process. -action.escu.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. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Malicious PowerShell Process - Encoded Command - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "PowerShell", "Scripting"], "kill_chain_phases": ["Command and Control", "Actions on Objectives"], "cis20": ["CIS 3", "CIS 7", "CIS 8"], "nist": ["PR.PT", "DE.CM", "PR.IP"]} -action.escu.known_false_positives = System administrators may use this option, but it's not common. -action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Malicious PowerShell"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Malicious PowerShell Process - Encoded Command -action.notable = 1 -action.notable.param.nes_fields = dest, user, process_name -action.notable.param.rule_description = The system $dest$ executed a PowerShell process that has an encoded command on the command-line -action.notable.param.rule_title = PowerShell process with an encoded command detected on $dest$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Process Info\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 20 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = dest, user, process_name -alert.suppress.period = 14400s -cron_schedule = 0 * * * * -description = This search looks for PowerShell processes that have encoded the script within the command-line. Malware has been seen using this parameter, as it obfuscates the code and makes it relatively easy to pass a script on the command-line. -dispatch.earliest_time = -70m@m +action.escu.eli5 = This search returns all log events that are API calls, pulls out the ARN that initiated each call, and collects them in one-hour groupings. Next, it calculates the number of API calls made per ARN per hour. For each ARN, it calculates the average and standard deviation of this count on a per-hour basis. It also includes the number of data points each ARN had. This table is then stored in a lookup file. +action.escu.how_to_implement = You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS version (4.4.0 or later), then configure your CloudTrail inputs. +action.escu.full_search_name = ESCU - Baseline of API Calls per User ARN +action.escu.known_false_positives = None at this time +action.escu.search_type = support +action.escu.providing_technologies = ["AWS"] +action.escu.analytic_story = ["AWS User Monitoring"] +description = This search establishes, on a per-hour basis, the average and the standard deviation of the number of API calls made by each user. Also recorded is the number of data points for each user. This table is then outputted to a lookup file to allow the detection search to operate quickly. +dispatch.earliest_time = -90d@d dispatch.latest_time = -10m@m disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 realtime_schedule = 0 schedule_window = auto is_visible = false -search = | tstats `summariesonly` count values(Processes.process) as process values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=powershell.exe by Processes.user Processes.process_name Processes.parent_process_name Processes.dest | `drop_dm_object_name(Processes)` | `ctime(firstTime)`| `ctime(lastTime)` | search process=*-EncodedCommand* OR process=*-enc* +search = sourcetype=aws:cloudtrail eventType=AwsApiCall | spath output=arn path=userIdentity.arn | bucket _time span=1h | stats count as apiCalls by _time, arn | stats count(apiCalls) as numDataPoints, latest(apiCalls) as latestCount, avg(apiCalls) as avgApiCalls, stdev(apiCalls) as stdevApiCalls by arn | table arn, latestCount, numDataPoints, avgApiCalls, stdevApiCalls | outputlookup api_call_by_user_baseline | stats count [ESCU - Unusually Long Command Line - Rule] action.escu = 0 @@ -9068,7 +9118,7 @@ action.escu.mappings = {"mitre_attack": ["Execution"], "kill_chain_phases": ["Ac action.escu.known_false_positives = Some legitimate applications start with long command-lines. action.escu.search_type = detection action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Unusual Processes", "Suspicious Command-Line Executions", "Ransomware"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Ransomware", "Unusual Processes", "Suspicious Command-Line Executions"] action.correlationsearch.enabled = 1 action.correlationsearch.label = Unusually Long Command Line action.notable = 1 @@ -9077,7 +9127,7 @@ action.notable.param.rule_description = An unusually long command-line $cmdline$ action.notable.param.rule_title = Unusually Long Command-Line on $dest$ action.notable.param.security_domain = endpoint action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Backup Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get Update Logs For Endpoint\n - ESCU - Get User Information from Identity Table\n - ESCU - Get Vulnerability Logs For Endpoint\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Get Process Information For Port Activity\n - ESCU - Investigate Web Activity From Host\n"} +action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n - ESCU - Investigate Web Activity From Host\n"} action.notable.param.recommended_actions = escu_contextualize, escu_investigate action.risk = 1 action.risk.param._risk_object = dest @@ -9237,7 +9287,7 @@ action.escu.full_search_name = ESCU - Get Risk Modifiers For Endpoint action.escu.known_false_positives = None at this time action.escu.search_type = contextual action.escu.providing_technologies = ["Splunk Enterprise Security"] -action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "JBoss Vulnerability", "Orangeworm Attack Group", "Monitor for Unauthorized Software", "ColdRoot MacOS RAT", "Command and Control", "Router & Infrastructure Security", "Emotet Malware (TA18-201A)", "Credential Dumping", "Data Protection", "ColdRoot MacOS RAT", "Brand Monitoring", "Disabling Security Tools", "Spectre And Meltdown Vulnerabilities", "Suspicious Windows Registry Activities", "Windows Privilege Escalation", "Windows Persistence Techniques", "Asset Tracking", "Hidden Cobra Malware", "Windows File Extension and Association Abuse", "Use of Cleartext Protocols", "Account Monitoring and Controls", "DNS Amplification Attacks", "Unusual Processes", "SQL Injection", "Dynamic DNS", "Collection and Staging", "Prohibited Traffic Allowed or Protocol Mismatch", "Splunk Enterprise Vulnerability", "Ransomware", "Windows Service Abuse", "Netsh Abuse", "Monitor Backup Solution", "Splunk Enterprise Vulnerability CVE-2018-11409", "SamSam Ransomware", "Host Redirection", "DHS Report TA18-074A", "Suspicious MSHTA Activity", "Malicious PowerShell", "Lateral Movement", "Windows Log Manipulation", "Monitor for Updates", "Suspicious DNS Traffic", "Apache Struts Vulnerability", "Suspicious WMI Use", "Suspicious Emails"] +action.escu.analytic_story = ["Possible Backdoor Activity Associated With MUDCARP Espionage Campaigns", "Monitor Backup Solution", "Ransomware", "Apache Struts Vulnerability", "Netsh Abuse", "Collection and Staging", "JBoss Vulnerability", "Orangeworm Attack Group", "Use of Cleartext Protocols", "Host Redirection", "Dynamic DNS", "Suspicious Windows Registry Activities", "Credential Dumping", "Monitor for Unauthorized Software", "Brand Monitoring", "Splunk Enterprise Vulnerability CVE-2018-11409", "Malicious PowerShell", "Splunk Enterprise Vulnerability", "Lateral Movement", "Emotet Malware (TA18-201A)", "Suspicious Emails", "SamSam Ransomware", "Spectre And Meltdown Vulnerabilities", "Disabling Security Tools", "Suspicious WMI Use", "Suspicious DNS Traffic", "Unusual Processes", "Router & Infrastructure Security", "Monitor for Updates", "Prohibited Traffic Allowed or Protocol Mismatch", "Windows Privilege Escalation", "SQL Injection", "Windows Service Abuse", "ColdRoot MacOS RAT", "Command and Control", "ColdRoot MacOS RAT", "Windows File Extension and Association Abuse", "DNS Amplification Attacks", "Account Monitoring and Controls", "Windows Persistence Techniques", "Hidden Cobra Malware", "Data Protection", "Asset Tracking", "Windows Log Manipulation", "DHS Report TA18-074A", "Suspicious MSHTA Activity"] action.escu.fields_required = ["dest"] action.escu.earliest_time_offset = 604800 action.escu.latest_time_offset = 0 @@ -9348,56 +9398,6 @@ schedule_window = auto is_visible = false search = | tstats `summariesonly` sum(All_Traffic.bytes_in) as bytes_in from datamodel=Network_Traffic where All_Traffic.dest_category=email_server by All_Traffic.src_ip _time span=1d | `drop_dm_object_name("All_Traffic")` | eventstats avg(bytes_in) as avg_bytes_in stdev(bytes_in) as stdev_bytes_in | eventstats count as num_data_samples avg(eval(if(_time < relative_time(now(), "@d"), bytes_in, null))) as per_source_avg_bytes_in stdev(eval(if(_time < relative_time(now(), "@d"), bytes_in, null))) as per_source_stdev_bytes_in by src_ip | eval minimum_data_samples = 4, deviation_threshold = 3 | where num_data_samples >= minimum_data_samples AND bytes_in > (avg_bytes_in + (deviation_threshold * stdev_bytes_in)) AND bytes_in > (per_source_avg_bytes_in + (deviation_threshold * per_source_stdev_bytes_in)) AND _time >= relative_time(now(), "@d") | eval num_standard_deviations_away_from_server_average = round(abs(bytes_in - avg_bytes_in) / stdev_bytes_in, 2), num_standard_deviations_away_from_client_average = round(abs(bytes_in - per_source_avg_bytes_in) / per_source_stdev_bytes_in, 2) | table src_ip, _time, bytes_in, avg_bytes_in, per_source_avg_bytes_in, num_standard_deviations_away_from_server_average, num_standard_deviations_away_from_client_average -[ESCU - Execution of File With Spaces Before Extension - Rule] -action.escu = 0 -action.escu.enabled = 1 -action.escu.creation_date = 2018-01-26 -action.escu.modification_date = 2018-01-26 -action.escu.asset_at_risk = Endpoint -action.escu.channel = ESCU -action.escu.confidence = medium -action.escu.eli5 = This search uses the endpoint data model to look for process names with at least five spaces between the file name and its extension. -action.escu.how_to_implement = To successfully implement this search, you must be ingesting data that records process activity from your hosts to populate the endpoint data model in the processes node. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. -action.escu.data_models = ["Endpoint"] -action.escu.full_search_name = ESCU - Execution of File With Spaces Before Extension - Rule -action.escu.mappings = {"mitre_attack": ["Execution", "Persistence", "Change Default File Association"], "kill_chain_phases": ["Actions on Objectives"], "cis20": ["CIS 3", "CIS 8"], "nist": ["DE.CM", "PR.PT", "PR.IP"]} -action.escu.known_false_positives = None identified. -action.escu.search_type = detection -action.escu.providing_technologies = ["Carbon Black Response", "CrowdStrike Falcon", "Sysmon", "Tanium", "Ziften"] -action.escu.analytic_story = ["Windows File Extension and Association Abuse"] -action.correlationsearch.enabled = 1 -action.correlationsearch.label = Execution of File With Spaces Before Extension -action.notable = 1 -action.notable.param.nes_fields = dest -action.notable.param.rule_description = The system $dest$ executed a file with spaces before its extension. -action.notable.param.rule_title = Process $process$ with spaces before extension Launched on $dest$ -action.notable.param.security_domain = endpoint -action.notable.param.severity = medium -action.notable.param.next_steps = {"version": 1, "data": "Recommended following steps:\n\n1. [[action|escu_contextualize]]: Based on ESCU context gathering recommendations:\n - ESCU - Get Authentication Logs For Endpoint\n - ESCU - Get Notable History\n - ESCU - Get Notable Info\n - ESCU - Get Risk Modifiers For Endpoint\n - ESCU - Get Risk Modifiers For User\n - ESCU - Get User Information from Identity Table\n\n2. [[action|escu_investigate]]: Based on ESCU investigate recommendations:\n - ESCU - Get Parent Process Info\n - ESCU - Get Process Info\n"} -action.notable.param.recommended_actions = escu_contextualize, escu_investigate -action.risk = 1 -action.risk.param._risk_object = dest -action.risk.param._risk_object_type = system -action.risk.param._risk_score = 60 -action.risk.param.verbose = 0 -alert.digest_mode = 1 -alert.suppress = 1 -alert.suppress.fields = dest,process -alert.suppress.period = 28800s -cron_schedule = 0 * * * * -description = This search looks for processes launched from files with at least five spaces in the name before the extension. This is typically done to obfuscate the file extension by pushing it outside of the default view. -dispatch.earliest_time = -70m@m -dispatch.latest_time = -10m@m -disabled=true -enableSched = 1 -counttype = number of events -relation = greater than -quantity = 0 -realtime_schedule = 0 -schedule_window = auto -is_visible = false -search = | tstats `summariesonly` count values(Processes.process_path) as process_path min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process = "* .*" by Processes.dest Processes.user Processes.process Processes.process_name | `ctime(firstTime)`| `ctime(lastTime)` | `drop_dm_object_name(Processes)` - #################################################################### [escu-metrics-usage]