Elastic medium stable kql

Shell Evaluated Curl Downloaded Content

Detects a shell that downloads content with curl and passes it to eval, either directly or through a variable assignment. Downloading a script and evaluating it in memory avoids writing the payload to disk and is commonly used by macOS loaders, adware and infostealer stagers to retrieve and run their next stage.

View Source

Detection Logic

event.category:process and host.os.type:macos and event.type:start and event.action:exec and
process.name:(bash or dash or sh or zsh or ksh) and process.args:"-c" and
process.command_line:(*=$\(curl*eval* or *eval*$\(curl* or *=`curl*eval* or *eval*`curl*) and
not process.Ext.effective_parent.executable:(
  "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon" or
  "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService" or
  "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM"
) and
not (process.parent.code_signature.trusted:true and process.parent.code_signature.team_id:(
  UBF8T346G9 or VDXQ22DGB9 or Q6L2SF6YDW or 2DC432GLL2 or
  483DWKW443 or 5NZ4Q7NXJ4 or PZT9BJUAA5 or 5Y6N3AJ54S
))

Field Validations

Loading…

Comments (0)

Loading comments...