能力值:
( LV3,RANK:30 )
|
-
-
26 楼
64位不是做不了,而是让那些整天除了hook就一无所知的人无从下手而已。
比如,你这个拦截远线程的处理,就可以是,在驱动设置线程创建回调,然后Zw函数查线程入口,然后patch这个入口(不用terminate thread,至于原因,自己想)。
|
能力值:
( LV12,RANK:760 )
|
-
-
27 楼
驱动的问题是,有的公司2套班底,驱动搞的事情,应用也要搞~~驱动是驱动部门的事情,应用层是应用部门的事情,千万不要越界,越界了,官僚主义严重的公司会让你明白,劝你必须主动辞职是个什么精神。
|
能力值:
( LV4,RANK:40 )
|
-
-
28 楼
嗯 注入的方法很多 这样不能完全防止注入 况且还可以促使主动加载
一种简单的注入方法,如设置目标进程已有线程的EIP,来做任何事。
一种简单的主动加载方法,修改导入表,添加依赖DLL。
|
能力值:
( LV2,RANK:10 )
|
-
-
29 楼
学习了,能防止多少得多少,这东西没有百分百的
|
能力值:
( LV2,RANK:10 )
|
-
-
30 楼
求教,
"这个时候 ,判断线程入口 点是不是为LoadLibraryA(W),如果 是的话,可以肯定是远程线程正在干注入这事",此时,我已经获得了线程入口点,怎么判断它是不是loadlibrary呢,loadlibrary是一个函数地址啊?
|
能力值:
( LV3,RANK:30 )
|
-
-
31 楼
我觉得,美中不足,作者没有贴出"找线程入口点"的代码.
我看了原文,不懂怎么找线程入口点,希望作者能贴出这块的代码.
|
能力值:
( LV3,RANK:20 )
|
-
-
32 楼
Lz这个比较难搞 不过还是有办法的
|
能力值:
( LV2,RANK:10 )
|
-
-
33 楼
#pragma once
typedef LONG NTSTATUS;
typedef NTSTATUS (WINAPI *NTQUERYINFORMATIONTHREAD)(
HANDLE ThreadHandle,
ULONG ThreadInformationClass,
PVOID ThreadInformation,
ULONG ThreadInformationLength,
PULONG ReturnLength);
typedef enum _THREADINFOCLASS {
ThreadBasicInformation,
ThreadTimes,
ThreadPriority,
ThreadBasePriority,
ThreadAffinityMask,
ThreadImpersonationToken,
ThreadDescriptorTableEntry,
ThreadEnableAlignmentFaultFixup,
ThreadEventPair_Reusable,
ThreadQuerySetWin32StartAddress,
ThreadZeroTlsCell,
ThreadPerformanceCount,
ThreadAmILastThread,
ThreadIdealProcessor,
ThreadPriorityBoost,
ThreadSetTlsArrayAddress, // Obsolete
ThreadIsIoPending,
ThreadHideFromDebugger,
ThreadBreakOnTermination,
ThreadSwitchLegacyState,
ThreadIsTerminated,
ThreadLastSystemCall,
ThreadIoPriority,
ThreadCycleTime,
ThreadPagePriority,
ThreadActualBasePriority,
ThreadTebInformation,
ThreadCSwitchMon, // Obsolete
ThreadCSwitchPmu,
ThreadWow64Context,
ThreadGroupInformation,
ThreadUmsInformation, // UMS
ThreadCounterProfiling,
ThreadIdealProcessorEx,
MaxThreadInfoClass
} THREADINFOCLASS;
class FindThreadStaAddr
{
public:
FindThreadStaAddr(void);
~FindThreadStaAddr(void);
DWORD GetThreadStartAddr1(DWORD dwThreadId);
};
#include "StdAfx.h"
#include "FindThreadStaAddr.h"
FindThreadStaAddr::FindThreadStaAddr(void)
{
}
FindThreadStaAddr::~FindThreadStaAddr(void)
{
}
DWORD FindThreadStaAddr::GetThreadStartAddr1(DWORD dwThreadId)
{
HMODULE hNtdll = LoadLibrary(_T("ntdll.dll"));
if (!hNtdll)
{
return 0;
}
NTQUERYINFORMATIONTHREAD NtQueryInformationThread = NULL;
NtQueryInformationThread = (NTQUERYINFORMATIONTHREAD)
GetProcAddress(hNtdll, "NtQueryInformationThread");
if (!NtQueryInformationThread)
{
return 0;
}
HANDLE ThreadHandle = NULL;
ThreadHandle = OpenThread(THREAD_QUERY_INFORMATION, FALSE, dwThreadId);
if (!ThreadHandle)
{
return 0;
}
DWORD dwStaAddr = NULL;
DWORD dwReturnLength = 0;
if(NtQueryInformationThreadtion(ThreadHandle, ThreadQuerySetWin32StartAddress,
&dwStaAddr, sizeof(dwStaAddr), &dwReturnLength))
{
return 0;
}
return dwStaAddr;
}
得到线程入口。
|
能力值:
( LV2,RANK:10 )
|
-
-
34 楼
好贴,mark一下
|
能力值:
( LV4,RANK:50 )
|
-
-
35 楼
纯属路过,谢谢分享
|
能力值:
( LV2,RANK:10 )
|
-
-
36 楼
有盾必有矛!
|
能力值:
( LV2,RANK:10 )
|
-
-
37 楼
国标到此一游
|
能力值:
( LV2,RANK:10 )
|
-
-
38 楼
游戏本身也调用loadlibrary加载一些dll文件,怎么判断这两个,还有一些输入法,也会在游戏里生成线程吧,怎么区别是外挂还是正常。
本人新手,如果问的比较弱智,请不要嘲笑。。
|
能力值:
( LV3,RANK:20 )
|
-
-
39 楼
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
|
能力值:
( LV2,RANK:10 )
|
-
-
40 楼
没多大用啊 , 又不是同步 。 收到DLL_THREAD_ATTACH信息的时候 ,线程都在执行了。
|
能力值:
( LV2,RANK:10 )
|
-
-
41 楼
好像说错了, 收到DLL_THREAD_ATTACH信息的时候,线程环境创建好了,还没执行。 好像能玩玩
|
能力值:
( LV2,RANK:10 )
|
-
-
42 楼
BOOL WINAPI DllMain( HANDLE hinstDLL , DWORD dwReason , LPVOID lpvReserved )
{
switch ( dwReason )
{
case DLL_THREAD_ATTACH:
{
char szShow[256] = {0};
HANDLE hOutput = NULL;
hOutput = GetStdHandle ( STD_OUTPUT_HANDLE );
HMODULE hMod = NULL;
hMod = GetModuleHandleW ( L"ntdll" );
if ( hMod == NULL )
return false;
MyNtQuerySystemInformation _NtQuerySystemInformation = NULL;
_NtQuerySystemInformation = (MyNtQuerySystemInformation)GetProcAddress ( hMod , "NtQuerySystemInformation" );
if ( _NtQuerySystemInformation == NULL )
return false;
NTSTATUS status = 0;
ULONG ReturnLen = 0;
status = _NtQuerySystemInformation ( SystemProcessesAndThreadsInformation , g_Buf , sizeof(g_Buf) , &ReturnLen );
if ( status != 0 )
return false;
PSYSTEM_PROCESSES pSysProc = (PSYSTEM_PROCESSES)g_Buf;
bool bFind = false;
do
{
if ( pSysProc->ProcessId == GetCurrentProcessId() )
{
bFind = true;
break;
}
pSysProc = (PSYSTEM_PROCESSES)((UINT64)pSysProc + pSysProc->NextEntryDelta);
}while ( pSysProc->NextEntryDelta );
if ( bFind )
{
HANDLE hThread = NULL;
hThread = OpenThread ( THREAD_ALL_ACCESS , FALSE , (DWORD)pSysProc->Threads[pSysProc->ThreadCount-1].ClientId.UniqueThread );
if ( hThread == NULL )
return false;
DWORD dwExitCode = 0;
GetExitCodeThread ( hThread , &dwExitCode );
TerminateThread ( hThread , dwExitCode );
}
else
{
if ( pSysProc->ProcessId == GetCurrentProcessId() )
{
HANDLE hThread = NULL;
hThread = OpenThread ( THREAD_ALL_ACCESS , FALSE , (DWORD)pSysProc->Threads[pSysProc->ThreadCount-1].ClientId.UniqueThread );
if ( hThread == NULL )
return false;
DWORD dwExitCode = 0;
GetExitCodeThread ( hThread , &dwExitCode );
TerminateThread ( hThread , dwExitCode );
}
}
Sleep(100);
}
break;
}
return true;
}
半成品 , pSysProc->Threads[pSysProc->ThreadCount-1].ClientId.UniqueThread 这里只是简单处理最后个线程
|
能力值:
( LV4,RANK:50 )
|
-
-
43 楼
不是可以先注入一段shellcode去hook kernel32里面的函数,然后等到执行这个函数的时候就去加载dll,这个dll就做下面的事情
#include <windows.h>
#include <Tlhelp32.h>
DWORD DllThreadNoInfo()
{
HANDLE hSnapshot = NULL;
MODULEENTRY32 me32 ={0};
me32.dwSize = sizeof (me32);
hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, GetCurrentProcessId() );
if (hSnapshot == INVALID_HANDLE_VALUE)
{
return -1;
}
if(Module32First(hSnapshot, &me32))
{
do
{
if (me32.hModule != GetModuleHandle(NULL))
{
DisableThreadLibraryCalls(me32.hModule);
}
} while ( Module32Next(hSnapshot, &me32) );
}
CloseHandle(hSnapshot);
return 0;
}
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
DllThreadNoInfo();
return TRUE;
}
这不是可以去保护了么?
|
能力值:
( LV3,RANK:30 )
|
-
-
44 楼
标记,学习下
|
能力值:
( LV2,RANK:10 )
|
-
-
45 楼
这个以前不知道 谢谢楼主告知
|