Skip to content

Commit

Permalink
Add events and extra tags to relevant event-based queries
Browse files Browse the repository at this point in the history
  • Loading branch information
tstromberg committed Sep 24, 2024
1 parent d6b17a0 commit 6aab8fd
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 99 deletions.
2 changes: 1 addition & 1 deletion detection/c2/unexpected-talker-events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- references:
-- * https://attack.mitre.org/techniques/T1071/ (C&C, Application Layer Protocol)
--
-- tags: transient state net extra
-- tags: transient state net extra events
-- interval: 601
-- platform: posix
SELECT
Expand Down
2 changes: 1 addition & 1 deletion detection/discovery/unexpected-netutil-calls-linux.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- refs:
-- * https://attack.mitre.org/techniques/T1016/ (System Network Configuration Discovery)
--
-- tags: transient process state often
-- tags: transient process state often extra events
-- platform: linux
-- interval: 300
SELECT
Expand Down
2 changes: 1 addition & 1 deletion detection/discovery/unexpected-netutil-calls-macos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- refs:
-- * https://attack.mitre.org/techniques/T1016/ (System Network Configuration Discovery)
--
-- tags: transient process state often
-- tags: transient process state often extra events
-- platform: darwin
-- interval: 600
SELECT
Expand Down
2 changes: 1 addition & 1 deletion detection/evasion/hidden-cwd-events-linux.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-- references:
-- * https://attack.mitre.org/techniques/T1564/001/ (Hide Artifacts: Hidden Files and Directories)
--
-- tags: transient extra
-- tags: transient extra events
-- platform: linux
-- interval: 600
SELECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
--
-- interval: 900
-- platform: darwin
-- tags: filesystem events
-- tags: filesystem events extra
SELECT
s.identifier AS s_id,
s.authority AS s_auth,
Expand Down
3 changes: 3 additions & 0 deletions detection/execution/unexpected-chmod-exec-event-linux.sql
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ WHERE
AND syscall = "execve"
AND (
cmdline LIKE '%chmod% 7%'
OR cmdline LIKE '%chmod 5%'
OR cmdline LIKE '%chmod 1%'
OR cmdline LIKE '%chmod +%x'
OR cmdline LIKE '%chmod% +rwx%'
OR cmdline LIKE '%chmod% +x%'
OR cmdline LIKE '%chmod% u+x%'
Expand Down
2 changes: 1 addition & 1 deletion detection/execution/unexpected-execdir-events-linux.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
--
-- interval: 300
-- platform: linux
-- tags: process events
-- tags: process events extra
SELECT -- Child
pe.path AS p0_path,
REGEX_MATCH (pe.path, '.*/(.*)', 1) AS p0_name,
Expand Down
2 changes: 1 addition & 1 deletion detection/execution/unexpected-fetcher-parent-events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- refs:
-- * https://attack.mitre.org/techniques/T1105/ (Ingress Tool Transfer)
--
-- tags: transient process state often
-- tags: transient process state often extra events
-- platform: posix
-- interval: 450
SELECT
Expand Down
79 changes: 0 additions & 79 deletions detection/execution/unexpected-file-made-executable.sql

This file was deleted.

2 changes: 1 addition & 1 deletion detection/execution/unexpected-osascript-calls.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
--
-- interval: 300
-- platform: darwin
-- tags: process events
-- tags: process events extra
SELECT
-- Child
pe.path AS p0_path,
Expand Down
2 changes: 1 addition & 1 deletion detection/execution/unexpected-root-signer-macos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- platform: darwin
-- interval: 900
-- tags: transient seldom process state
-- tags: transient seldom events extra
-- Canonical example of including process parents from process_events
SELECT
f.directory AS dir,
Expand Down
3 changes: 2 additions & 1 deletion detection/execution/unexpected-sysutils-linux.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
-- Unexpected calls to sysctl (event-based)
-- Unexpected calls to system utilities (event-based)
--
-- refs:
-- * https://attack.mitre.org/techniques/T1497/001/ (Virtualization/Sandbox Evasion: System Checks)
--
-- platform: linux
-- interval: 600
-- tags: events extra
SELECT -- Child
pe.path AS p0_path,
pe.time AS p0_time,
Expand Down
1 change: 1 addition & 0 deletions detection/execution/unexpected-sysutils-macos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
--
-- platform: darwin
-- interval: 900
-- tags: events extra
SELECT
REGEX_MATCH (pe.path, '.*/(.*)', 1) || ',' || MIN(pe.euid, 500) || ',' || REGEX_MATCH (COALESCE(p1.path, pe1.path), '.*/(.*)', 1) || ',' || REGEX_MATCH (
COALESCE(p1_p2.path, pe1_p2.path, pe1_pe2.path),
Expand Down
2 changes: 1 addition & 1 deletion detection/execution/unexpected-xattr-calls-macos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
--
-- interval: 300
-- platform: darwin
-- tags: process events
-- tags: process events extra
SELECT
-- Child
pe.path AS p0_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-- * https://attack.mitre.org/techniques/T1059/ (Command and Scripting Interpreter)
-- * https://attack.mitre.org/techniques/T1204/002/ (User Execution: Malicious File)
--
-- tags: process events
-- tags: process events extra
-- interval: 300
-- platform: posix
SELECT
Expand Down
1 change: 1 addition & 0 deletions detection/privesc/setxid-cmdline-overflow-attempt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
--
-- platform: posix
-- interval: 300
-- tags: events
SELECT
file.mode AS p0_binary_mode,
pe.cmdline_size AS p0_cmd_size,
Expand Down
2 changes: 1 addition & 1 deletion incident_response/disk_events_macos.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Retrieves disk image (DMG) events
--
-- tags: postmortem
-- tags: postmortem events
-- platform: darwin
SELECT
*
Expand Down
1 change: 1 addition & 0 deletions incident_response/es_process_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- Dump a list of process execution events from EndpointSecurity
--
-- platform: darwin
-- tags: events extra
SELECT
*
FROM
Expand Down
2 changes: 1 addition & 1 deletion incident_response/file_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Return the list of watched file events (must be configured)
--
-- tags: postmortem
-- tags: postmortem events
-- platform: posix
-- interval: 900
SELECT
Expand Down
2 changes: 1 addition & 1 deletion incident_response/hardware_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Return hardware events
--
-- tags: postmortem
-- tags: postmortem events
-- platform: posix
SELECT
*
Expand Down
1 change: 1 addition & 0 deletions incident_response/process_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
--
-- interval: 600
-- platform: posix
-- tags: events extra
SELECT
pe.*,
-- pe.cwd is often blank
Expand Down
2 changes: 1 addition & 1 deletion incident_response/seccomp_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Return the list of seccomp events
--
-- tags: postmortem
-- tags: postmortem events
-- platform: linux
SELECT
*
Expand Down
2 changes: 1 addition & 1 deletion incident_response/selinux_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Return the list of SELinux events
--
-- tags: postmortem
-- tags: postmortem events
-- platform: linux
SELECT
*
Expand Down
2 changes: 1 addition & 1 deletion incident_response/socket_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Return the list of socket events
--
-- tags: postmortem
-- tags: postmortem events extra
-- platform: posix
-- interval: 600
SELECT
Expand Down
2 changes: 1 addition & 1 deletion incident_response/syslog_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Return the list of syslog events
--
-- tags: postmortem
-- tags: postmortem events
-- platform: linux
SELECT
*
Expand Down
2 changes: 1 addition & 1 deletion incident_response/user_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Return the list of audit user events
--
-- tags: postmortem
-- tags: postmortem events
-- platform: linux
SELECT
*
Expand Down

0 comments on commit 6aab8fd

Please sign in to comment.