xct's notes
Search…
Antivirus

Meterpreter

We can set "EnableStageEncoding" to true and StageEncoder to "x64/zutto_dekiru" on a Meterpreter payload, this way the 2nd stage will be encrypted and encoded.

Detect Function Emulation

Sleep Timing

Some AV fast forward through sleep timers to speed up analysis (via function emulation). We can abuse this behavior by measuring the time between start and end of a Sleep, in case it is a lot faster than expected we can just exit.

VirtualAllocExNuma

If the API is emulated, it will not return a valid address:
1
[DllImport("kernel32.dll")]
2
static extern IntPtr GetCurrentProcess();
3
4
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
5
static extern IntPtr VirtualAllocExNuma(IntPtr hProcess, IntPtr lpAddress, uint dwSize, UInt32 flAllocationType, UInt32 flProtect, UInt32 nndPreferred);
6
7
IntPtr mem = VirtualAllocExNuma(GetCurrentProcess(), IntPtr.Zero, 0x1000, 0x3000, 0x4,0);
8
if(mem == null){
9
return;
10
}
Copied!
Some other methods where this technique works: FlsAlloc.
Last modified 11mo ago