随笔分类 -  技术杂记

一些零碎笔记
摘要:本篇blog的内核可能会杂乱无章,未成年禁止观看:)一。首先对于内核插32bit user apc的情况,内核有一个导出但undoucmented的函数来处理的,如下:nt!PsWrapApcWow64Thread:fffff800`0291b020 65488b042588010000 mov rax,qword ptr gs:[188h]fffff800`0291b029 488b4870 mov rcx,qword ptr [rax+70h]fffff800`0291b02d 4883b92003000000 cmp qword ptr [rcx+320... 阅读全文
posted @ 2013-07-16 17:22 kkindof 阅读(2239) 评论(0) 推荐(0)
摘要:一.事由二.问题三.追踪溯源四.解决问题五.完**********************************************************************************************一. 事由最近有个需求是需要在32bit进程的某个线程A在调用createthread创建线程B的时候,如果线程B的起始地址符合指定的值则需要把该进程dump出来,由于指定的系统环境是windows 64位,不能HOOK,所以采用了PsSetCreateThreadNotifyRoutine的方式,在CreateThreadNotify得到调用时,判断创建的线程起 阅读全文
posted @ 2013-07-16 15:26 kkindof 阅读(5409) 评论(1) 推荐(1)
摘要:这2天测试了一个使用了WMI提供ASEC后门,里面使用了JS脚本往外请求http获取执行命令。但我的分析系统却没抓到这个行为,可在真机中确实抓到有HTTP请求。相当奇怪。最后无奈windbg出手,内核断点afd 发送函数。最后发现是scrcons.exe进程,自然就google后,最后晓得是脚本宿主神马的。最后了解了下这块,多谢EVA大侠的《深入挖掘Windows脚本技术》系统文章。加深了理解。背景小故事说完了。个人对VBS脚本不懂。但常见的创建脚本网上好像都是这样:set fso=wscript.createobject("Scripting.FileSystemObject&qu 阅读全文
posted @ 2012-08-10 16:16 kkindof 阅读(5851) 评论(0) 推荐(1)
摘要:环境:XP内容:粗糙Const HIDDEN_WINDOW = 0strComputer = "."Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set objStartup = objWMIService.Get("Win32_ProcessStartup")Set objConfig = 阅读全文
posted @ 2012-08-09 21:08 kkindof 阅读(1117) 评论(0) 推荐(0)
摘要:环境:XP为了看和子系统联系有多重要,我在kernel32.dll中,IDA看了下引用,如下:可以看出,这个通信确实很重要。其中CreateRemoteThread()函数的调用也需要调用通知子系统创建了线程(截图未全显示),代码片段如下: // // Call the Windows server to let it know about the // process. // if ( !BaseRunningInServerProcess ) { a->ThreadHandle = Handle; ... 阅读全文
posted @ 2012-07-21 12:40 kkindof 阅读(1125) 评论(0) 推荐(0)
摘要:环境:XP[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems]"Windows"=%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll= 阅读全文
posted @ 2012-07-21 11:56 kkindof 阅读(1940) 评论(0) 推荐(0)
摘要:前置知识:同一个Session的进程的eprocess->session指向的值都是一样在1中,我们知道smss.exe创建新的session,然后启动新的csrss.exe和winlogon.exe。它的管理是这样的//先看一个宏定义#define SESSION_GLOBAL(_Session) (_Session->GlobalVirtualAddress)SessionGlobal = SESSION_GLOBAL (MmSessionSpace);在smss.exe创建新的session时,由内核函数MiSessionCreateInternal()实现的:NTSTATU 阅读全文
posted @ 2012-07-01 12:09 kkindof 阅读(1390) 评论(0) 推荐(0)
摘要:PS:下面测试环境均为win 2003正常启动后,smss.exe这个session管理组件会创建2个进程,csrss.exe(子系统)和winlogon.exe,这2个进程属于session 0但smss.exe却不属于任何一个session,这是怎么回事呢?一般我们启动程序后,会看见子进程和父进程属于同一个session跟踪后,发现原来smss.exe在启动上述2个进程之前(这个过程是发生在smss!smpLoaddataFromRegistry()函数中),为了说明方便,下面用伪代码演示smss!smpLoaddataFromRegistry(){}loadsubsystem(){1.会 阅读全文
posted @ 2012-07-01 00:58 kkindof 阅读(1938) 评论(0) 推荐(0)
摘要:SmLoadDeferedSubsystemApi 借用进程启动??parent handle hack? switch (SmApiMsg->ApiNumber) { case SmExecPgmApi : Status = (SmpApiDispatch[SmApiMsg->ApiNumber])( SmApiMsg, Clien... 阅读全文
posted @ 2012-06-30 15:56 kkindof 阅读(348) 评论(0) 推荐(0)
摘要:远程 _BaseRegOpenKey fuck本地了半天,最后竟然提示没权限。不过好像有小1字节的bug?PS:那1字节不是bug, rpc通信的server端解析的时候,当最后一个字符是NULL,所以就去掉了。弄好了,不过想不到被360日掉了。b2290aa8 8050117a nt!KiSwapContext+0x2eb2290ab4 804fa9be nt!KiSwapThread+0x46b2290adc b2c0fca8 nt!KeWaitForSingleObject+0x1c2WARNING: Stack unwind information not available. Fol 阅读全文
posted @ 2012-06-15 17:15 kkindof 阅读(563) 评论(0) 推荐(0)
摘要:引用http://www.ubiqx.org/cifs/SMB.html2.1.2 NBT or Not NBTBefore we actually start, there is one more thing to mention: The SMB protocol is supposed to be "transport independent". That is, SMBshouldwork over any reliable transport that meets a few basic criteria. NBT is one such transport, b 阅读全文
posted @ 2012-06-10 16:55 kkindof 阅读(2896) 评论(0) 推荐(0)
摘要:!chkimg nt //检测模块代码是否被修改Thedt,可以使用dt -v显示结构的大小信息,dt -s xx nt!*xx*,能搜索大小为xx的结构体变量The!errorextension decodes and displays information about an error value.The!irqlextension displays the interrupt request level (IRQL) of a processor on the target computer before the debugger break.The!objaextension dis 阅读全文
posted @ 2012-06-08 22:28 kkindof 阅读(1235) 评论(0) 推荐(0)
摘要:!PROCESS 0 1 explorer.exe !process 2f72 1和!process 81b3a980 1 结果1一样 (2f72是explorer的PIDbp /p 820dbbe0 win32k!xxxxx/t 就是线程bp win32k!xxxxxx".if(@$tpid != 0x999) {g;}"bu kernel32!LoadLibraryExW ";as /mu ${/v:MyAlias} poi(@esp+4); .if ( $spat( \"${MyAlias}\", \"*MYDLL*\" 阅读全文
posted @ 2012-06-08 21:58 kkindof 阅读(719) 评论(0) 推荐(0)