HInvoke and avoiding PInvoke | drakonia’s blog

On my research list [Wayback/Archive] HInvoke and avoiding PInvoke | drakonia’s blog.

A very minimalistic approach of calling .net runtime functions or accessing properties using only hashes as identifiers. It does not leave any strings or import references since we dynamically resolve the required member from the mscorlib assembly on runtime.

The underlying code is at [Wayback/Archive] S4ntiagoP/donut: Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters.

It is being used by [Wayback/Archive] Convert binary to a shellcode with donut and create a C# self injector from it via a combo of “Dynamic P/Invoke + H/Invoke” calls

Related are:

  • the Windows PE (Portable Executable) loader for .NET: [Wayback/Archive] nettitude/RunPE: C# Reflective loader for unmanaged binaries.
  • the [Wayback/Archive] daem0nc0re/TangledWinExec: C# PoCs for investigation of Windows process execution techniques investigation
  • Via:

    –jeroen

     

    #CyberSecurity #dinvoke #hinvoke #infosec #maldev #pentest #Pentesting #redteam

    HInvoke and avoiding PInvoke

    A very minimalistic approach of calling .net runtime functions or accessing properties using only hashes as identifiers. It does not leave any strings or import references since we dynamically resolve the required member from the mscorlib assembly on runtime.

    drakonia’s blog