|
[原创]如果病毒这样升级我们怎么办
HPA还是很实用的 |
|
[求助]文件COPY监控
FindFirstChangeNotification只是一个通知,达不到“监控”得“控”的标准 另外这个函数以及其他几个用户态NOTIFY函数都可以理解未仅仅是FS的一个非严格的回掉函数,同时复制100个小文件试试,你会发现有漏掉的,不能真正用于产品 以下引自taurus.wang@develop.com在某处的回帖 //--------------------------------------------------- //从IrpStackLocation中判断来自网络的文件访问 BOOLEAN SfIsFromNetAccess( PIO_STACK_LOCATION IrpSp ) { NTSTATUS status; PACCESS_TOKEN pToken = NULL; PTOKEN_SOURCE pTokenSrc = NULL ; PSECURITY_SUBJECT_CONTEXT secSubCtx; //PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); secSubCtx = &(IrpSp->Parameters.Create.SecurityContext->AccessState->SubjectSecurityContext); if (secSubCtx->ClientToken != NULL || secSubCtx->PrimaryToken != NULL) { pToken = SeQuerySubjectContextToken(secSubCtx); } if (pToken == NULL) { //KdPrint(("SeQuerySubjectContextToken Errorn")); return FALSE; } // // Get TokenSource Name If SourceName is "NtLmSsp" it was logged-in via Lanmanager, // "User32" represents localy logged-in users. // __try { status = SeQueryInformationToken(pToken,TokenSource,&pTokenSrc); if (NT_SUCCESS(status)) { pTokenSrc->SourceName[TOKEN_SOURCE_LENGTH-1] = 0x00; KdPrint(("Token Name :%s Len:%dn",pTokenSrc->SourceName,strlen(pTokenSrc->SourceName))); if (_stricmp(pTokenSrc->SourceName,"NtLmSsp") == 0 ) { KdPrint(("NetWork Access Token Findn")); return TRUE; } } else { KdPrint(("SeQueryInformationToken Error:0x%xn",status)); } } __finally { ExFreePool(pTokenSrc); } return FALSE; } |
|
[讨论]句柄啊,3层表啊,ExpLookupHandleTableEntry啊...[已解决]
我以前得一点笔记,你看有没帮助 wrk1.2中 ExpLookupHandleTableEntry的内部流程 1) 取 Handle(EXHANDLE类型) 值为tHandle,并将TagBit(低两位)置0 2) 取 HandleTable->NextHandleNeedingPool为MaxHandle , 如果 tHandle大于等于MaxHandle,则返回NULL,查询失败 (由此可见, NextHandleNeedingPool 应该是当前句柄表的最大句柄值+1 或者说是下一个可用的句柄值) 3) 取 CapturedTable(ULONG_PTR类型)为HandleTable->TableCode 取 TableLevel(ULONG)为(CapturedTable & LEVEL_CODE_MASK); (LEVEL_CODE_MASK=3,即由HandleTable->TableCode的低2位来指定句柄表的级数) CapturedTable 减去 TableLevel (即CapturedTable的低2位置0) 4) 根据 TableLevel 来进行不同方式的查找 令: PCHAR TableLevel1; 最低层的表指针 PCHAR TableLevel2; 中间层的表指针 PCHAR TableLevel3; 最上层的表指针 ULONG_PTR i; 最低层的表索引 ULONG_PTR j; 中间层的表索引 ULONG_PTR k; 最上层的表索引 PHANDLE_TABLE_ENTRY Entry 最后找到的句柄项目的指针 a) TableLeve = 0 句柄表只有1级,此时CapturedTable只是一个大小为512(4K/8=512) 的HANDLE_TABLE_ENTRY数组,Handle的高30位即是索引. (当然,实际上因为一级表为512项,所以其实只有2~10 9位为有效索引,其中11~31位在 第二步中被检查过,必为0). 由于每个HANDLE_TABLE_ENTRY大小为8,所以对应的Entry相对于表起始地址的偏移 为 Handle.Value>>2 * 8 TableLevel1 = CapturedTable; Entry = TableLevel1 + (Handle.Value>>2) * 8 = TableLevel1 + Handle.Index * 8 = TableLevel1 + Handle.Value * 2 (因为第1步中已经将低2位置0了) wrk 1.2中代码如下 Entry = (PHANDLE_TABLE_ENTRY) &TableLevel1[Handle.Value * (sizeof (HANDLE_TABLE_ENTRY) / HANDLE_VALUE_INC)]; 其中HANDLE_VALUE_INC在EXHANDLE结构中定义,值是4 b) TableLeve = 1 句柄表有2级, 第1层存储的是第2层表的指针(大小为4字节). 第2层存储的是HANDLE_TABLE_ENTRY(大小为8个字节) 句柄的2~10位为最底层表(第2层)的索引,11~N位为中间层表(第1层)索引 (注:N的值从3层句柄表的情况看,应该为) wrk 1.2中的代码及分析如下 +++++++++++++++++++++++++++++++++++++++++++++++ i = Handle.Value % (LOWLEVEL_COUNT * HANDLE_VALUE_INC); /* = Handle.Value % 0x800 = Handle & 0x7FF 等效作用是取低11位 */ Handle.Value -= i; 低11位置0 j = Handle.Value / ((LOWLEVEL_COUNT * HANDLE_VALUE_INC) / sizeof (PHANDLE_TABLE_ENTRY)); /* = Handle.Value / (0x800 / 4) = (Handle.Value >> 11) * 4 等效如下代码,实际上是取11~N为位为索引,并乘以4,得到中间表的表中偏移 */ TableLevel2 = (PUCHAR) CapturedTable; TableLevel1 = *(PUCHAR)(TableLevel2 + j); Entry = TableLevel1+ (i * (sizeof (HANDLE_TABLE_ENTRY) / HANDLE_VALUE_INC)); /* = TableLevel1+ (i*2) = TableLevel1+ ((i>>4) * 8) 等效于最低层表索引(2~10位)乘以sizeof(HANDLE_TABLE_ENTRY),得到表中偏移. */ ------------------------------------------------ c) TableLeve = 2 句柄表有3层 第1层存储的是第2层表的指针(大小为4字节). 第2层存储的是第3层表的指针(大小为4字节). 第3层存储的是HANDLE_TABLE_ENTRY(大小为8个字节) 句柄的2~10位为最底层表(第3层)的索引,11~20位为中间层表(第2层)索引, 20~N位为第一层索引(因为第1层最有4K/4个元素,索引应该也为10位,故推测 N实际上应该为30) wrk 1.2中的代码及分析如下 +++++++++++++++++++++++++++++++++++++++++++++++ i = Handle.Value % (LOWLEVEL_COUNT * HANDLE_VALUE_INC); Handle.Value -= i; 低11位清0 k = Handle.Value / ((LOWLEVEL_COUNT * HANDLE_VALUE_INC) / sizeof (PHANDLE_TABLE_ENTRY)); /* = Handle.Value / (0x800 / 4) = (Handle.Value >> 11) * 4 k取句柄的11~N为位,并乘以4 */ j = k % (MIDLEVEL_COUNT * sizeof (PHANDLE_TABLE_ENTRY)); /* = k % (4K/4 * 4) = k % 0x1000 = k & 0xFFF 取k的低12位,实际上就是:句柄的11~20位为索引 * 4 */ k -= j; k的低12位清0 k /= MIDLEVEL_COUNT; /* = k / (4k/4) = k / 0x1000 = k >> 10 取k的高10~N位,实际上就是句柄的21~N位为索引再乘以4 */ TableLevel3 = (PUCHAR) CapturedTable; TableLevel2 = (PUCHAR) *(PHANDLE_TABLE_ENTRY *) &TableLevel3[k]; TableLevel1 = (PUCHAR) *(PHANDLE_TABLE_ENTRY *) &TableLevel2[j]; Entry = (PHANDLE_TABLE_ENTRY) &TableLevel1[i * (sizeof (HANDLE_TABLE_ENTRY) / HANDLE_VALUE_INC)]; ------------------------------------------------ |
|
[讨论]防止的被HOOK的解决方案!
无效-------- |
|
[求助]请问如果在内核里面防止别人读取自己的驱动文件
有一些思路很简单但比较猥琐的方法 |
|
[求助]请问现在哪本书有具体讲解汇编所有指令的?
坦白说,国内没有任何一本汇编书能比INTEL的手册易懂 |
|
[炒作]版主删除此主题
人家在控制硬件~ |
|
[讨论]能否为IDA写一个反汇编插件呢?
看IDA SDK plugins\procext 这个例子 |
|
|
|
[求助]关于cmp比较的问题
机器指令层次实际上可以忽略什么是不是有符号,可以认为有无符号是让高级语言编译器在产生指令时安排指令用的 CMP指令内部实际上是SUB的实现 SUB可以认为同时进行了有符号和无符号运算。 |
|
|
|
[原创]SoftSnoop 1.3.2 + Source(增加了中文版和说明文档)
不用也要谢谢~~~~ |
|
[调查]咨询下关于反汇编的一些东西
谢谢楼上各位的提示,特别感谢笨笨雄师兄 |
|
|
|
[调查]咨询下关于反汇编的一些东西
仅仅只是举例而已。我这并不是为了脱壳。 如果您认为不可能有结果,不用回复此帖即可。本贴仅仅为能从有同样想法和需要的兄弟那里的得些建议,而不是来收集冷水的 顺便说句不针对任何人的话: 虽然考虑可行性很重要,但恐怕并不是做学问的态度。 别人有人实现了,并不代表自己就能实现。自己做事过程中学到的东西才是自己的。 |
|
[调查]咨询下关于反汇编的一些东西
[QUOTE=Isaiah;387411]统计这种 mov eax,[edi+0x34] mov ecx,[ecx+0x34] 逻辑上雷同.这种要针对某代码片断统计才有意义[/QUOTE] 谢谢提示。 是有这种意思,但不局限于此。 估计会用带有虚拟执行的方式分析,所以可能希望提供一些基础的数据流层次的记录结果 是现在只是考虑提供一些基础的解释结果,便于此后的分析使用 但因为没有经验,所以不知道到底需要提供怎样的结果才能避免以后再大量修改代码 因为只是个人兴趣,所以没有太多精力维护代码,仅仅是一种学习,希望能尽量考虑周全。 |
|
|
|
[调查]咨询下关于反汇编的一些东西
to 楼上: 那只是一个解释指令的东西,跟我这里问得东西还有点差别。 我这里希望能给出一个模块,输入指定的代码片段,输出一定的结果,此结果能为之后针对这段指令的更高程度的分析提供基础信息。我这里是想问下有实际经验的兄弟需要提供什么样的信息。 我还是再改下顶楼的帖子吧,估计是没人懂 |
|
[调查]咨询下关于反汇编的一些东西
to forgot and jskew: 我帖子里已经说明是“反汇编引擎或者指令解释引擎”,不确定名字,是因为我暂时还没确定最终架构,按功能也无法归为其中任一类。forgot 你是否遗漏了“指令解释引擎”这几个字? 改顶楼帖子的内容仅仅是为了避免有其他人像FORGOT一样回答,若让你不爽,本人道歉。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值