|
[求助]linux下调用动态库非导出函数,能调吗,C语言
函数相对于模块基址的偏移是固定的,取实际加载基址加上这个偏移就可以了。 虽然我不懂Linux,但是我想这跟Windows下调用Dll的未导出函数没什么区别 |
|
[求助]ZwQuerySystemInformation隐藏进程前为什么要先脱钩?
脱钩是一种非常Low的做法。。。一般都是直接走Trampoline的 |
|
[求助]win 8.1 win10注入explorer.exe
好歹上windbg挂上Explorer看一下吧,你这样神仙知道为什么? |
|
[求助]HOOK NtCreateUserProcess CreateProcessInternalW函数
Win7下面CreateProcessInternalW函数在kernel32.dll中实现 Win8/Win10下面CreateProcessInternalW函数在kernelbase.dll中实现 这也许就是你Hook不到的原因吧~ 只能说你Hook的方法还是有问题的 |
|
[求助]ZwCreateUserProcess怎么创建一个挂起的进程
看了一下,NtCreateUserProcess创建的进程本来就是挂起的,如果用户没指定CREATE_SUSPENDED,那么就再执行NtResumeThread恢复执行 |
|
[求助]ZwCreateUserProcess怎么创建一个挂起的进程
NTSTATUS NtCreateUserProcess( OUT PHANDLE ProcessHandle, OUT PHANDLE ThreadHandle, IN ACCESS_MASK ProcessDesiredAccess, IN ACCESS_MASK ThreadDesiredAccess, IN POBJECT_ATTRIBUTES ProcessObjectAttributes OPTIONAL, IN POBJECT_ATTRIBUTES ThreadObjectAttributes OPTIONAL, IN ULONG CreateProcessFlags, IN ULONG CreateThreadFlags, IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters, IN PVOID Parameter9, IN PNT_PROC_THREAD_ATTRIBUTE_LIST AttributeList ); 第七个参数 ULONG CreateProcessFlags不就是吗? 你先自己用CreateProcess创建一个挂起的进程,然后跟踪一下,看看这个标志到调用ZwCreateUserProcess的时候变成了什么不就行了? |
|
[分享]32/64位跨平台反汇编引擎BeaEngine使用简介
今天需要的时候翻到这里,感谢楼主的分享 |
|
[求助]hOOK ZwCreateUserProcess怎么获取新进程的PID
NTSTATUS NtCreateUserProcess( [COLOR="Red"][B]OUT PHANDLE ProcessHandle,[/B][/COLOR] OUT PHANDLE ThreadHandle, IN ACCESS_MASK ProcessDesiredAccess, IN ACCESS_MASK ThreadDesiredAccess, IN POBJECT_ATTRIBUTES ProcessObjectAttributes OPTIONAL, IN POBJECT_ATTRIBUTES ThreadObjectAttributes OPTIONAL, IN ULONG CreateProcessFlags, IN ULONG CreateThreadFlags, IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters, IN PVOID Parameter9, IN PNT_PROC_THREAD_ATTRIBUTE_LIST AttributeList ); 第一个参数你看一下 有句柄的话,ObRefrence一下得到对象,然后PsGetProcessId |
|
如何利用映像回调(PsSetLoadImageNotifyRoutine)来拦截dll加载
是加载了,但DllMain还没有执行,所以可以Patch |
|
如何利用映像回调(PsSetLoadImageNotifyRoutine)来拦截dll加载
以下部分内容来自WRK 先看两个宏 #define LOCK_ADDRESS_SPACE(PROCESS) \ KeAcquireGuardedMutex (&((PROCESS)->AddressCreationLock)); #define UNLOCK_ADDRESS_SPACE(PROCESS) \ KeReleaseGuardedMutex (&((PROCESS)->AddressCreationLock)); 这个锁的位置在EPROCESS里面,偏移在各个系统应该也不一样,所以要用的话得自己根据系统版本硬编码了。下面这个是XP的: nt!_EPROCESS +0x000 Pcb : _KPROCESS +0x06c ProcessLock : _EX_PUSH_LOCK +0x070 CreateTime : _LARGE_INTEGER +0x078 ExitTime : _LARGE_INTEGER +0x080 RundownProtect : _EX_RUNDOWN_REF +0x084 UniqueProcessId : Ptr32 Void +0x088 ActiveProcessLinks : _LIST_ENTRY +0x090 QuotaUsage : [3] Uint4B +0x09c QuotaPeak : [3] Uint4B +0x0a8 CommitCharge : Uint4B +0x0ac PeakVirtualSize : Uint4B +0x0b0 VirtualSize : Uint4B +0x0b4 SessionProcessLinks : _LIST_ENTRY +0x0bc DebugPort : Ptr32 Void +0x0c0 ExceptionPort : Ptr32 Void +0x0c4 ObjectTable : Ptr32 _HANDLE_TABLE +0x0c8 Token : _EX_FAST_REF +0x0cc WorkingSetLock : _FAST_MUTEX +0x0ec WorkingSetPage : Uint4B [COLOR="Red"][B]+0x0f0 AddressCreationLock : _FAST_MUTEX[/B][/COLOR] +0x110 HyperSpaceLock : Uint4B +0x114 ForkInProgress : Ptr32 _ETHREAD +0x118 HardwareTrigger : Uint4B 在加载PE文件时NtMapViewOfSection会调用这个: MmMapViewOfSection { // // Get the address creation mutex to block multiple threads // creating or deleting address space at the same time. // LOCK_ADDRESS_SPACE (Process); //Map Image status = [COLOR="Red"][B]MiMapViewOfImageSection [/B][/COLOR](ControlArea, Process, CapturedBase, SectionOffset, CapturedViewSize, Section, InheritDisposition, ZeroBits, AllocationType, ImageCommitment); UNLOCK_ADDRESS_SPACE (Process); } //在这个函数里调用回调 MiMapViewOfImageSection { ...... [COLOR="red"][B]PsCallImageNotifyRoutines[/B][/COLOR]();//此时锁是Lock状态 ...... } 所以,你要在NotifyRoutine里先UNLOCK_ADDRESS_SPACE,然后调用ZwProtectVirturlMemory修改属性,完事儿再LOCK_ADDRESS_SPACE,这样就可以愉快地Patch了。 但是用了硬编码,感觉就不完美了。。。 另外,DllMain是三个参数: .text:10001000 ; BOOL __stdcall [COLOR="red"][B]DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)[/B][/COLOR] .text:10001000 .text:10001000 hinstDLL = dword ptr 4 .text:10001000 fdwReason = dword ptr 8 .text:10001000 lpvReserved = dword ptr 0Ch .text:10001000 .text:10001000 cmp [esp+fdwReason], 1 .text:10001005 jnz short loc_1000101C .text:10001007 push 0 ; lpThreadId .text:10001009 push 0 ; dwCreationFlags .text:1000100B push 0 ; lpParameter .text:1000100D push offset ThreadShow(void *) ; lpStartAddress .text:10001012 push 0 ; dwStackSize .text:10001014 push 0 ; lpThreadAttributes .text:10001016 call ds:CreateThread(x,x,x,x,x,x) .text:1000101C .text:1000101C loc_1000101C: ; CODE XREF: DllMain(x,x,x)+5j .text:1000101C mov eax, 1 .text:10001021 [COLOR="red"][B]retn 0Ch[/B][/COLOR].text:10001021 __stdcall DllMain(x, x, x) endp 你Patch成retn 08就不怕崩了吗少年? 还有吧,你这eax清零的写法编译器看了会笑的: 01056217 33C0 xor eax,eax 01056219 C2 0C00 retn 0C |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值