MITRE D3FENDdefensive technique
D3-PCSV Process Code Segment Verification
- Tactic
- Detect
Definition
Comparing the "text" or "code" memory segments to a source of truth.
How it works
How it works
A process code segment is an executable portion of computer memory allocated to a particular process. Process Code Segment Verification implements verification to compare a process code segment to some expected value.
Verification logic
Verification can occur during application startup, or continuously during execution. The logic which verifies the process code may be separate in a third-party process, embedded in the application itself at compile time, or dynamically linked at runtime.
System of record
Examples of systems of record:
• On-disk application binary files or checksums
• Remotely stored binary data or checksums
• Embedded binary data or checksums
Post Verification Actions
If the verification function determines a process code segment may have been altered, a capability may invoke Eviction techniques as Process Termination to end the current process, or Executable Blacklisting to prevent the executable from launching in the future.
Considerations
False positives
False positives commonly occur in the case that the layout of code in the process segment is legitimately modified:
• Operating system features or third-party security software may modify the layout of process code, for example in the defensive technique Segment Address Offset Randomization, or in the case that a module is rebased. In both of these cases, the alteration occurs before the code is fully loaded into memory, and it would be possible to avoid the false positive by securely feeding this constant offset and any relocation data into the verification logic.
• Process code segments may be written to modify themselves or other process code segments; however, this goes against widely-accepted current practices in software development.
False negatives
False negatives can occur via alteration of the verification logic or source of truth, or insufficient verification logic.
• Verification techniques which are executed only locally may be defeated by altering the local verification logic.
• Verification that is run only on a recurring basis could be evaded if the malicious alteration is completed before verification is run.
• Verification that requests an operation to be performed on a subset of the code segment could be evaded by performing that operation on a copy of the relevant bytes of the code segment.
• Verification based on a system of record that can be altered may fail if that system of record is modifiable by a malicious user.
Related
Counters · MITRE ATT&CK (13)
- T0890 Exploitation for Privilege Escalation technique
- T0820 Exploitation for Evasion technique
- T0866 Exploitation of Remote Services technique
- T0874 Hooking technique
- T1056.004 Credential API Hooking sub-technique
- T1055.012 Process Hollowing sub-technique
- T1203 Exploitation for Client Execution technique
- T1210 Exploitation of Remote Services technique
- T1211 Exploitation for Stealth technique
- T1212 Exploitation for Credential Access technique
- T1055 Process Injection technique
- T1056 Input Capture technique
- T1068 Exploitation for Privilege Escalation technique
Child of · MITRE D3FEND (1)
- D3-PA Process Analysis defensive technique
References
- https://patents.google.com/patent/US20150052603A1 Anti-tamper system with self-adjusting guards
- https://patents.google.com/patent/US7287166B1/en?oq=US-7287166-B1 Guards for application in software tamperproofing
- https://patents.google.com/patent/US20190018958A1/en?oq=US20190018958-A1 System and method for detecting malware injected into memory of a computing device
- https://patents.google.com/patent/US20190018962A1/en?oq=15648887 System and method for validating in-memory integrity of executable files to identify malicious activity
- https://patents.google.com/patent/US9262600B2/en?oq=US9262600B2 Tamper proof mutating software
- https://patents.google.com/patent/US9104864B2/en?oq=US-9104864-B2 Threat detection through the accumulated detection of threat characteristics