
Ein leichtgewichtiger Testrahmen, der die Shellcode-Entwicklung beschleunigen soll, indem er eine Ausführungsumgebung mit integrierter Absturzdiagnose und Debug-Ausgabeumleitung bereitstellt.
Eine leichte Testumgebung, die entwickelt wurde, um die Shellcode-Entwicklung zu beschleunigen, indem sie eine Ausführungsumgebung mit integrierter Absturzdiagnose und Debug-Ausgabeumleitung bereitstellt.
g++ -o loader.exe loader.cc -ladvapi32 -luser32 -lkernel32 -static
# Führe eine Payload mit der Standard-Host-DLL aus
loader.exe --bin payload.bin
# Führe eine Payload durch Stomping einer bestimmten DLL aus
loader.exe --bin payload.bin --dll mscoree.dll
# Suche nach allen kompatiblen DLLs
loader.exe --scan
# Suche nach DLLs mit einem .text-Abschnitt, der groß genug für eine bestimmte Payload ist
loader.exe --scan --bin payload.bin
#if defined(DEBUG)
#define PDEBUG(format, ...) \
{ \
ntdll.DbgPrint(symbol<PCH>("%-48s " format), symbol<PCH>(({ \
char __buf[48]; \
memory::snprintf(__buf, sizeof(__buf), "[%s:%d]", \
__FUNCTION__, __LINE__); \
__buf; \
})), \
##__VA_ARGS__); \
}
#define PDEBUG_CTX(ctx, format, ...) \
{ \
if ((ctx) && (ctx)->ntdll.DbgPrint) { \
(ctx)->ntdll.DbgPrint(symbol<PCH>("%-48s " format), symbol<PCH>(({ \
char __buf[48]; \
memory::snprintf(__buf, sizeof(__buf), "[%s:%d]",\
__FUNCTION__, __LINE__); \
__buf; \
})), \
##__VA_ARGS__); \
} \
}
#else
#define PDEBUG(format, ...) \
{ \
; \
}
#define PDEBUG_CTX(ctx, format, ...) \
{ \
; \
}
#endif
PSYSCALL_TABLE pTable = NULL;
SIZE_T regionSize = sizeof(SYSCALL_TABLE);
ntdll.NtAllocateVirtualMemory(
(HANDLE)-1,
(PVOID*)&pTable,
0,
®ionSize,
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE
);
if (pTable) {
pTable->NtTerminateProcess = 0x2c; // Beispiel-Syscall-Nummer
PDEBUG("HEXDUMP:%p:%zu", pTable, sizeof(SYSCALL_TABLE));
}
