|
| 1 | +[metadata] |
| 2 | +creation_date = "2022/05/10" |
| 3 | +maturity = "production" |
| 4 | +updated_date = "2022/05/11" |
| 5 | + |
| 6 | +[rule] |
| 7 | +author = ["Elastic"] |
| 8 | +description = """ |
| 9 | +Identifies the execution of a binary by root in Linux shared memory directories: (/dev/shm/, /run/shm/, /var/run/, |
| 10 | +/var/lock/). This activity is to be considered highly abnormal and should be investigated. Threat actors have placed |
| 11 | +executables used for persistence on high-uptime servers in these directories as system backdoors. |
| 12 | +""" |
| 13 | +false_positives = [ |
| 14 | + """ |
| 15 | + Directories /dev/shm and /run/shm are temporary file storage directories in Linux. They are intended to appear as a |
| 16 | + mounted file system, but uses virtual memory instead of a persistent storage device and thus are used for mounting |
| 17 | + file systems in legitimate purposes. |
| 18 | + """, |
| 19 | +] |
| 20 | +from = "now-9m" |
| 21 | +index = ["logs-endpoint.events.*"] |
| 22 | +language = "eql" |
| 23 | +license = "Elastic License v2" |
| 24 | +name = "Binary Executed from Shared Memory Directory" |
| 25 | +references = [ |
| 26 | + "https://linuxsecurity.com/features/fileless-malware-on-linux", |
| 27 | + "https://twitter.com/GossiTheDog/status/1522964028284411907", |
| 28 | +] |
| 29 | +risk_score = 73 |
| 30 | +rule_id = "3f3f9fe2-d095-11ec-95dc-f661ea17fbce" |
| 31 | +severity = "high" |
| 32 | +tags = ["Elastic", "Host", "Linux", "Threat Detection", "Execution", "BPFDoor"] |
| 33 | +timestamp_override = "event.ingested" |
| 34 | +type = "eql" |
| 35 | + |
| 36 | +query = ''' |
| 37 | +process where event.type == "start" and |
| 38 | + event.action == "exec" and user.name == "root" and |
| 39 | + process.executable : ( |
| 40 | + "/dev/shm/*", |
| 41 | + "/run/shm/*", |
| 42 | + "/var/run/*", |
| 43 | + "/var/lock/*" |
| 44 | + ) |
| 45 | +''' |
| 46 | + |
| 47 | + |
| 48 | +[[rule.threat]] |
| 49 | +framework = "MITRE ATT&CK" |
| 50 | +[[rule.threat.technique]] |
| 51 | +id = "T1059" |
| 52 | +name = "Command and Scripting Interpreter" |
| 53 | +reference = "https://attack.mitre.org/techniques/T1059/" |
| 54 | + |
| 55 | + |
| 56 | +[rule.threat.tactic] |
| 57 | +id = "TA0002" |
| 58 | +name = "Execution" |
| 59 | +reference = "https://attack.mitre.org/tactics/TA0002/" |
| 60 | + |
0 commit comments