PowerShell Reflection
Reflection in PowerShell enabled three main techniques
Type introspection: used if we want to determine all .NET assemblies that reference
System.Management.Automation.dll
, determine what classes and methods exist in an assembly or during .NET malware analysisOverwriting member visibility: useful to borrow .NET code that isn't publicly accessible and editing internal properties or fields - with access to the reflection API, we have access to any field / property / method within a given class in PowerShell
Dynamic code invocation & generation (metaprogramming): used in .NET assembly in-memory loading & execution, dynamic .NET malware analysis and .NET malware re-purposing
We can use reflection for the following:
type retrieval
object instantiation
method invocation
Find out how to use if offensively with PowerShell reflection offensive use-case.
Last updated