Ring3 Dll 주입 방법 모음 요약

50501 단어 dll
1.dll  ,      ,     dll (    ):

lpk.dll、usp10.dll、msimg32.dll、midimap.dll、ksuser.dll、comres.dll、ddraw.dll
lpk의 경우 win7에서 lpk가 Known DLLs에 가입되어 있고 이 등록표 값을 수정할 수 없기 때문에 lpk는 시스템 디렉터리에서 강제로 불러옵니다.
하지만 lpk를.dll는 Exclude From Known Dlls에 가입하여 해결할 수 있으며 구체적으로 lpk를 만들 수 있습니다.reg 파일:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
"ExcludeFromKnownDlls"=hex(7):6c,00,70,00,6b,00,2e,00,64,00,6c,00,6c,00,00,00,\
00,00

가져오기에 성공하면 컴퓨터를 다시 시작해야 효력이 발생합니다.
참조: http://support.microsoft.com/?scid=kb%3Ben-us%3B164501&x=4&y=12
또한 win7의 lpk는 작성에 있어 주의해야 할 것이 있습니다:
WIN7      LPK.DLL LpkInitialize     LPK      .
LpkInitialize , .

따라서 각 시스템을 호환하기 위해 DllMain과 LpkInitialize에서 모두 판단하고 초기화되지 않으면 초기화할 수 있다.전체 코드는 다음과 같습니다.
// lpk.cpp : Defines the entry point for the DLL application.
//

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
#include "stdafx.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
#pragma comment(linker, "/EXPORT:LpkInitialize=_AheadLib_LpkInitialize,@1")
#pragma comment(linker, "/EXPORT:LpkTabbedTextOut=_AheadLib_LpkTabbedTextOut,@2")
#pragma comment(linker, "/EXPORT:LpkDllInitialize=_AheadLib_LpkDllInitialize,@3")
#pragma comment(linker, "/EXPORT:LpkDrawTextEx=_AheadLib_LpkDrawTextEx,@4")
//#pragma comment(linker, "/EXPORT:LpkEditControl=_AheadLib_LpkEditControl,@5")
#pragma comment(linker, "/EXPORT:LpkExtTextOut=_AheadLib_LpkExtTextOut,@6")
#pragma comment(linker, "/EXPORT:LpkGetCharacterPlacement=_AheadLib_LpkGetCharacterPlacement,@7")
#pragma comment(linker, "/EXPORT:LpkGetTextExtentExPoint=_AheadLib_LpkGetTextExtentExPoint,@8")
#pragma comment(linker, "/EXPORT:LpkPSMTextOut=_AheadLib_LpkPSMTextOut,@9")
#pragma comment(linker, "/EXPORT:LpkUseGDIWidthCache=_AheadLib_LpkUseGDIWidthCache,@10")
#pragma comment(linker, "/EXPORT:ftsWordBreak=_AheadLib_ftsWordBreak,@11")
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
#define EXTERNC extern "C"
#define NAKED __declspec(naked)
#define EXPORT __declspec(dllexport)

#define ALCPP EXPORT NAKED
#define ALSTD EXTERNC EXPORT NAKED void __stdcall
#define ALCFAST EXTERNC EXPORT NAKED void __fastcall
#define ALCDECL EXTERNC NAKED void __cdecl
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//LpkEditControl , (by Backer)
EXTERNC void __cdecl AheadLib_LpkEditControl(void);
EXTERNC __declspec(dllexport) void (*LpkEditControl[14])() = {AheadLib_LpkEditControl};

////////////////////////////////////////////////////////////////////////////////////////////////
//
BOOL g_bInited = FALSE;

////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AheadLib
namespace AheadLib
{
HMODULE m_hModule = NULL; //

//
BOOL WINAPI Load()
{
TCHAR tzPath[MAX_PATH];
TCHAR tzTemp[MAX_PATH * 2];

GetSystemDirectory(tzPath, MAX_PATH);
lstrcat(tzPath, TEXT("\\lpk.dll"));
OutputDebugString(tzPath);
m_hModule=LoadLibrary(tzPath);
if (m_hModule == NULL)
{
wsprintf(tzTemp, TEXT(" %s, 。"), tzPath);
MessageBox(NULL, tzTemp, TEXT("AheadLib"), MB_ICONSTOP);
};

return (m_hModule != NULL);
}

//
VOID WINAPI Free()
{
if (m_hModule)
{
FreeLibrary(m_hModule);
}
}

//
FARPROC WINAPI GetAddress(PCSTR pszProcName)
{
FARPROC fpAddress;
CHAR szProcName[16];
TCHAR tzTemp[MAX_PATH];

fpAddress = GetProcAddress(m_hModule, pszProcName);
if (fpAddress == NULL)
{
if (HIWORD(pszProcName) == 0)
{
wsprintf(szProcName, "%d", pszProcName);
pszProcName = szProcName;
}

wsprintf(tzTemp, TEXT(" %hs, 。"), pszProcName);
MessageBox(NULL, tzTemp, TEXT("AheadLib"), MB_ICONSTOP);
ExitProcess(-2);
}

return fpAddress;
}
}
using namespace AheadLib;
////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////
//
void WINAPIV Init(LPVOID pParam);
////////////////////////////////////////////////////////////////////////////////////////////////

void WINAPIV Init(LPVOID pParam)
{
// DLL
return;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, PVOID pvReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hModule);
if ( g_bInited==FALSE ){
Load();
g_bInited = TRUE;
}

//LpkEditControl 14 ,
memcpy((LPVOID)(LpkEditControl+1), (LPVOID)((int*)GetAddress("LpkEditControl") + 1),52);
_beginthread(Init,NULL,NULL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
Free();
}
return TRUE;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkInitialize(void)
{
if ( g_bInited==FALSE ){
Load();
g_bInited = TRUE;
}
GetAddress("LpkInitialize");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkTabbedTextOut(void)
{
GetAddress("LpkTabbedTextOut");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkDllInitialize(void)
{
GetAddress("LpkDllInitialize");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkDrawTextEx(void)
{
GetAddress("LpkDrawTextEx");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkEditControl(void)
{
GetAddress("LpkEditControl");
__asm jmp DWORD ptr [EAX];// LpkEditControl ,eax
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkExtTextOut(void)
{
GetAddress("LpkExtTextOut");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkGetCharacterPlacement(void)
{
GetAddress("LpkGetCharacterPlacement");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkGetTextExtentExPoint(void)
{
GetAddress("LpkGetTextExtentExPoint");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkPSMTextOut(void)
{
GetAddress("LpkPSMTextOut");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_LpkUseGDIWidthCache(void)
{
GetAddress("LpkUseGDIWidthCache");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ALCDECL AheadLib_ftsWordBreak(void)
{
GetAddress("ftsWordBreak");
__asm JMP EAX;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 
2. CreateRemoteThread를 사용하여 원격 스레드를 생성합니다.
XP 사용 코드는 다음과 같습니다.
BOOL WINAPI RemoteLoadLibrary(LPCTSTR pszDllName, DWORD dwProcessId)
{
//
HANDLE hProcess = ::OpenProcess(
PROCESS_VM_WRITE|PROCESS_CREATE_THREAD|PROCESS_VM_OPERATION, FALSE, dwProcessId);
if(hProcess == NULL)
return FALSE;


// , pszDllName,
int cbSize = (::lstrlen(pszDllName) + 1);
LPVOID lpRemoteDllName = ::VirtualAllocEx(hProcess, NULL, cbSize, MEM_COMMIT, PAGE_READWRITE);
::WriteProcessMemory(hProcess, lpRemoteDllName, pszDllName, cbSize, NULL);

// LoadLibraryA ,
HMODULE hModule=::GetModuleHandle (_T("kernel32.dll"));
LPTHREAD_START_ROUTINE pfnStartRoutine =
(LPTHREAD_START_ROUTINE)::GetProcAddress(hModule, "LoadLibraryA");


//
HANDLE hRemoteThread = ::CreateRemoteThread(hProcess, NULL, 0, pfnStartRoutine, lpRemoteDllName, 0, NULL);
if(hRemoteThread == NULL)
{
::CloseHandle(hProcess);
return FALSE;


}

::CloseHandle(hRemoteThread);
::CloseHandle(hProcess);

return TRUE;
}

이 코드는vista,win7에서 성공할 수 없습니다. 개선이 필요합니다. 참고: http://bbs.pediy.com/showthread.php?t=101469&highlight=Vista+Win7+CreateRemoteThread
위의 자료와 코드를 참고하여 컴파일을 통과하고 사용할 수 있도록 잠시 정리하고 대상 프로세스를 열 때 PROCESS 를 사용하는 것이 좋습니다ALL_ACCESS 권한
vista는 메모리의 수치를 수정하기만 하면 더 이상 실현되지 않습니다.
typedef struct _CLIENT_ID {
HANDLE UniqueProcess;
HANDLE UniqueThread;
} CLIENT_ID,*PCLIENT_ID;

typedef struct _INITIAL_TEB
{
PVOID PreviousStackBase;
PVOID PreviousStackLimit;
PVOID StackBase;
PVOID StackLimit;
PVOID AllocatedStackBase;
} INITIAL_TEB, *PINITIAL_TEB;


typedef NTSTATUS (NTAPI *TZwAllocateVirtualMemory)(
__in HANDLE ProcessHandle,
__inout PVOID *BaseAddress,
__in ULONG_PTR ZeroBits,
__inout PSIZE_T RegionSize,
__in ULONG AllocationType,
__in ULONG Protect
);

static TZwAllocateVirtualMemory ZwAllocateVirtualMemory = (TZwAllocateVirtualMemory)GetProcAddress(GetModuleHandle("ntdll.dll"),"ZwAllocateVirtualMemory");

typedef NTSYSAPI NTSTATUS (NTAPI *TZwWriteVirtualMemory) ( IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
IN PVOID Buffer,
IN SIZE_T NumberOfBytesToWrite,
OUT PSIZE_T NumberOfBytesWritten
);
static TZwWriteVirtualMemory ZwWriteVirtualMemory = (TZwWriteVirtualMemory)GetProcAddress(GetModuleHandle("ntdll.dll"),"ZwWriteVirtualMemory");

typedef NTSYSAPI NTSTATUS (NTAPI *TZwProtectVirtualMemory) ( IN HANDLE ProcessHandle,
IN PVOID * BaseAddress,
IN SIZE_T * NumberOfBytesToProtect,
IN ULONG NewAccessProtection,
OUT PULONG OldAccessProtection
);
static TZwProtectVirtualMemory ZwProtectVirtualMemory = (TZwProtectVirtualMemory)GetProcAddress(GetModuleHandle("ntdll.dll"),"ZwProtectVirtualMemory");

typedef NTSYSAPI NTSTATUS (NTAPI *TZwGetContextThread) ( IN HANDLE ThreadHandle,
OUT PCONTEXT Context
);
static TZwGetContextThread ZwGetContextThread = (TZwGetContextThread)GetProcAddress(GetModuleHandle("ntdll.dll"),"ZwGetContextThread");

typedef NTSYSAPI NTSTATUS (NTAPI *TZwCreateThread) ( OUT PHANDLE ThreadHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN HANDLE ProcessHandle,
OUT PCLIENT_ID ClientId,
IN PCONTEXT ThreadContext,
IN PINITIAL_TEB UserStack,
IN BOOLEAN CreateSuspended
);
static TZwCreateThread ZwCreateThread = (TZwCreateThread)GetProcAddress(GetModuleHandle("ntdll.dll"),"ZwCreateThread");

typedef NTSYSAPI NTSTATUS (NTAPI *TZwResumeThread) ( IN HANDLE ThreadHandle,
OUT PULONG SuspendCount
);
static TZwResumeThread ZwResumeThread = (TZwResumeThread)GetProcAddress(GetModuleHandle("ntdll.dll"),"ZwResumeThread");

HANDLE WINAPI myCreateRemoteThread(
HANDLE hProcess,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
LPDWORD lpThreadId)
{
//by 80695073(QQ)
//email [email protected]
CONTEXT context = {CONTEXT_FULL};
CLIENT_ID cid={hProcess};
DWORD ret;
HANDLE hThread = NULL;
DWORD StackReserve;
DWORD StackCommit = 0x1000;
ULONG_PTR Stack = 0;
INITIAL_TEB InitialTeb={};
ULONG x;
const CHAR myBaseThreadInitThunk[] =
{
// 00830000 8BFF mov edi, edi
'\x8B','\xFF',
// 00830002 55 push ebp
'\x55',
// 00830003 8BEC mov ebp, esp
'\x8B','\xEC',
// 00830005 51 push ecx //ntdll.RtlExitUserThread
'\x51',
// 00830006 53 push ebx //
'\x53',
// 00830007 FFD0 call eax //
'\xFF','\xD0',
// 00830009 59 pop ecx //
'\x59',
// 0083000A 50 push eax //
'\x50',
// 0083000B FFD1 call ecx // RtlExitUserThread
'\xFF','\xD1',
// 0083000D 90 nop
'\x90'
};
PVOID pBaseThreadThunk = NULL; //

//0、 OS
StackReserve = 0x1000;
ret = ZwAllocateVirtualMemory(hProcess,
/*&stack.ExpandableStackBottom*/(PVOID*)&pBaseThreadThunk,
0,
&StackReserve,
MEM_COMMIT,
PAGE_EXECUTE_READWRITE);
if (ret >= 0x80000000)
{
//
TRACE("Error IN myCreateRemoteThread ZwAllocateVirtualMemory0 !
");
goto myCreateRemoteThreadRet;
//end
}
ret = ZwWriteVirtualMemory(hProcess,
pBaseThreadThunk,
(LPVOID)myBaseThreadInitThunk,
sizeof(myBaseThreadInitThunk),&x);
if (ret >= 0x80000000)
{
//
TRACE("Error IN myCreateRemoteThread ZwAllocateVirtualMemory0 !
");
goto myCreateRemoteThreadRet;
//end
}

//1、
StackReserve = 0x10000;
ret = ZwAllocateVirtualMemory(hProcess,
/*&stack.ExpandableStackBottom*/(PVOID*)&Stack,
0,
&StackReserve,
MEM_RESERVE,
PAGE_READWRITE);
if (ret >= 0x80000000)
{
//
TRACE("Error IN myCreateRemoteThread ZwAllocateVirtualMemory1!
");
goto myCreateRemoteThreadRet;
//end
}
TRACE("OK myCreateRemoteThread:ZwAllocateVirtualMemory 0x%08x
",Stack);

InitialTeb.AllocatedStackBase = (PVOID)Stack;
InitialTeb.StackBase = (PVOID)(Stack + StackReserve);

/* Update the Stack Position */
Stack += StackReserve - StackCommit;

Stack -= 0x1000;
StackCommit += 0x1000;

/* Allocate memory for the stack */
ret = ZwAllocateVirtualMemory(hProcess,
(PVOID*)&Stack,
0,
&StackCommit,
MEM_COMMIT,
PAGE_READWRITE);
if (ret >= 0x80000000)
{
//
TRACE("Error IN myCreateRemoteThread ZwAllocateVirtualMemory2!
");
goto myCreateRemoteThreadRet;
//end
}
TRACE("OK myCreateRemoteThread:ZwAllocateVirtualMemory 2 0x%08x
",Stack);
InitialTeb.StackLimit = (PVOID)Stack;


StackReserve = 0x1000;
ret = ZwProtectVirtualMemory(hProcess, (PVOID*)&Stack, &StackReserve, PAGE_READWRITE | PAGE_GUARD, &x);
if (ret >= 0x80000000)
{
//
TRACE("Error IN myCreateRemoteThread ZwProtectVirtualMemory!
");
goto myCreateRemoteThreadRet;
//end
}
/* Update the Stack Limit keeping in mind the Guard Page */
InitialTeb.StackLimit = (PVOID)((ULONG_PTR)InitialTeb.StackLimit - 0x1000);
//2、 CONTEXT
// CONTEXT context = {CONTEXT_FULL};
ret = ZwGetContextThread(GetCurrentThread(),&context);
if (ret >= 0x80000000)
{
//
TRACE("Error IN myCreateRemoteThread ZwGetContextThread!
");
goto myCreateRemoteThreadRet;
//end
}
context.Esp = (DWORD)InitialTeb.StackBase;
context.Eip = (DWORD)pBaseThreadThunk; //
context.Ebx = (DWORD)lpParameter;
//other init
//must
context.Eax = (DWORD)lpStartAddress;
context.Ecx = (DWORD)GetProcAddress(GetModuleHandle("ntdll.dll"),"RtlExitUserThread");//0x778B0859;/*win7*///0x77AEEC01;/*vista*/ //ntdll.RtlExitUserThread
context.Edx = 0x00000000; //nouse


ret = ZwCreateThread(&hThread, THREAD_ALL_ACCESS, 0, hProcess, &cid, &context, &InitialTeb, TRUE);
if (ret >= 0x80000000)
{
//
TRACE("Error %d
",GetLastError());
goto myCreateRemoteThreadRet;
//end
}
if(lpThreadId)
{
*lpThreadId = (DWORD)cid.UniqueThread;
}
if (!(dwCreationFlags & CREATE_SUSPENDED))
{
ZwResumeThread(hThread, NULL);
}
myCreateRemoteThreadRet:
return hThread;
}

마지막으로 공통적으로 사용되는 방법은 다음과 같습니다.
//       
HANDLE hRemoteThread = NULL;
OSVERSIONINFO svex = {sizeof(OSVERSIONINFO)};
GetVersionEx(&svex);
if( svex.dwMajorVersion<=5 ){
hRemoteThread = ::CreateRemoteThread(hProcess, NULL, 0, pfnStartRoutine, lpRemoteDllName, 0, NULL);
}else{
hRemoteThread = myCreateRemoteThread(hProcess, NULL, 0, pfnStartRoutine, lpRemoteDllName, 0, NULL);
}

 
3. SetWindowsHookEx를 통해 갈고리를 설치한다. 예를 들어 WHCALLWNDPROC,WH_KEYBOARD,WH_MOUSE,WH_GETMESSAGE 갈고리는 전체 주입을 실현할 수 있다.
SetWindowsHookEx(WH_MOUSE,(HOOKPROC)MouseProc,AfxGetInstanceHandle(),dwThreadId);

 
4.AppInit_DLLs 방식:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs 주입 모든 user32 로드dll의 프로세스입니다.
win7에서 매핑됨: HKEYLOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows,
그리고 LoadAppInit를 설정해야 합니다.DLLs가 1일 경우 AppInitDLLs가 설정되고 기본값은 0입니다.
예를 들어 xp에서 하나를 만듭니다.reg 파일:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows]
"AppInit_DLLs"="c:\\message.dll"

수동으로 가져오면 지정한 dll을 불러올 수 있지만, win7 아래에서는 사용할 수 없습니다.reg 파일 작업의 등록표 키 경로가 다시 지정되지 않았습니다.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows,
그러나 코드를 쓰는 방식은 성공적이다.
void LoadLibByAppInit_DLLs(LPCTSTR pszDllName,BOOL bInstall)
{
HKEY hKey = NULL;
DWORD dwRet = 0;

//win7 :HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows
if ( RegCreateKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows"), 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)!=ERROR_SUCCESS ){
return;
}

dwRet = RegSetValueEx(hKey,_T("LoadAppInit_DLLs"),0,REG_DWORD,(const BYTE *)&bInstall,sizeof(bInstall));
if ( bInstall ){
dwRet = RegSetValueEx(hKey,_T("AppInit_Dlls"),0,REG_SZ,(const BYTE *)pszDllName,lstrlen(pszDllName));
}else{
dwRet = RegSetValueEx(hKey,_T("AppInit_DLLs"),NULL,REG_SZ,NULL,0);
}

RegCloseKey(hKey);
}

win7에 또 하나의 값이 있습니다 RequireSignedappInitDLLs, 1이면 서명된 dll만 불러옵니다. 기본값은 0입니다. dll을 검증하지 않습니다.
참조: http://msdn.microsoft.com/en-us/library/dd744762(v=vs.85).aspx
 
5. ShellExecuteHooks 방법:
local_machine\소프트웨어\microsoft\windows\currentversion\Explorer\ShellExecuteHooks가explorer에 주입됩니다.exe 프로세스.
6. 입력법 주입: http://code.google.com/p/windows-config/wiki/Win32IME
7.lsp, SPI 필터가 네트워크 프로세스에 주입됨: http://www.vckbase.com/document/viewdoc/?id=643
  http://www.vckbase.com/document/viewdoc/?id=808
 
8.BHO.
 
9. 입력표 방식을 주입한다. 원리는 목표pe 파일에 가져오기 함수를 추가하는 것이다. 이 가져오기 함수는 주입할 dll에 있다.
이렇게 하면 대상 PE 파일이 불러올 때 시스템에서 가져오는 라이브러리의 불러오는 작업을 완성합니다. 그러면 DLL이 불러올 수 있습니다.
DIYTools와 유사한 PE 도구를 사용하여 완성할 수 있으며 코드는 쓰지 않겠습니다.
 
10.CreateProcess는 마운트하는 방식으로 목표 프로세스를 만들고 입구 코드 불러오기 지정한 dll를 수정하며 입구 코드 깨우기 프로세스를 복구합니다.
11. Microsoft에서 제공하는 detours 라이브러리 함수인 Detourcreate Process WithDll을 사용하여 프로세스를 만들고 프로세스에 지정한 dll를 불러옵니다. 이 방법은 원리적으로 위의 Create Process 방법입니다.
더 간단하고 안정적일 뿐이야, 가져오는 주의잖아.
12. DXG 방식으로 DirectX를 사용하는 프로세스를 주입하고 자료가 없습니다.
13.RegisterUserApiHook

좋은 웹페이지 즐겨찾기