能力值:
( LV12,RANK:230 )
27 楼
我觉得楼上那位说得有道理啊。看得到就删得掉。
现在热杀不是跟自己过不去么,无非是比谁更猥琐,搞成Ring 0战场。
都是上WinPE直接一锅端啊。
看不到了反倒藏得好点,上WinPE之后还得多费点手脚找,找不爽了还可能找不干净。
能看到,就省了太多事。
能力值:
( LV12,RANK:1010 )
28 楼
一些反RK的安全工具啊,算了,列个清单,诸位同学自己google 下载吧:
Rootkit Unhooker v3.7
IceSword 1.22
gmer.exe
Wsyscheck.exe
SnipeSword.exe
...
能力值:
( LV12,RANK:1010 )
29 楼
我又不是专门要实现文件隐藏的,也没有专门要实现文件防删。只是个简单的测试呀。
早就说了,这些辅助的功能是随便写的,你非要钻牛角尖
能力值:
( LV12,RANK:230 )
30 楼
呵,别激动,冷静。
我只是看楼上那位那么说,而你的反驳似乎是认为"看得到也删不掉",故有此疑问,没敢
蔑视你啊,见谅见谅。闪先。
能力值:
( LV6,RANK:90 )
37 楼
[QUOTE=sudami;432069]
(2)得到的PspTerminateThreadByPointer地址
前言: 微点连 PsTerminateSystemThread 也inline hook,真无耻~
nt!PsTerminateSystemThread:
808aa35f 8bff mov edi,edi
808aa361 55 push ebp
808aa362 8bec mov ebp,esp
808aa364 64a124010000 mov eax,dword ptr fs:[00000124h]
808aa36a f6804802000010 test byte ptr [eax+248h],10h
808aa371 0f84ea300800 je nt!PsTerminateSystemThread+0x14 (8092d461)
808aa377 ff7508 push dword ptr [ebp+8]
808aa37a 50 push eax
808aa37b e8a2e9cf77 call f85a8d22 ; 被inline hook了
[/QUOTE]
请教LZ,这种深层次的inline hook是怎么发现的?有没有方便的检测工具??
还是自己一步步跟出来的??
能力值:
( LV2,RANK:10 )
38 楼
inline hook 检测其实并不难,首先这个函数无法被VM,同时要有一个必然的格式,究竟是什么格式,自己想。只要用反汇编引擎对各大函数扫描一次就能搞定,当然了,这样效率也极差。
能力值:
( LV12,RANK:1010 )
39 楼
在debuman已经有大牛探讨过检测这种深层次的inline hook了。
想法不错,实现起来很困难,和鸡蛋壳的描述差不多。
-----------------------------------
自己跟 + ARK分析
能力值:
( LV12,RANK:330 )
44 楼
以前用别人的代码改了个ring0用的GetModuleHandle和GetProcAddress,稳定性还可以
-------------------------------------------------------------------------
extern "C"
{
#include <ntddk.h>
}
#include <WinDef.h>
#include <stdio.h>
typedef struct _SYSTEM_HANDLE_INFORMATION
{
ULONG ProcessId;
UCHAR ObjectTypeNumber;
UCHAR Flags;
USHORT Handle;
PVOID Object;
ACCESS_MASK GrantedAccess;
} SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
typedef enum _SYSTEM_INFORMATION_CLASS {
SystemModuleInformation=11,
} SYSTEM_INFORMATION_CLASS;
extern "C" NTSYSAPI
NTSTATUS
NTAPI
ZwQuerySystemInformation
(
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
IN OUT PVOID SystemInformation,
IN ULONG SystemInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
typedef struct _SYSTEM_MODULE_INFORMATION { // Information Class 11
ULONG Reserved[2];
PVOID Base;
ULONG Size;
ULONG Flags;
USHORT Index;
USHORT Unknown;
USHORT LoadCount;
USHORT ModuleNameOffset;
CHAR ImageName[256];
} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION; BOOL sysmsgf(const char*format,...);
HMODULE GetModuleHandle(char*lpModuleName)
{
void*pModuleAddress=NULL;
NTSTATUS status=STATUS_SUCCESS;
ULONG n =0;
ULONG i=0;
PSYSTEM_MODULE_INFORMATION module=NULL;
PVOID pbuftmp=NULL;
status=ZwQuerySystemInformation(SystemModuleInformation,&n,0,&n);
pbuftmp=ExAllocatePool(NonPagedPool,n);
status=ZwQuerySystemInformation(SystemModuleInformation,pbuftmp,n,NULL);
if(status!=STATUS_SUCCESS){ExFreePool(pbuftmp);return 0;}
module=(PSYSTEM_MODULE_INFORMATION)((PULONG )pbuftmp+1);
n=*((PULONG)pbuftmp);
for(i=0;i<n;i++)
{
if(!strcmp(module[i].ImageName+module[i].ModuleNameOffset,lpModuleName))
{
//sysmsgf("***find***\r\n");
pModuleAddress=module[i].Base;
}
//sysmsgf("0x%08X %s\r\n",module[i].Base,module[i].ImageName+module[i].ModuleNameOffset);
}
//sysmsgf("total:%d modules\r\n",n);
ExFreePool(pbuftmp);
return (HMODULE)pModuleAddress;
}
BOOL EnumModule()
{
void*pModuleAddress=NULL;
NTSTATUS status=STATUS_SUCCESS;
ULONG n =0;
ULONG i=0;
PSYSTEM_MODULE_INFORMATION module=NULL;
PVOID pbuftmp=NULL;
status=ZwQuerySystemInformation(SystemModuleInformation,&n,0,&n);
pbuftmp=ExAllocatePool(NonPagedPool,n);
status=ZwQuerySystemInformation(SystemModuleInformation,pbuftmp,n,NULL);
if(status!=STATUS_SUCCESS){ExFreePool(pbuftmp);return FALSE;}
module=(PSYSTEM_MODULE_INFORMATION)((PULONG )pbuftmp+1);
n=*((PULONG)pbuftmp);
for(i=0;i<n;i++)
{
sysmsgf("0x%08X %s\r\n",module[i].Base,module[i].ImageName+module[i].ModuleNameOffset);
}
sysmsgf("total:%d modules\r\n",n);
ExFreePool(pbuftmp);
return TRUE;
}
///////// GetProcAddress /////////////////
typedef struct _IMAGE_EXPORT_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD Name;
DWORD Base;
DWORD NumberOfFunctions;
DWORD NumberOfNames;
DWORD AddressOfFunctions; // RVA from base of image
DWORD AddressOfNames; // RVA from base of image
DWORD AddressOfNameOrdinals; // RVA from base of image
} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY; typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header
WORD e_magic; // Magic number
WORD e_cblp; // Bytes on last page of file
WORD e_cp; // Pages in file
WORD e_crlc; // Relocations
WORD e_cparhdr; // Size of header in paragraphs
WORD e_minalloc; // Minimum extra paragraphs needed
WORD e_maxalloc; // Maximum extra paragraphs needed
WORD e_ss; // Initial (relative) SS value
WORD e_sp; // Initial SP value
WORD e_csum; // Checksum
WORD e_ip; // Initial IP value
WORD e_cs; // Initial (relative) CS value
WORD e_lfarlc; // File address of relocation table
WORD e_ovno; // Overlay number
WORD e_res[4]; // Reserved words
WORD e_oemid; // OEM identifier (for e_oeminfo)
WORD e_oeminfo; // OEM information; e_oemid specific
WORD e_res2[10]; // Reserved words
LONG e_lfanew; // File address of new exe header
} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; typedef struct _IMAGE_FILE_HEADER {
WORD Machine;
WORD NumberOfSections;
DWORD TimeDateStamp;
DWORD PointerToSymbolTable;
DWORD NumberOfSymbols;
WORD SizeOfOptionalHeader;
WORD Characteristics;
} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
typedef struct _IMAGE_DATA_DIRECTORY {
DWORD VirtualAddress;
DWORD Size;
} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
typedef struct _IMAGE_OPTIONAL_HEADER {
//
// Standard fields.
//
WORD Magic;
BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion;
DWORD SizeOfCode;
DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint;
DWORD BaseOfCode;
DWORD BaseOfData;
//
// NT additional fields.
//
DWORD ImageBase;
DWORD SectionAlignment;
DWORD FileAlignment;
WORD MajorOperatingSystemVersion;
WORD MinorOperatingSystemVersion;
WORD MajorImageVersion;
WORD MinorImageVersion;
WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion;
DWORD Win32VersionValue;
DWORD SizeOfImage;
DWORD SizeOfHeaders;
DWORD CheckSum;
WORD Subsystem;
WORD DllCharacteristics;
DWORD SizeOfStackReserve;
DWORD SizeOfStackCommit;
DWORD SizeOfHeapReserve;
DWORD SizeOfHeapCommit;
DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32;
typedef struct _IMAGE_NT_HEADERS {
DWORD Signature;
IMAGE_FILE_HEADER FileHeader;
IMAGE_OPTIONAL_HEADER32 OptionalHeader;
} IMAGE_NT_HEADERS32, *PIMAGE_NT_HEADERS32;
typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS;
#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
#define IMAGE_OS2_SIGNATURE 0x454E // NE
#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE
#define IMAGE_VXD_SIGNATURE 0x454C // LE
#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
DWORD GetProcAddress( HMODULE phModule,char* pProcName )
{
if (!phModule)
return 0;
PIMAGE_DOS_HEADER pimDH = (PIMAGE_DOS_HEADER)phModule;
PIMAGE_NT_HEADERS pimNH = (PIMAGE_NT_HEADERS)((char*)phModule+pimDH->e_lfanew);
PIMAGE_EXPORT_DIRECTORY pimED = (PIMAGE_EXPORT_DIRECTORY)((DWORD)phModule+pimNH->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
DWORD pExportSize = pimNH->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
DWORD pResult = 0;
if ((DWORD)pProcName < 0x10000)
{
if ((DWORD)pProcName >= pimED->NumberOfFunctions+pimED->Base || (DWORD)pProcName < pimED->Base)
return 0;
pResult = (DWORD)phModule+((DWORD*)((DWORD)phModule+pimED->AddressOfFunctions))[(DWORD)pProcName-pimED->Base];
}else
{
DWORD* pAddressOfNames = (DWORD*)((DWORD)phModule+pimED->AddressOfNames);
for (int i=0;i<(int)pimED->NumberOfNames;i++)
{
char* pExportName = (char*)(pAddressOfNames[i]+(DWORD)phModule);
//sysmsgf("%08X:%s\r\n",pResult,pExportName);
if (strcmp(pProcName,pExportName) == 0)
{
WORD* pAddressOfNameOrdinals = (WORD*)((DWORD)phModule+pimED->AddressOfNameOrdinals);
pResult = (DWORD)phModule+((DWORD*)((DWORD)phModule+pimED->AddressOfFunctions))[pAddressOfNameOrdinals[i]];
break;
}
}
}
if (pResult != 0 && pResult >= (DWORD)pimED && pResult < (DWORD)pimED+pExportSize)
{
char* pDirectStr = (char*)pResult;
bool pstrok = false;
while (*pDirectStr)
{
if (*pDirectStr == '.')
{
pstrok = true;
break;
}
pDirectStr++;
}
if (!pstrok)
return 0;
char pdllname[MAX_PATH];
int pnamelen = pDirectStr-(char*)pResult;
if (pnamelen <= 0)
return 0;
memcpy(pdllname,(char*)pResult,pnamelen);
pdllname[pnamelen] = 0;
HMODULE phexmodule = GetModuleHandle(pdllname);
pResult = GetProcAddress(phexmodule,pDirectStr+1);
}
return pResult;
} extern "C" NTSTATUS
ObQueryNameString(
IN PVOID Object,
OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
IN ULONG Length,
OUT PULONG ReturnLength
);
int ObQueryObjectNameByHandle(HANDLE Handle,char*Name)
{
__try
{
//STATUS_INVALID_HANDLE
POBJECT_NAME_INFORMATION poni=0;
NTSTATUS status;
PVOID obj=NULL;
status=ObReferenceObjectByHandle(Handle,GENERIC_ALL,NULL,KernelMode,&obj,NULL);
if(status!=STATUS_SUCCESS)goto error_ret;
ULONG retbyte=0;
poni=(POBJECT_NAME_INFORMATION)ExAllocatePool(NonPagedPool,1024);
status=ObQueryNameString(obj,poni,1024,&retbyte);
if(status!=STATUS_SUCCESS)goto error_ret;
ObDereferenceObject(obj);
if(poni->Name.Length==0)goto error_ret;
ANSI_STRING as;
RtlUnicodeStringToAnsiString(&as,&poni->Name,TRUE);
strcpy(Name,as.Buffer);
RtlFreeAnsiString(&as);
return TRUE;
error_ret:
if(poni)ExFreePool(poni);
return 0;
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
return -1;
}
} void*malloc(int size)
{
return ExAllocatePool(NonPagedPool,size);
}
void free(void*buf)
{
return ExFreePool(buf);
}
能力值:
( LV2,RANK:10 )
46 楼
现在的杀毒软件,都禁止普通程序加载Driver了,这才是大问题.
能力值:
( LV2,RANK:10 )
47 楼
支持LZ希望能写出专杀工具或者能更新 机器狗,磁碟 的代码