首页
社区
课程
招聘
[原创]Antirootkit: CodeWalker
发表于: 2008-12-12 15:02 24964

[原创]Antirootkit: CodeWalker

2008-12-12 15:02
24964
Hi,

Hi all,

I've developed an antirootkit tool called CodeWalker which can:

+ Detect hidden processes
+ Detect hidden drivers
+ Detect hidden files (support NTFS only)
+ Detect hooks in both kernel mode and usermode.
+ Works on Windows English 2000/XP/2003/Vista/2008.

The tool is currently in beta stage and im looking for people for testing it. I've already tested it with all rootkits samples I have and its detection rate seems optimistic. I think it's very great if you guys test it against your rootkit zoo and provide the result you got with the tool. If there's BSOD (of cos, you can never write a bug free proggie, rite? :P), it would be very appreciated of you to upload minidumps to help me correct the tool. Thanks in advance.

I will update this tool frequently for new detection methods, bug fixs etc. Welcome for your all suggestions, bugs and minidumps :P

In this beta version, the main improves to other ark is heavily put in hidden driver object (System Modules tab) and code hooking detection.

For hidden driver detection, you can test it with some pretty well hidden driver PoC such as phide_ex and many builds of Rustock.B variants. Although you have to use the "Hardcore Scan" method to detect them.

For code hooking detection, the engine walks all the branches of scanned module i.e any execution path of it to detect modification (btw, that's why i call it CodeWalker). IMHO, It can detect code hooking very well especially with rootkits that place abnormal hooks like Rustock.C (FF25 & FF15 - jmp/call dword ptr [abc]) tho there're still some problems with false-positive hooks/modifications.

Here's the link:

http://cmcinfosec.com/download/cmcark_codewalker.0.2.2.9.12.rar

Please send your feedbacks to npson a.t cmcinfosec.com

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (75)
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
2
cannot detect my rootkit :tophet
2008-12-12 15:19
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
Hi,

It hasnt MBR or bootkit detector yet but soon will come ;) Is your bootkit public or available for testing ?
2008-12-12 16:01
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
4
your tool  cannot detect other part of my rootkit: my hook\hidden driver\hidden file,,etc.
2008-12-12 16:20
0
雪    币: 7651
活跃值: (523)
能力值: ( LV9,RANK:610 )
在线值:
发帖
回帖
粉丝
5
楼主是老外?MJ换ID了?
2008-12-12 16:59
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6

your tool cannot detect other part of my rootkit: my hook\hidden driver\hidden file,,etc.


Well, im curious to test your rootkit. Did you scan hidden driver by hardcore method?
2008-12-12 17:35
0
雪    币: 709
活跃值: (2420)
能力值: ( LV12,RANK:1010 )
在线值:
发帖
回帖
粉丝
7
good job! but I found some problems with your program

1. when I want to skip Scanning Hidden file. I pushed down on the "skip" Button, but It dose not work.

2. your code HOOK scan module is so weak that It can not detect my inline hook.
I think you just scan functions that are exported by ntoskrnl/ntkrnlpa...,but there are still many undocumneted APIs you had missed. here is the result:



3. "Hidden Module",is also not strong enough, My virus proc bypass it easily.

4. "Process Module", can't kill my protected EXE. DKOM+inline...

5. other....

上传的附件:
2008-12-12 18:04
0
雪    币: 709
活跃值: (2420)
能力值: ( LV12,RANK:1010 )
在线值:
发帖
回帖
粉丝
8
I am wondering if your proc is worthiness to reserve.
2008-12-12 18:10
0
雪    币: 451
活跃值: (78)
能力值: ( LV12,RANK:470 )
在线值:
发帖
回帖
粉丝
9
sustain sudami
2008-12-12 18:14
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
苏大这英语。。。
2008-12-12 18:14
0
雪    币: 709
活跃值: (2420)
能力值: ( LV12,RANK:1010 )
在线值:
发帖
回帖
粉丝
11
Chinese English . sorry for may poor English.
I haven't study it for more than two years...
2008-12-12 18:15
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
12
wow, if codewalker even cannot bypass sudami's rootkit , it also can not deal with my tophet
2008-12-12 18:22
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
13
算了算了,欺负老外不厚道啊~
2008-12-12 18:23
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
Hi sudami:

No, i scan all functions in ntoskrnl and other modules, not only exported symbols e.g it can regconize hooks in wanarp.sys placed by rustock. It's weird, maybe something wrong in results processing here. Ill upload a fixed version soon. Maybe because I've modified something to reduce false-positive results.



3. "Hidden Module",is also not strong enough, My virus proc bypass it easily.


At the moment, its limited to hidden standalone rootkit driver only, but not virus :) You can test it with any hidden driver too, with "Hardcore scan" method. By the way, can u give me your process which my tool cant delete ? Have you tried "Corrupt memory" kill method ?

PS: This is the same result i posted a long time ago:
http://reaonline.net/showthread.php?t=7455
2008-12-12 18:36
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
15
inline code hook detection is the impossible task
full image check will produce so many unfathomed result ,and reduce resule will lost some out of way code hook method.

but my tophet donnot have any code hook ,even don't have any "HOOK"
2008-12-12 18:46
0
雪    币: 709
活跃值: (2420)
能力值: ( LV12,RANK:1010 )
在线值:
发帖
回帖
粉丝
16
*** Fatal System Error: 0x00000050
                       (0xF79E6998,0x00000000,0xF52796D8,0x00000003)

Driver at fault:
***  cmcantirootkit.sys - Address F52796D8 base at F526E000, DateStamp 4925140b
.
Break instruction exception - code 80000003 (first chance)

A fatal system error has occurred.
Debugger entered on first try; Bugcheck callbacks have not been invoked.

A fatal system error has occurred.

Connected to Windows XP 2600 x86 compatible target, ptr64 FALSE
Loading Kernel Symbols

2008-12-12 18:57
0
雪    币: 364
活跃值: (152)
能力值: ( LV12,RANK:450 )
在线值:
发帖
回帖
粉丝
17
No one can be sure that his tools can detect all inline hook,
then I will show some skills which bypass your CodeWalker soon.
but  I don't deny that CodeWalker is a  perfect Anti-Rootkit
2008-12-12 19:07
0
雪    币: 7651
活跃值: (523)
能力值: ( LV9,RANK:610 )
在线值:
发帖
回帖
粉丝
18
MJ,sudami,you are so NB! haha…
2008-12-12 19:12
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
19
@sudami: can you post the minidump so i can fix my tool ? Thanks in advance.

@qihoocom:


inline code hook detection is the impossible task
full image check will produce so many unfathomed result ,and reduce resule will lost some out of way code hook method.


Yes, this is the reason. There's a feature in the tool which allow to see all other less suspectious hooks/modification.
As i said in 1st post, the tool doesnt care about the scanned function is exported or not, it just scans all the possible execution path of it, i.e all other undocumented function (sudami mentioned one) on its path, and all other lower level functions. This is why there's "In execution path of" column in kerenl hooks box, and why i call it CodeWalker.

For example:

If you call NtOpenFile, all function which NtOpenFile calls will be examined: IoCreateFile -> IopCreateFile -> IopUpdateOtherOperationCount, ObOpenObjectByName -> ObpCaptureObjectCreateInformation ... It will examine like a normal execution (calls, branches, conditional jumps..) so any hooked function on the execution path of the scanned function will be detected.

PS: This is just a BETA version, i hope you guys will help me point out as much bugs as possible :D
2008-12-12 19:22
0
雪    币: 364
活跃值: (152)
能力值: ( LV12,RANK:450 )
在线值:
发帖
回帖
粉丝
20
the cmcantirootkit.sys is a good example to research~~
2008-12-12 19:29
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
21
@weolar:

Hi, thanks for testing my tools. I'll look forward for your rootkit and hope I'm the 1st to test it ;) TIA.
2008-12-12 19:42
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
22
but my hook in tophet will not modify any of execution image and any of function pointer(do you forgot the IAT/EAT?)
2008-12-12 19:57
0
雪    币: 709
活跃值: (2420)
能力值: ( LV12,RANK:1010 )
在线值:
发帖
回帖
粉丝
23
I tested your Program on VMWARE, and I forgot to set the Computer Model to "Minidump Module", so there isn't any dumps.
but, your hook for KiFastCallEntry cause the SYSTEM to crash...
2008-12-12 20:57
0
雪    币: 7115
活跃值: (639)
能力值: (RANK:1290 )
在线值:
发帖
回帖
粉丝
24
楼上的欺负人 俺不懂洋码码...
2008-12-12 21:31
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
25
@sudami:

Hi, what a pity, i really love minidumps, each minidump help me fix a bug :( CodeWalker doesnt hook anything, so KiFastCallEntry is not the reason. Could you please reproduce the bug and send me the minidump ?

And, for the hook u mention, CodeWalker can detect really fine here. For a quick test, i modify the hook like you post on-the-fly by WinDbg. You can retest the tool in the link in my 1st post:

The test:

Original:
kd> u nt!MmLoadSystemImage+0x22
nt!MmLoadSystemImage+0x22:
8059fb9b 8975b8          mov     dword ptr [ebp-48h],esi
8059fb9e 89b564ffffff    mov     dword ptr [ebp-9Ch],esi
8059fba4 830d042d558001  or      dword ptr [nt!MiFirstDriverLoadEver (80552d04)],1
8059fbab 684d6d4c6e      push    6E4C6D4Dh
8059fbb0 6800010000      push    100h
8059fbb5 56              push    esi
8059fbb6 e889aefaff      call    nt!ExAllocatePoolWithTag (8054aa44)


Patch by WinDbg:

kd> ed 8059fbb7 773a6448
kd> eb f7946003 68
kd> ed f7946004 8054aa44
kd> eb f7946008 c3


Modified (like sudami's):

kd> u nt!MmLoadSystemImage+0x22
nt!MmLoadSystemImage+0x22:
8059fb9b 8975b8          mov     dword ptr [ebp-48h],esi
8059fb9e 89b564ffffff    mov     dword ptr [ebp-9Ch],esi
8059fba4 830d042d558001  or      dword ptr [nt!MiFirstDriverLoadEver (80552d04)],1
8059fbab 684d6d4c6e      push    6E4C6D4Dh
8059fbb0 6800010000      push    100h
8059fbb5 56              push    esi
8059fbb6 e848643a77      call    f7946003
8059fbbb 8945a0          mov     dword ptr [ebp-60h],eax

kd> u f7946003 l4
f7946003 6844aa5480      push    offset nt!ExAllocatePoolWithTag (8054aa44)
f7946008 c3              ret


And here's the result:



Anyway, I'll recheck the code again and again to make sure it works like design purpose.
2008-12-12 22:05
0
游客
登录 | 注册 方可回帖
返回
//