能力值:
( LV13,RANK:1050 )
|
-
-
2 楼
方法多去了,可以通过进程句柄得到其eprocess.在eprocess中找出可知性映像名.常见办法:
1、 通过PEB. ProcessParameters -> ImagePathName取得可执行文件路径
2、 通过nt!_EPROCESS的ImageFileName取得。
3、 通过nt!_EPROCESS:: SeAuditProcessCreationInfo:: ImageFileName取得。
4、 通过和_EPROCESS相关的文件对象信息取得。
|
能力值:
( LV12,RANK:1010 )
|
-
-
3 楼
NTSTATUS GetFullName(HANDLE KeyHandle,char *fullname)
{
NTSTATUS ns;
PVOID pKey=NULL,pFile=NULL;
UNICODE_STRING fullUniName;
ANSI_STRING akeyname;
ULONG actualLen;
UNICODE_STRING dosName;
fullUniName.Buffer=NULL;
fullUniName.Length=0;
fullname[0]=0x00;
ns= ObReferenceObjectByHandle( KeyHandle, 0, NULL, KernelMode, &pKey, NULL ) ;
if( !NT_SUCCESS(ns)) return ns;
fullUniName.Buffer = ExAllocatePool( PagedPool, MAXPATHLEN*2);//1024*2
fullUniName.MaximumLength = MAXPATHLEN*2;
__try
{
pFile=(PVOID)*(ULONG *)((char *)pKey+20);
pFile=(PVOID)*(ULONG *)((char *)pFile);
pFile=(PVOID)*(ULONG *)((char *)pFile+36);
ObReferenceObjectByPointer(pFile, 0, NULL, KernelMode);
RtlVolumeDeviceToDosName(((PFILE_OBJECT)pFile)->DeviceObject,&dosName);
RtlCopyUnicodeString(&fullUniName, &dosName);
RtlAppendUnicodeStringToString(&fullUniName,&((PFILE_OBJECT)pFile)->FileName);
ObDereferenceObject(pFile);
ObDereferenceObject(pKey );
RtlUnicodeStringToAnsiString( &akeyname, &fullUniName, TRUE );
if(akeyname.Length<MAXPATHLEN)
{
memcpy(fullname,akeyname.Buffer,akeyname.Length);
fullname[akeyname.Length]=0x00;
}
else
{
memcpy(fullname,akeyname.Buffer,MAXPATHLEN);
fullname[MAXPATHLEN-1]=0x00;
}
RtlFreeAnsiString( &akeyname );
ExFreePool(dosName.Buffer);
ExFreePool( fullUniName.Buffer );
return STATUS_SUCCESS;
}
__except(1)
{
if(fullUniName.Buffer) ExFreePool( fullUniName.Buffer );
if(pKey) ObDereferenceObject(pKey );
return STATUS_SUCCESS;
}
}
这样的问题之前已经有N多人问过,怎么不搜索下呢?
浪费论坛资源
|
能力值:
( LV12,RANK:1010 )
|
-
-
4 楼
BOOL GetProcessName( PCHAR theName )
{
PEPROCESS curproc;
char *nameptr;
ULONG i;
KIRQL oldirql;
if( gProcessNameOffset )
{
curproc = PsGetCurrentProcess();
nameptr = (PCHAR) curproc + gProcessNameOffset;
strncpy( theName, nameptr, NT_PROCNAMELEN );
theName[NT_PROCNAMELEN] = 0; /* NULL at end */
return TRUE;
}
return FALSE;
}
|
能力值:
( LV15,RANK:2473 )
|
-
-
5 楼
没指明在ring3还是ring0吧
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
呵呵,谢谢两位牛人了
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
是Ring0 做了SSDT Hook
|
能力值:
( LV2,RANK:10 )
|
-
-
8 楼
MyNtCreateProcessEx proc ProcessHandle,DesiredAccess,ObjectAttributes, \
InheritFromProcessHandle,InheritHandles,SectionHandle, \
DebugPort,ExceptionPort,Unknown
local status,SectionObject,ProcessObject
pushad
push Unknown
push ExceptionPort
push DebugPort
push SectionHandle
push InheritHandles
push InheritFromProcessHandle
push ObjectAttributes
push DesiredAccess
push ProcessHandle
mov eax,AddressOfNtCreateProcessEx
call eax
mov status,eax
xchg ecx,eax
invoke ObReferenceObjectByHandle,ecx,1,0,KernelMode,addr ProcessObject,0
invoke DbgPrint,offset sz5,ProcessObject
popad
xor eax,status
ret
MyNtCreateProcessEx endp
我是这样写的,但为什么最后的ProcessObject是0呢?
各位大牛请指点
|
能力值:
( LV12,RANK:1010 )
|
-
-
9 楼
ecx里面的内容错误。
ObReferenceObjectByHandle 函数的第一个参数应该是 SectionHandle
|
能力值:
( LV2,RANK:10 )
|
-
-
10 楼
呵呵,粗心
我改成了SectionHandle,得到一个0xe.....的值,它指向的地方是一个什么样的结构呢?
是SECTION_OBJECT吗?我读出的内容都是0呢???
|
|
|