This hunt targets adversaries executing the Trickbot MailSearcher module to harvest email metadata and identify potential targets for phishing campaigns within the organization. Proactively hunting for this behavior in Azure Sentinel is critical because early detection of this reconnaissance activity allows security teams to isolate compromised endpoints before Trickbot escalates to credential theft or lateral movement phases.
rule MALW_mailsercher_trickbot_module :
Trojan
{
meta:
author = "Marc Salinas @Bondey_m"
description = " Detects mailsearcher module from Trickbot Trojan"
strings:
$str_mails_01 = "mailsearcher"
$str_mails_02 = "handler"
$str_mails_03 = "conf"
$str_mails_04 = "ctl"
$str_mails_05 = "SetConf"
$str_mails_06 = "file"
$str_mails_07 = "needinfo"
$str_mails_08 = "mailconf"
condition:
all of ($str_mails_*)
}
This YARA rule can be deployed in the following contexts:
This rule contains 8 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the “Detects mailsearcher module from Trickbot Trojan” rule in an enterprise environment, along with suggested filters or exclusions:
Scenario: Microsoft Outlook Add-in Deployment
mailsearcher.dll (or similar) into the Outlook program directory (C:\Program Files\Microsoft Office\root\Office16) to scan incoming messages for phishing links before they reach the user’s inbox.msiexec.exe or setup.exe and the file path resides within standard Office installation directories (C:\Program Files\Microsoft Office*).Scenario: Scheduled Archive Indexing Job
MailSearcher.exe. This tool scans the local OST/PST files of shared mailboxes to index metadata for compliance reporting. The job runs under the context of a dedicated service account (e.g., svc-mail-index) rather than an interactive user session.MailSearcher.exe and the User Account matches known service accounts (e.g., names starting with svc-, domain\service_) or the command line arguments include specific flags like /scheduled or /compliance.Scenario: Endpoint Protection Heuristic Scanning