Skip to content
KitploitKITPLOIT
HerramientasBlog
Enviar
HerramientasBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

··Feeds·Contacto·Privacidad·© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
Herramientas/GitHubGitHub/jthuraisamy/syswhispers2
Herramientas DefensivasEvasión de IDS/IPSShellcodeRed TeamingDesarrollo de PayloadsExplotación de Binarios
GitHubjthuraisamy/syswhispers2

SysWhispers2

Evasión de AV/EDR mediante llamadas directas al sistema.

Ver Repositorio
1.8k265hace 3 añosRevisado por Kitploit

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

SysWhispers2

SysWhispers ayuda con la evasión generando archivos de encabezado/ASM que los implants pueden usar para hacer llamadas directas al sistema.

Todas las llamadas al sistema principales son compatibles y hay archivos de ejemplo generados disponibles en la carpeta example-output/.

Diferencia entre SysWhispers 1 y 2

El uso es casi idéntico a SysWhispers1 pero no tienes que especificar qué versiones de Windows soportar. La mayoría de los cambios están bajo el capó. Ya no depende de las tablas de syscall de @j00ru, y en su lugar utiliza la técnica de "ordenación por dirección de llamada al sistema" popularizada por @modexpblog. Esto reduce significativamente el tamaño de los stubs de syscall.

La implementación específica en SysWhispers2 es una variación del código de @modexpblog. Una diferencia es que los hashes de nombres de funciones se aleatorizan en cada generación. @ElephantSe4l, quien publicó esta técnica antes, tiene otra implementación basada en C++17 que también vale la pena revisar.

El repositorio original de SysWhispers sigue en pie pero podría quedar obsoleto en el futuro.

Introducción

Varios productos de seguridad colocan hooks en funciones de API en modo usuario que les permiten redirigir el flujo de ejecución a sus motores y detectar comportamientos sospechosos. Las funciones en ntdll.dll que realizan las llamadas al sistema consisten en solo unas pocas instrucciones de ensamblador, por lo que reimplementarlas en tu propio implant puede evitar la activación de esos hooks de productos de seguridad. Esta técnica fue popularizada por @Cn33liz y su publicación en blog tiene más detalles técnicos que vale la pena leer.

SysWhispers proporciona a los red teamers la capacidad de generar pares de encabezado/ASM para cualquier llamada al sistema en la imagen del núcleo del kernel (ntoskrnl.exe). Los encabezados también incluirán las definiciones de tipos necesarias.

Instalación

root@kitploit:~
> git clone https://github.com/jthuraisamy/SysWhispers2.git
> cd SysWhispers2
> py .\syswhispers.py --help

Uso y Ejemplos

Líneas de Comando

root@kitploit:~
# Export all functions with compatibility for all supported Windows versions (see example-output/).
py .\syswhispers.py --preset all -o syscalls_all

# Export just the common functions (see below for list).
py .\syswhispers.py --preset common -o syscalls_common

# Export NtProtectVirtualMemory and NtWriteVirtualMemory with compatibility for all versions.
py .\syswhispers.py --functions NtProtectVirtualMemory,NtWriteVirtualMemory -o syscalls_mem

Salida del Script

root@kitploit:~
PS C:\Projects\SysWhispers2> py .\syswhispers.py --preset common --out-file syscalls_common

python syswhispers.py -p all -a all -l all -o example-output/Syscalls

                  .                         ,--.
,-. . . ,-. . , , |-. o ,-. ,-. ,-. ,-. ,-.    /
`-. | | `-. |/|/  | | | `-. | | |-' |   `-. ,-'
`-' `-| `-' ' '   ' ' ' `-' |-' `-' '   `-' `---
     /|                     |  @Jackson_T
    `-'                     '  @modexpblog, 2021

SysWhispers2: Why call the kernel when you can whisper?

All functions selected.

Complete! Files written to:
        example-output/Syscalls.h
        example-output/Syscalls.c
        example-output/SyscallsStubs.std.x86.asm
        example-output/SyscallsStubs.rnd.x86.asm
        example-output/SyscallsStubs.std.x86.nasm
        example-output/SyscallsStubs.rnd.x86.nasm
        example-output/SyscallsStubs.std.x86.s
        example-output/SyscallsStubs.rnd.x86.s
        example-output/SyscallsInline.std.x86.h
        example-output/SyscallsInline.rnd.x86.h
        example-output/SyscallsStubs.std.x64.asm
        example-output/SyscallsStubs.rnd.x64.asm
        example-output/SyscallsStubs.std.x64.nasm
        example-output/SyscallsStubs.rnd.x64.nasm
        example-output/SyscallsStubs.std.x64.s
        example-output/SyscallsStubs.rnd.x64.s
        example-output/SyscallsInline.std.x64.h
        example-output/SyscallsInline.rnd.x64.h

Ejemplo de Antes y Después de la Inyección de DLL Clásica CreateRemoteThread

root@kitploit:~
py .\syswhispers.py -f NtAllocateVirtualMemory,NtWriteVirtualMemory,NtCreateThreadEx -o syscalls
root@kitploit:~
#include <Windows.h>

void InjectDll(const HANDLE hProcess, const char* dllPath)
{
    LPVOID lpBaseAddress = VirtualAllocEx(hProcess, NULL, strlen(dllPath), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
    LPVOID lpStartAddress = GetProcAddress(GetModuleHandle(L"kernel32.dll"), "LoadLibraryA");
	
    WriteProcessMemory(hProcess, lpBaseAddress, dllPath, strlen(dllPath), nullptr);
    CreateRemoteThread(hProcess, nullptr, 0, (LPTHREAD_START_ROUTINE)lpStartAddress, lpBaseAddress, 0, nullptr);
}
root@kitploit:~
#include <Windows.h>
#include "syscalls.h" // Import the generated header.

void InjectDll(const HANDLE hProcess, const char* dllPath)
{
    HANDLE hThread = NULL;
    LPVOID lpAllocationStart = nullptr;
    SIZE_T szAllocationSize = strlen(dllPath);
    LPVOID lpStartAddress = GetProcAddress(GetModuleHandle(L"kernel32.dll"), "LoadLibraryA");
	
    NtAllocateVirtualMemory(hProcess, &lpAllocationStart, 0, (PULONG)&szAllocationSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
    NtWriteVirtualMemory(hProcess, lpAllocationStart, (PVOID)dllPath, strlen(dllPath), nullptr);
    NtCreateThreadEx(&hThread, GENERIC_EXECUTE, NULL, hProcess, lpStartAddress, lpAllocationStart, FALSE, 0, 0, 0, nullptr);
}

Funciones Comunes

Usar el interruptor --preset common creará un par de encabezado/ASM con las siguientes funciones:

Haga clic para expandir la lista de funciones.
  • NtCreateProcess (CreateProcess)
  • NtCreateThreadEx (CreateRemoteThread)
  • NtOpenProcess (OpenProcess)
  • NtOpenThread (OpenThread)
  • NtSuspendProcess
  • NtSuspendThread (SuspendThread)
  • NtResumeProcess
  • NtResumeThread (ResumeThread)
  • NtGetContextThread (GetThreadContext)
  • NtSetContextThread (SetThreadContext)
  • NtClose (CloseHandle)
  • NtReadVirtualMemory (ReadProcessMemory)
  • NtWriteVirtualMemory (WriteProcessMemory)
  • NtAllocateVirtualMemory (VirtualAllocEx)
  • NtProtectVirtualMemory (VirtualProtectEx)
  • NtFreeVirtualMemory (VirtualFreeEx)
  • NtQuerySystemInformation (GetSystemInfo)
  • NtQueryDirectoryFile
  • NtQueryInformationFile
  • NtQueryInformationProcess
  • NtQueryInformationThread
  • NtCreateSection (CreateFileMapping)
  • NtOpenSection
  • NtMapViewOfSection
  • NtUnmapViewOfSection
  • NtAdjustPrivilegesToken (AdjustTokenPrivileges)
  • NtDeviceIoControlFile (DeviceIoControl)
  • NtQueueApcThread (QueueUserAPC)
  • NtWaitForMultipleObjects (WaitForMultipleObjectsEx)

Importar en Visual Studio

  1. Copie los archivos H/C/ASM generados en la carpeta del proyecto.
  2. En Visual Studio, vaya a Project → Build Customizations... y habilite MASM.
  3. En el Solution Explorer, agregue los archivos .h y .c/.asm al proyecto como archivos de encabezado y fuente, respectivamente.
  4. Vaya a las propiedades del archivo ASM de x86.
  5. Seleccione All Configurations del menú desplegable Configurations.
  6. Seleccione Win32 del menú desplegable Platform.
  7. Establezca las siguientes opciones:
    • Excluded From Build = No
    • Content = Yes
    • Item Type = Microsoft Macro Assembler
  8. Haga clic en Apply.
  9. Seleccione x64 del menú desplegable Platform.
  10. Establezca las siguientes opciones:
    • Excluded From Build = Yes
    • Content = Yes
    • Item Type = Microsoft Macro Assembler
  11. Haga clic en Apply, luego en OK.
  12. Vaya a las propiedades del archivo ASM de x64.
  13. Seleccione All Configurations del menú desplegable Configurations.
  14. Seleccione Win32 del menú desplegable Platform.
  15. Establezca las siguientes opciones:
    • Excluded From Build = Yes
    • Content = Yes
    • Item Type = Microsoft Macro Assembler
  16. Haga clic en Apply.
  17. Seleccione x64 del menú desplegable Platform.
  18. Establezca las siguientes opciones:
    • Excluded From Build = No
    • Content = Yes
    • Item Type = Microsoft Macro Assembler
  19. Haga clic en Apply, luego en OK.

Compilar con MinGW y NASM

Los siguientes ejemplos demuestran cómo compilar los programas de ejemplo anteriores como EXE y DLL usando MinGW y el ensamblador NASM:

x86 Example EXE

root@kitploit:~
i686-w64-mingw32-gcc -c main.c syscalls.c -Wall -shared
nasm -f win32 -o syscallsstubs.std.x86.o syscallsstubs.std.x86.nasm
i686-w64-mingw32-gcc *.o -o temp.exe
i686-w64-mingw32-strip -s temp.exe -o example.exe
rm -rf *.o temp.exe

x86 Example DLL with Exports

root@kitploit:~
i686-w64-mingw32-gcc -c dllmain.c syscalls.c -Wall -shared
nasm -f win32 -o syscallsstubs.std.x86.o syscallsstubs.std.x86.nasm
i686-w64-mingw32-dllwrap --def dllmain.def *.o -o temp.dll
i686-w64-mingw32-strip -s temp.dll -o example.dll
rm -rf *.o temp.dll

x64 Example EXE

root@kitploit:~
x86_64-w64-mingw32-gcc -m64 -c main.c syscalls.c -Wall -shared
nasm -f win64 -o syscallsstubs.std.x64.o syscallsstubs.std.x64.nasm
x86_64-w64-mingw32-gcc *.o -o temp.exe
x86_64-w64-mingw32-strip -s temp.exe -o example.exe
rm -rf *.o temp.exe

x64 Example DLL with Exports

root@kitploit:~
x86_64-w64-mingw32-gcc -m64 -c dllmain.c syscalls.c -Wall -shared
nasm -f win64 -o syscallsstubs.std.x64.o syscallsstubs.std.x64.nasm
x86_64-w64-mingw32-gcc-dllwrap --def dllmain.def *.o -o temp.dll
x86_64-w64-mingw32-strip -s temp.dll -o example.dll
rm -rf *.o temp.dll

Compilar con MingGW y GNU Assembler (GAS)

x86 Example EXE

root@kitploit:~
i686-w64-mingw32-gcc -m32 -Wall -c main.c syscalls.c syscallsstubs.std.x86.s -o temp.exe
i686-w64-mingw32-strip -s temp.exe -o example.exe

x86 Example DLL with Exports

root@kitploit:~
i686-w64-mingw32-gcc -m32 -Wall -c dllmain.c syscalls.c syscallsstubs.std.x86.s -o temp.dll
i686-w64-mingw32-dllwrap --def dllmain.def *.o -o temp.dll
i686-w64-mingw32-strip -s temp.dll -o example.dll

x64 Example EXE

root@kitploit:~
x86_64-w64-mingw32-gcc -m64 -Wall -c main.c syscalls.c syscallsstubs.std.x64.s -o temp.exe
x86_64-w64-mingw32-strip -s temp.exe -o example.exe

x64 Example DLL with Exports

root@kitploit:~
x86_64-w64-mingw32-gcc -m64 -Wall -c dllmain.c syscalls.c syscallsstubs.std.x64.s -o temp.dll
x86_64-w64-mingw32-dllwrap --def dllmain.def *.o -o temp.dll
x86_64-w64-mingw32-strip -s temp.dll -o example.dll

Usar con LLVM/Clang

SysWhispers2 genera un archivo .s compatible con clang que contiene los stubs ASM. Esto se puede usar con llvm para compilar tu código. Por ejemplo, usando el ejemplo de inyección de DLL CreateRemoteThread anterior:

root@kitploit:~
clang -D nullptr=NULL main.c syscall.c syscallstubs.std.x64.s -o test.exe

Solo Encabezado Inline

La opción de salida inlinegas generará una versión solo de encabezado de Syswhispers2 que se puede usar con la compilación de BOFs. Simplemente incluya el encabezado en su proyecto.

Saltos Aleatorios de Syscall

Al usar la rutina de salto de syscall aleatorio es posible evitar la "marca del syscall". El stub de ensamblador llama a una nueva función SW__GetRandomSyscallAddress que busca y selecciona una instrucción de syscall limpia en ntdll.dll para usar. Al hacer esto, también es posible evitar activar instrucciones de syscall en modo usuario.

Para usar saltos de syscall aleatorios, necesitarás definir RANDSYSCALL al compilar tu programa y usar la versión rnd de la salida de SysWhispers2. Los siguientes ejemplos demuestran el uso de los stubs de GNU Assembler.

x86 Example EXE - Using Random Syscall Jumps

root@kitploit:~
i686-w64-mingw32-gcc main.c syscalls.c syscallsstubs.rnd.x86.s -DRANDSYSCALL -Wall -o example.exe

x64 Example EXE - Using Random Syscall Jumps

root@kitploit:~
x86_64-w64-mingw32-gcc main.c syscalls.c syscallsstubs.rnd.x64.s -DRANDSYSCALL -Wall -o example.exe

Advertencias y Limitaciones

  • Las llamadas al sistema del subsistema gráfico (win32k.sys) no son compatibles.
  • Probado en Visual Studio 2019 (v142) con Windows 10 SDK.

Solución de problemas

  • Errores de redefinición de tipos: un proyecto puede no compilar si los typedefs en syscalls.h ya han sido definidos.
    • Asegúrese de que solo se incluyan las funciones necesarias (es decir, --preset all rara vez es necesario).
    • Si un typedef ya está definido en otro encabezado usado, entonces se podría eliminar de syscalls.h.

Créditos

Desarrollado por @Jackson_T y @modexpblog, pero se basa en el trabajo de muchos otros:

  • @FoxHex0ne por catalogar muchos prototipos de funciones y typedefs en un formato legible por máquina.
  • @PetrBenes, equipo de NTInternals.net, y MSDN por prototipos y typedefs adicionales.
  • @Cn33liz por la implementación inicial del POC Dumpert.

Artículos y Proyectos Relacionados

  • @modexpblog: Bypassing User-Mode Hooks and Direct Invocation of System Calls for Red Teams
  • @hodg87: Malware Mitigation when Direct System Calls are Used
  • @Cn33liz: Combining Direct System Calls and sRDI to bypass AV/EDR (Código)
  • @0x00dtm: Userland API Monitoring and Code Injection Detection
  • @0x00dtm: Defeating Userland Hooks (ft. Bitdefender) (Código)
  • @mrgretzky: Defeating Antivirus Real-time Protection From The Inside
  • @SpecialHoang: Bypass EDR’s memory protection, introduction to hooking (Código)
  • @xpn and @domchell: Silencing Cylance: A Case Study in Modern EDRs
  • @mrjefftang: Universal Unhooking: Blinding Security Software ()

Referencias a SysWhispers

  • @JFaust_: Process Injection Part 1, Part 2, and Alaris loader project (Código)
  • @0xPat: Malware Development Part 2
  • @brsn76945860: Implementing Syscalls In The CobaltStrike Artifact Kit
  • @Cn33liz and @_DaWouw: Direct Syscalls in Beacon Object Files (Código)

Licencia

Este proyecto está licenciado bajo la Licencia Apache 2.0.

Descargar herramienta
Código
  • @spotheplanet: Full DLL Unhooking with C++
  • @hasherezade: Floki Bot and the stealthy dropper
  • @hodg87: Latest Trickbot Variant has New Tricks Up Its Sleeve