LoFP LoFP / false positives should be very limited as this is strict to metasploit behavior.

Techniques

Sample rules

Powershell Load Module in Meterpreter

Description

The following analytic utilizes PowerShell Script Block Logging (EventCode=4104) to identify suspicious PowerShell execution. Script Block Logging captures the command sent to PowerShell, the full command to be executed. Upon enabling, logs will output to Windows event logs. Dependent upon volume, enable on critical endpoints or all.

This analytic identifies “MSF.Powershell”,“MSF.Powershell.Meterpreter”,“MSF.Powershell.Meterpreter.Kiwi”,“MSF.Powershell.Meterpreter.Transport” being used. This behavior is related to when a Meterpreter session is started and the operator runs load_kiwi. During triage, review parallel processes using an EDR product or 4688 events. It will be important to understand the timeline of events around this activity. Review the entire logged PowerShell script block.

Detection logic

`powershell` EventCode=4104 ScriptBlockText IN ("*MSF.Powershell*","*MSF.Powershell.Meterpreter*","*MSF.Powershell.Meterpreter.Kiwi*","*MSF.Powershell.Meterpreter.Transport*") 
| stats count min(_time) as firstTime max(_time) as lastTime by EventCode ScriptBlockText Computer user_id 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `powershell_load_module_in_meterpreter_filter`