MITRE D3FENDdefensive technique
D3-SCA System Call Analysis
- Tactic
- Detect
Definition
Analyzing system calls to determine whether a process is exhibiting unauthorized behavior.
How it works
How it works
System calls are APIs between a user application and the operating system [1].
By analyzing a process's use of these APIs, it is, in some cases, possible to ascertain whether a program is exhibiting unauthorized behavior, including trying to escalate its privileges.
Gathering System Calls
A common method to capture system calls is to use kernel APIs to hook [2] a process's system call invocations.
The Linux system call `ptrace` tracks other system calls in a process and allows their alteration; this is made use of by GDB. `strace` utilizes `ptrace` and will print to stdout each system call invoked. Other applications record this data in local or remote databases.
The log entry for each system call, which may reference additional information such as the date and time, and the process tree for the process which made the system call, is relayed, in real time or post-facto, to an analysis module which consults a catalog or model to determine whether the distribution matches a known-good or known-bad pattern.
Analysis
System calls are analyzed with a variety of methods. Some analytics look for specific sequences of instructions, others may apply statistical methods to identify abnormal behavior. Sequences of instructions can be abstracted into conceptually higher order user activities, for example:
• An attacker executes many system calls in a short period of time, with several sequences which could be used to escalate privileges.
• Getting the contents from a URL, writing to a new file, and then executing the same file.
• A ransomware program which either uses a loop or creates many threads to: read a specified file, encrypt its contents, create an output file with a similar name to the original file, and delete the unencrypted original.
Considerations
• Duplicative or extraneous system calls may be added to malware to defeat analytics.
• Malware could replace API hooking instructions to allow system calls to be made without being monitored.
• A model built from a training set of system calls and related data may not be updated fast enough to detect new threats.
[1] Syscalls
[2] Hooking
Related
Counters · MITRE ATT&CK (58)
- T0895 Autorun Image technique
- T0894 System Binary Proxy Execution technique
- T1218.013 Mavinject sub-technique
- T0834 Native API technique
- T0888 Remote System Information Discovery technique
- T0846 Remote System Discovery technique
- T0852 Screen Capture technique
- T0863 User Execution technique
- T1074.001 Local Data Staging sub-technique
- T1497.003 Time Based Checks sub-technique
- T1518.001 Security Software Discovery sub-technique
- T1134.004 Parent PID Spoofing sub-technique
- T1555.003 Credentials from Web Browsers sub-technique
- T1555 Credentials from Password Stores technique
- T1036.005 Match Legitimate Resource Name or Location sub-technique
- T1548 Abuse Elevation Control Mechanism technique
- T1548.002 Bypass User Account Control sub-technique
- T1548.004 Elevated Execution with Prompt sub-technique
- T1546.009 AppCert DLLs sub-technique
- T1546.010 AppInit DLLs sub-technique
- T1218.001 Compiled HTML File sub-technique
- T1218.002 Control Panel sub-technique
- T1218.003 CMSTP sub-technique
- T1218.005 Mshta sub-technique
- T1218.011 Rundll32 sub-technique
- T1546 Event Triggered Execution technique
- T1055.001 Dynamic-link Library Injection sub-technique
- T1055.003 Thread Execution Hijacking sub-technique
- T1055.004 Asynchronous Procedure Call sub-technique
- T1055.005 Thread Local Storage sub-technique
Child of · MITRE D3FEND (1)
- D3-PA Process Analysis defensive technique
Referenced by MITRE D3FEND · child of (1)
- D3-FCA File Creation Analysis defensive technique
References
- https://car.mitre.org/analytics/CAR-2020-05-001/ CAR-2020-05-001: MiniDump of LSASS
- https://car.mitre.org/analytics/CAR-2021-05-011/ CAR-2021-05-011: Create Remote Thread into LSASS
- https://car.mitre.org/analytics/CAR-2019-08-001/ CAR-2019-08-001: Credential Dumping via Windows Task Manager
- https://car.mitre.org/analytics/CAR-2013-10-002/ CAR-2013-10-002: DLL Injection via Load Library
- https://patents.google.com/patent/US20190180036A1/en?oq=US-2019180036-A1 Deterministic method for detecting and blocking of exploits on interpreted code
- https://patents.google.com/patent/US20180032728A1/en?oq=US20180032728-A1 Hardware-assisted system and method for detecting and analyzing system calls made to an operting system kernel
- https://patents.google.com/patent/US20190205530A1 Malware detection in event loops
- https://patents.google.com/patent/US20190138715A1/ Post sandbox methods and systems for detecting and blocking zero-day exploits via api call validation