
SysWhispers2의 C# 포팅 버전입니다. SharpASM을 사용하여 시스템 콜 스텁 실행을 위한 코드 케이브를 찾습니다.

SysWhispers2의 C# 포팅입니다.
시스템 콜 스텁을 실행하기 위한 코드 케이브를 찾는 데 SharpASM을 사용합니다.
기술적 세부 사항은 블로그 게시물에서 확인하세요: https://www.secforce.com/blog/sharpasm-sharpwhispers/
______ _ ____ _
/ __/ / ___ ________| | /| / / / (_)__ ___ ___ _______
_\ \/ _ \/ _ `/ __/ _ \ |/ |/ / _ \/ (_-</ _ \/ -_) __(_-<
/___/_//_/\_,_/_/ / .__/__/|__/_//_/_/___/ .__/\__/_/ /___/
/_/ /_/
@d_glenx
@SECFORCE_LTD
=============================================================
usage: SharpWhispers.py [-h] [-p PRESET] [-f FUNCTIONS] -o OUT_FILE
optional arguments:
-h, --help show this help message and exit
-p PRESET, --preset PRESET
Preset ("all", "common", "dinvoke")
-f FUNCTIONS, --functions FUNCTIONS
Comma-separated functions
-o OUT_FILE, --out-file OUT_FILE
Output basename (w/o extension)
Visual Studio 프로젝트를 만드는 방법은 여기에서 제공됩니다.
기본적인 프로세스 인젝션 예제는 여기에서 제공됩니다.
현재 json 파일에는 33개의 시스템 콜을 생성하는 데이터가 포함되어 있습니다.
참고: All 프리셋은 전체 시스템 콜 중 일부만 포함합니다.
==== System Calls Imported ====
==[DInvoke]==
[i] Number of Delegates: 13
NtCreateThreadEx
NtCreateSection
NtUnmapViewOfSection
NtMapViewOfSection
NtQueryInformationProcess
NtOpenProcess
NtAllocateVirtualMemory
NtFreeVirtualMemory
NtQueryVirtualMemory
NtProtectVirtualMemory
NtWriteVirtualMemory
NtReadVirtualMemory
NtOpenFile
==[Additional]==
[i] Number of Delegates: 20
NtOpenThread
NtQueueApcThread
NtOpenSection
NtSuspendThread
NtQueryInformationFile
NtSetContextThread
NtResumeProcess
NtOpenProcessToken
NtWaitForMultipleObjects
NtQueryDirectoryFile
NtAdjustPrivilegesToken
NtQuerySystemInformation
NtDeviceIoControlFile
NtResumeThread
NtCreateProcess
NtSuspendProcess
NtGetContextThread
NtClose
NtQueryInformationThread
NtTestAlert
NtCreateThreadEx
NtCreateSection
NtUnmapViewOfSection
NtMapViewOfSection
NtQueryInformationProcess
NtAllocateVirtualMemory
NtFreeVirtualMemory
NtProtectVirtualMemory
NtWriteVirtualMemory
NtOpenFile
NtReadVirtualMemory
NtQueryVirtualMemory
NtOpenProcess
NtCreateThreadEx
NtCreateSection
NtUnmapViewOfSection
NtMapViewOfSection
NtQueryInformationProcess
NtOpenProcess
NtAllocateVirtualMemory
NtFreeVirtualMemory
NtQueryVirtualMemory
NtProtectVirtualMemory
NtWriteVirtualMemory
NtReadVirtualMemory
NtOpenFile
동적으로 생성됨
생성할 시스템 콜의 델리게이트를 포함합니다.
SharpASM에 의존
ASM을 사용하여 PEB의 주소를 가져오는 헬퍼입니다.
C#에서 ASM을 동적으로 호출하는 코드를 포함합니다.
public static IntPtr callASM(byte[] stub) 함수는 바이트 배열을 전달하여 셸코드를 호출하는 데 사용할 수 있습니다.
동적으로 생성됨 - 스크립트는 시스템 콜 이름을 해시하기 위해 임의의 시드를 생성합니다
ElephantSe4l의 기법을 사용하여 시스템 콜 번호를 검색하는 코드를 포함합니다 (SysWhispers2에서 포팅된 코드).
SharpASM에 의존
ASM을 사용하여 시스템 콜을 동적으로 실행하는 코드를 포함합니다.
또한 시스템 콜용 래퍼를 포함합니다 (예: Syscall.NtAllocateVirtualMemory) (동적으로 생성됨)
동적으로 생성됨
SharpWhispers 출력 파일은 C# 프로젝트에서 직접 사용할 수 있습니다. 필요한 데이터 형식은 DInvoke 프로젝트에 정의된 데이터 형식의 하위 집합입니다 (일부 데이터 형식은 실제로 Rastamouse의 경량화된 프로젝트에서 차용한 것입니다). 이는 탐지 표면을 줄이기 위함입니다. 데이터 형식은 DInvoke의 정의와 겹치지 않도록 SharpWhisper.Data 네임스페이스에 정의되어 있습니다.
참고: 데이터 형식은 탐지 표면을 최소화하기 위해 필요한 경우에만 생성됩니다 (즉, 시스템 콜이 데이터 형식을 필요로 하는 경우).
필요한 데이터 형식을 생성하는 데 사용되는 템플릿은 다음과 같습니다: