Ransomware Detection Rates by modern EDRs
TL;DR: EDRs still suck at detecting malicious PowerShell scripts. Sources see github.com/cailllev/VT2
Intro
My project implemented a test framework to boot up a VM, execute a malicious PowerShell script, measure the impact of the script and reset the VM for the next run.
Method
- Select and develop malicious script types -> account access removal, data destruction, data encryption, data theft and service stop.
- Select and develop bypass strategies -> rename variables, escape strings, in-memory (IEX), encoded command (enc), file handles and random delays.
- Build a framework to boot a VM, execute and measure the impact of the script, and reset the VM.
- Execute tests and note results.
- start (or reset) the VM
- check if the service (to run the tests) exists
- create a clean snapshot (only required once)
- write the next config to test
- monitor for a new test run
- execute the test runner, write true to is-running.txt
- execute the chosen test
- check the impact, write the result to res.txt, write false to is-running.txt
- monitor is-running.txt, get the results when is-running.txt contains false
Results
The columns display the tested scripts (1). The rows display the bypass strategies (2). The numbers indicate how many EDRs blocked the attack, out of 4 tested EDRs.
| Script > V Strategy |
Account Access Removal |
Data De struction |
Data De- struction Minimal |
Data En- cryption |
Data En- cryption BadWare |
Data Theft |
Service Stop |
|---|---|---|---|---|---|---|---|
| original script |
0 | 0 | 0 | 1 | 2 | 1 | 2 |
| renaming variables |
0 | 0 | 0 | 1 | 2 | 0 | 2 |
| string escaping |
0 | 0 | 0 | 1 | 2 | 0 | 2 |
| in-memory loader |
0 | 0 | 0 | 0 | 1 | 0 | 1 |
| encoded command |
0 | 0 | 0 | 1 | nA | 1 | 2 |
| open file handles |
0 | 0 | 0 | 1 | 2 | 0 | 2 |
| random delays |
0 | 0 | 0 | 1 | 2 | 0 | 2 |
Conclusion
Jugding maliciousness for an unknown PowerShell script is nearly impossible. Neiter static nor runtime detections protect systems from silly things happening.