FortiSIEM Rules

Linux: Hidden Files and Directories Created

Rule ID

PH_Rule_TH_Linux_12

Default Status

Enabled

Description

Detects hidden files or folders in common writable directories. Users can mark specific files as hidden simply by putting a "." as the first character in the file or folder name. Adversaries can use this to their advantage to hide files and folders on the system for persistence and defense evasion. This requires process monitoring via FortiSIEM Linux agent.

Severity

7

Category

Security

MITRE ATT&CK® Tactics

Defense Evasion

Defense Evasion consists of techniques that adversaries use to avoid detection throughout their compromise. Techniques used for defense evasion include uninstalling/disabling security software or obfuscating/encrypting data and scripts. Adversaries also leverage and abuse trusted processes to hide and masquerade their malware. Other tactics’ techniques are cross-listed here when those techniques include the added benefit of subverting defenses.

https://attack.mitre.org/tactics/TA0005

MITRE ATT&CK® Techniques


T1564.001

Hide Artifacts: Hidden Files and Directories

Adversaries may set files and directories to be hidden to evade detection mechanisms. These files don't show up when a user browses the file system with a GUI or when using normal commands on the command line. Adversaries can use this to their advantage to hide files and folders anywhere on the system and evading a typical user or system analysis that does not incorporate investigation of hidden files.

https://attack.mitre.org/techniques/T1564/001

Impacts

Server

Data Source

Linux Process Monitoring via FortiSIEM Agent

Detection

Correlation

Remediation Guidance

No remediation guidance specified

Time Window

If the following pattern or patterns match an ingested event within the given time window in seconds, trigger an incident.

300 seconds

Trigger Conditions

If the following defined pattern/s occur within a 300 second time window.

SYSCALL AND PATH

Global Constraint

This defines how two or more distinct events are related in a time-series based action. e.g. An event occurs followed by another event if the source IP, user, and messageId are the same

SYSCALL.hostName = PATH.hostName AND SYSCALL.msgId = PATH.msgId

SubPattern Definitions

SubPattern Name: SYSCALL

This is the named definition of the event query, this is important if multiple subpatterns are defined to distinguish them.

SubPattern Query

This is the query logic that matches incoming events

eventType IN ("LINUX_PROCESS_EXEC","LINUX_Auditd_SYSCALL")  AND  procName NOT IN ("ls","find")

Group by Attributes

This defines how matching events are aggregated, only events with the same matching attribute values are grouped into one unique incident ID

hostName,userId,user,procName,msgId

Aggregate Constraint

This is most typically a numerical constraint that defines when the rule should trigger an incident

COUNT(*) >= 1
Operator Rank: 0 Operator Type: AND

This operator defines the logic condition relating to the prior event subpattern clause and the following event subpattern clause

SubPattern Name: PATH

This is the named definition of the event query, this is important if multiple subpatterns are defined to distinguish them.

SubPattern Query

This is the query logic that matches incoming events

eventType = "LINUX_Auditd_PATH"  AND  objType = "CREATE"  AND  osObjName REGEXP "^\.[^\/]+|\/\.[^\/]+"

Group by Attributes

This defines how matching events are aggregated, only events with the same matching attribute values are grouped into one unique incident ID

hostName,objType,osObjName,msgId

Aggregate Constraint

This is most typically a numerical constraint that defines when the rule should trigger an incident

COUNT(*) >= 1

Incident Attribute Mapping

This section defines which fields in matching raw events should be mapped to the incident attributes in the resulting incident.

The available raw event attributes to map are limited to the group by attributes and the aggregate event constraint fields for each subpattern

 hostName=SYSCALL.hostName,
userId=SYSCALL.userId,
user=SYSCALL.user,
procName=SYSCALL.procName,
msgId=SYSCALL.msgId,
osObjName=PATH.osObjName,
objType=PATH.objType