AppLocker Bypass with C#
execute arbitrary C# code via a whitelisted application; our target application must either accept a pre-compiled executable as an argument and load it into memory or compile it itself
Last updated
execute arbitrary C# code via a whitelisted application; our target application must either accept a pre-compiled executable as an argument and load it into memory or compile it itself
Last updated
Accepts two arguments. The first must be the path to an XML file containing compiler flags and the path to a file containing C# code.
The second argument is used as a file path, and content is written to it in XML format. Since we only care about obtaining code execution, we can simply pass a random file name as the second command line argument.
The C# file will be compiled and loaded into memory without restrictions.
The downside to this attack is that we must provide both the XML file and the C# code file on disk, and the C# code file will be compiled temporarily to disk as well.
^ XML file containing compiler flags and the path to a file containing C# code.^
if the XML file is generated from an admin console to avoid AppLocker, need to modify the permission for normal user