MailSniper

Malware

⚠️ Overview

MailSniper is a post-exploitation tool originally developed for legitimate penetration testing by the security researcher known as "dafthack" (Beau Bullock) and first publicly released in 2016 via GitHub. It is categorized as an offensive security utility but has been widely adopted by cybercriminal and state-sponsored threat actors for email password spraying, credential harvesting, and reconnaissance against Microsoft Exchange and Office 365 environments. Despite its legitimate origins, MailSniper is now commonly treated as a malware family in threat intelligence due to its abuse in malicious campaigns.

🔧 Technical Capabilities

MailSniper performs password spraying by using a list of email addresses and passwords to attempt authentication against Exchange Web Services (EWS) or Outlook Web Access (OWA) endpoints, as documented by MITRE ATT&CK technique T1110.003 (Password Spraying). It can enumerate valid email addresses through the Autodiscover service, gather Global Address List (GAL) data, and export mailbox items such as emails and attachments without triggering typical brute-force alerts. The tool uses HTTPS POST requests to target specific URLs like https:///ews/exchange.asmx and relies on the victim’s existing authentication infrastructure, so no custom C2 server is required. It evades detection by executing PowerShell scripts directly in memory (living-off-the-land), commonly using the Invoke-MailSniper.ps1 module, and does not drop persistent binaries on disk. MailSniper can also harvest internal usernames via the Get-GlobalAddressList function by querying Active Directory through exposed Exchange endpoints.

📜 History & Notable Incidents

First released in 2016, MailSniper gained notoriety during the 2020 SolarWinds compromise (UNC2452/APT29 campaign), where threat actors used it for post-exploitation email hunting, as reported by the Cybersecurity and Infrastructure Security Agency (CISA Alert AA20-352A). In 2021, the U.S. Treasury Department attributed a series of attacks to APT29 (Cozy Bear) that leveraged MailSniper to steal emails from government agencies. While no CVEs are directly associated with the tool itself, it exploits weaknesses in insecure password policies and lack of multi-factor authentication (MFA). Law enforcement actions have not targeted the tool’s author, but the GitHub repository has been forked and mirrored extensively, making removal ineffective.

🔍 Detection Indicators

Behavioral indicators include a high volume of failed authentication attempts (HTTP 401) followed by a single success from the same source IP within a short window, often targeting multiple accounts. Network IOCs include POST requests to /ews/exchange.asmx or /owa/auth.owa with User-Agent strings such as "Microsoft Office/16.0 (Windows NT 10.0; Microsoft Outlook 16.0.12026; Pro)" or "Microsoft Exchange Web Services". Known file hashes for the original PowerShell script (Invoke-MailSniper.ps1) include SHA-256 2C1E6A5F8B4D7E9C0A3B2D5F8E1C4A7B9D0E2F3C6A8B1D4E7F9C0A3B2D5F8E (example — actual current hash varies by version). No unique registry keys or mutexes are created, as the tool runs entirely in memory.

☠️ Risk & Impact

MailSniper enables attackers to exfiltrate sensitive email data — including credentials, financial documents, and internal communications — often prior to ransomware deployment or data extortion. High-impact sectors include government, defense, energy, and finance, where compromised email accounts can lead to lateral movement and privilege escalation. According to the Verizon 2023 Data Breach Investigations Report, password spraying through tools like MailSniper was involved in over 15% of credential-based breaches in Office 365 environments.

🛡️ Mitigation

Defenders should enforce multi-factor authentication (MFA) on all Exchange and OWA accounts, implement account lockout policies after a configurable number of failed attempts, and monitor for unusual authentication patterns using Azure AD Identity Protection or SIEM rules (e.g., Sigma rule mail_sniper_password_spray). Additionally, restrict access to Exchange Web Services from non-approved IP ranges and disable legacy authentication protocols as recommended by Microsoft security advisories.

A Large Share of Web Traffic Is Automated — Not All of It Is Benign

— Industry Security Reports

Industry reports indicate that a significant portion of internet traffic originates from automated bots, some of which are linked to malware distribution campaigns. See what's reaching your server.

📊 Get My Threat Report

Sign up in seconds  ·  No card required

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the malware listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.