Jump to content
  • Entries

    16114
  • Comments

    7952
  • Views

    863542635

Contributors to this blog

  • HireHackking 16114

About this blog

Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.

0x00 前言本文將要介紹Zimbra版本探測的多種方法,通過Python實現自動化,記錄開發細節,開源代碼。

0x01 簡介本文將要介紹以下內容:

實現思路

實現細節

開源代碼

0x02 實現思路查看Zimbra版本的方法有很多,各有優缺點,具體方法如下:

1.通過Web管理頁面通過瀏覽器訪問7071管理頁面,在主頁面會顯示當前Zimbra版本

例如我的測試環境顯示為:

Zimbra Version: 9.0.0_GA_4273.NETWORK

通過該方法獲得的版本為準確版本

2.通過執行命令微信截图_20230303155211.png

2.png

注:

Zimbra補丁更新可參考:

https://wiki.zimbra.com/wiki/Zimbra_Releases/9.0.0/patch_installation

3.通過Zimbra SOAP API默認配置下,zimbraSoapExposeVersion屬性為FLASE,查詢命令:

微信截图_20230303155456.png返回結果:

3.png需要將zimbraSoapExposeVersion屬性設置為TRUE後,可以通過Zimbra SOAP API獲得版本,修改屬性的命令為:

4.png發送的SOAP格式示例:

5.png默認配置下的返回結果:

6.png

4.通過imap協議7.png

5.通過imap over ssl協議8.png

6.通過特定url 9.png

0x03 實現細節綜合以上探測方法,為了適應多種環境,在程序實現上選取了通過imap協議、通過imap over ssl協議和通過特定url三種方法實現

1.通過imap協議完整示例代碼:

10.png 11.png

2.通過imap over ssl協議需要將ip轉為hostname作為參數,示例代碼:

12.png

完整示例代碼:

13.png 14.png

存在部分環境無法將ip轉為hostname,導致報錯:[Errno 11004] host not found,所以在程序判斷邏輯上優先使用imap協議

3.通過特定url完整示例代碼:

15.png 16.png

0x04 開源代碼完整的實現代碼已上傳至github,地址如下:

https://github.com/3gstudent/Homework-of-Python/blob/master/Zimbra_GetVersion.py

代碼首先嘗試通過特定url獲得版本信息,再通過imap協議讀取版本信息,如果失敗,最後通過imap over ssl協議讀取版本信息

0x05 小結本文介紹了Zimbra版本探測的多種方法,比較優缺點,選取有效的方法並通過Python實現自動化,記錄開發細節,開源代碼,作為一個很好的學習示例。