Stagers

Stagers:

Stagers general:

  • allocate memory (length of shellcode) to inject into memory

  • Once memory has been allocated - write the shellcode into memory

  • create a thread that executed the shellcode written into the current process (ensuring when the process injected into doesn't die)

  • keep current process running until the thread (beacon session) exits

Stagers function calls:

  • VirtualAlloc - Allocates memory

  • RtlMoveMemory - Copies shellcode into space allocated by VirtualAlloc call

  • CreateThreat - Creates threat that executed shellcode

  • WaitForSingleObject - Tells program to wait until threate created exists before closing

potential AV catch points:

Basic stagers:

Only need RWX if you're using an encoded shellcode. Stage_encoding can occur OTW

C#:

c++:

using system; using System.Net; using System.Net.Sockets; using System.Runting.InteropServices; using System.Threading;

namespace slksdf { class ajksnlksdf { [DllImport("Kernel32")] private static extern UInt32 HeapCreate(UInt32 HeapCreate1,UInt32 HeapCreate2, UInt32 HeapCreate3);

Last updated