top of page
作家相片Samuel

Nmap NSE Category vulns Script:samba-vuln-cve-2012-1182 檢查是否易受Samba堆溢出漏洞CVE-2012-1182的影響

已更新:8月6日


Nmap Script摘要


檢查目標機器是否易受 Samba 堆溢出漏洞 CVE-2012-1182 的影響。


Samba 版本 3.6.3 及以前的所有版本受到一個漏洞的影響,該漏洞允許從匿名連接以 "root" 用戶身份遠程執行代碼。


CVE-2012-1182 標記了多個位於基於 PIDL 的自動生成代碼中的堆溢出漏洞。該檢查腳本基於 ZDI 標記為 ZDI-CAN-1503 的 PoC。漏洞位於 ndr_pull_lsa_SidArray 函數中,攻擊者可以控制 num_sids,導致分配的內存不足,從而導致堆緩衝區溢出和遠程代碼執行的可能性。


腳本構建惡意數據包並進行 SAMR GetAliasMembership 調用,從而觸發漏洞。在易受攻擊的系統上,連接會被中斷,結果是“在 5 次嘗試之後未能接收到字節”。在打過補丁的系統上,Samba 會拋出錯誤,結果是“MSRPC 調用返回了一個錯誤(數據包類型)”。


參考資料:


Nmap Script參數


smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername

查看smbauth庫的文檔。

randomseed, smbbasic, smbport, smbsign

查看smb庫的文檔。

vulns.short, vulns.showall

查看vulns庫的文檔。


Nmap Script範例


nmap --script=samba-vuln-cve-2012-1182  -p 139 <target>

Nmap Script輸出

PORT    STATE SERVICE
139/tcp open  netbios-ssn

Host script results:
| samba-vuln-cve-2012-1182:
|   VULNERABLE:
|   SAMBA remote heap overflow
|     State: VULNERABLE
|     IDs:  CVE:CVE-2012-1182
|     Risk factor: HIGH  CVSSv2: 10.0 (HIGH) (AV:N/AC:L/Au:N/C:C/I:C/A:C)
|     Description:
|       Samba versions 3.6.3 and all versions previous to this are affected by
|       a vulnerability that allows remote code execution as the "root" user
|       from an anonymous connection.
|
|     Disclosure date: 2012-03-15
|     References:
|       http://www.samba.org/samba/security/CVE-2012-1182
|_      http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1182

Nmap Script作者:

Aleksandar Nikolic

License: Same as Nmap--See https://nmap.org/book/man-legal.html


Nmap
Nmap

 

延伸閱讀

3 次查看

Comentarios


bottom of page