type.inbound
// attachment with .scpt extension (compiled AppleScript)
and any(attachments,
.file_extension == "scpt"
// double extension pattern: common document extensions followed by .scpt
and regex.icontains(.file_name,
'\.(doc|docx|pdf|xls|xlsx|ppt|pptx|txt|rtf)\.scpt$'
)
// ensure it's actually a binary/script file, not just renamed
// compiled AppleScript files are binary and have minimum size
and (.file_type == "unknown" or .file_type == "exe")
// compiled .scpt files are binary, should have reasonable size
and .size > 1000
)
// negate highly trusted sender domains unless they fail DMARC authentication
and (
(
sender.email.domain.root_domain in $high_trust_sender_root_domains
and not headers.auth_summary.dmarc.pass
)
or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
Playground
Test against your own EMLs or sample data.