* **TypeCompress**: ~~If the CAB is compressed, the trick to open it within an object file to trigger the INF write will fail~~ False, I managed to achieve the same result with a MSZIP compressed sample
* [OPTIONAL] This value seems to not be checked by MS Word. Anyway, to have a correct CAB, the **csum** value should be recalculated. Luckily, as noted by [j00sean](https://twitter.com/j00sean)
The main attack chain associated with CVE-2021-40444 is the DLL attack loaded via the `.cpl` URI scheme. In order to
exploit that, an attacker needs to generate a specially crafted DLL. If you want to test it out, try my [evildll-gen](https://gist.github.com/klezVirus/e24c94d7061f5736e2452eee022f4011)
script.
# JScript, VBScript, Javaw, MSIexec, ...
As noted by [Max Maluin](https://twitter.com/Max_Mal_), it is possible to interact with several filetypes abusing IE and
the associated file extension based URI. While this is might be a good way to exploit IE, it has limitations.
As per Microsoft [documentation](https://docs.microsoft.com/it-it/cpp/mfc/upgrading-an-existing-activex-control?view=msvc-160), the `codebase` tag
can point just to a few filetypes: OCX, INF and CAB.
Even if we can directly download an OCX or INF file, we still can't be sure to download the file in the right location
within the system. With the cab exploit, it is possible to move the `.inf` file in a well-known path using the path traversal,
but in any other case the file will be stored in a random directory, making it virtually impossible to reference it.
As of today, I didn't find a way to chain download and execution WITHOUT a CAB file.
Note: Talking about IE alone, HTML smuggling could be a possible scenario to exploit the vulnerability.
# Cab-less file attack using hybrid RAR file
This technique was firstly disclosed by [Eduardo Braun](https://twitter.com/Edu_Braun_0day) on Twitter and further explained in [this](https://github.com/Edubr2020/CVE-2021-40444--CABless/blob/main/MS_Windows_CVE-2021-40444%20-%20'Ext2Prot'%20Vulnerability%20'CABless'%20version.pdf) paper.
Please note that using this technique, the attack chain is a bit different. This attack requires the user to download
a specially crafted RAR file, obtained by chaining a valid WSF script and a valid RAR file. Once opened, the RAR will contain
a DOCX with a reference to an HTML, which in turn will try to load the RAR file as a WSF script.
To summarise:
1. Specially crafted RAR file is downloaded (likely Download folder)
2. DOCX extracted and opened
3. Relationship stored in document.xml.rels points to malicious html
4. IE preview is launched to open the HTML link
5. JScript within the HTML contains a script/iframe pointing to the RAR file, prefixed with the ".wsf:" URI scheme
6. As the RAR was designed to be contemporaneously a valid RAR and a valid WSF script, the script is executed
# What are the exploits PoC implemented by the tool
The generator utility can currently reproduce the following attacks:
| Attack | HTML Templates | Target | Delivery Method | Execution Method | Working |