首页
社区
课程
招聘
蓝屏救星――IDT Protector v0.9 for Win2k by cyclotron
发表于: 2004-9-4 20:07 11944

蓝屏救星――IDT Protector v0.9 for Win2k by cyclotron

2004-9-4 20:07
11944
[ Release : IDT Protector v0.9 ]
[ Author  :     cyclotron      ]

    备份及恢复IDT的小工具,飞叶前辈的东东在我的系统里不太好用,所以就专门写了一个for Win2k的版本,希望能在调试DBPE、Xpr和heXer与forgot修改的tElock时保护您的系统免受“蓝屏”和“重启”之苦。

    After severl rebooting of my beloved system ,the so-called IDT Protector was finally accomplished .If you have debugged programs protected by such "villains" as DBPE ,Xpr or modified tElock by heXer and forgot :), you must have encountered countless unexpected and irritating rebootings or BSODs ( Blue Screen Of Death ) .These programs are so barbarian that they modified some of the entries in the IDT even through Kernel Mode Drivers under Win2k/WinXP . That's what IDT Protector was borned for ,and what IDT Protector was intended to fight against . I have tested it in my Win2k sp3 system and found it works on an effective basis , but I'm not sure if it will do the same in other systems . I hope you can help me test it ,and any constructive advice is welcome at [ cyclotron (at) citiz.net ] .

    [Note] : Please do not attempt to debug this program if you are not familiar with WDM .This is not because I'd have incorporated into it any anti-debugging tricks ,but that abnormal termination will probably lead to failure of loading its service ,to solve which you have no choice but to delete a registry entry and restart your computer manually once again . In fact , I haven't even imposed any protection on my program for the sake of compatibility and stability so that you can easily make a static disassembling and analyzing of it .

    [Thanks] : I must extend my gratitude to Four-F for his great KmdKit and heXer and forgot for their modified tElock , only through tracing whose code was I finally determined to challenge WDM and grasp the way they modified IDT . BTW : Do they really wanna make it a Chinese Xpr ?

    [Comments:]

    forgot: 护舒宝IDT保护罩
            随着IDT地位的不断提高和角色的多样化,护舒宝将一如既往,向IDT提供更新的保护与关爱,提供24小时全面呵护,让IDT面对Protector压力与挑战,充满自信从容应对,舒展更加迷人的魅力。

    施瓦辛格: (to IDT ) U R Restored .

    赵本山: ( Google中…… ) 咋还没有 IDT Protector 的破解版ni?

    George W Bush: Much as you may attack my fame as a president , importation of IDT Protector must be unconditionally implemented for the sake of system security .

下载:
IDT Protector

[课程]Linux pwn 探索篇!

收藏
免费 1
支持
分享
最新回复 (31)
雪    币: 6075
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
2
Oh my ....挂起来
2004-9-4 20:08
0
雪    币: 221
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
好东东,当然要顶了!:D

提个建议:程序能不能像IDT TOOLS一样显示出当前的IDT,另外,保存的时候,能不能保存到文件(也就是说不需要IDTPROT一直运行),需要时再打开程序恢复IDT,可以避免被杀!
2004-9-4 20:29
0
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
4
最初由 getiteasy 发布
好东东,当然要顶了!:D

提个建议:程序能不能像IDT TOOLS一样显示出当前的IDT,另外,保存的时候,能不能保存到文件(也就是说不需要IDTPROT一直运行),需要时再打开程序恢复IDT,可以避免被杀!


好建议!都被说中了!升级版本一定支持!
2004-9-4 20:42
0
雪    币: 221
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
为什么写FOR 2K,难道它不支持WIN XP吗?(XP不就是用的2K的内核吗?)
2004-9-4 20:48
0
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
6
因为没有测试过,估计也是可以的:D
2004-9-4 20:53
0
雪    币: 221
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
经测试,XP下可以使用!:)
2004-9-4 21:06
0
雪    币: 255
活跃值: (40)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
8
先下载等下再试~!
2004-9-4 21:58
0
雪    币: 898
活跃值: (4039)
能力值: ( LV9,RANK:3410 )
在线值:
发帖
回帖
粉丝
9
谢谢  :D
2004-9-4 22:17
0
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
10
最初由 getiteasy 发布
经测试,XP下可以使用!:)


多谢兄弟:D
2004-9-4 22:31
0
雪    币: 250
活跃值: (105)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
好东西收藏, 怎么首次运行解压一个文件 ? 是标志 ?
2004-9-4 22:44
0
雪    币: 5
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
12
2004-9-4 22:50
0
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
13
最初由 hswanfang 发布
昏,抄袭人家的东西

http://www.nsfocus.net/index.php?act=sec_self&do=view&doc_id=760


晕,这篇文章我可是刚看到,兄弟也太武断了吧,要不你也超一个试试,我可是全程KMDKit开发的哟。
要说抄袭,护舒宝共享软件保护罩 我倒是超了一点:D
2004-9-4 23:55
0
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
14
最初由 baby 发布
好东西收藏, 怎么首次运行解压一个文件 ? 是标志 ?


为使用方便,每次运行都释放一个cyclotron.sys文件:D
2004-9-4 23:57
0
雪    币: 255
活跃值: (266)
能力值: ( LV12,RANK:220 )
在线值:
发帖
回帖
粉丝
15
:D 源代码放出来学习一下
2004-9-4 23:58
0
雪    币: 208
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
16
我也曾写过一个,还有idt的比较,不过没什么意义,用r0cmd比什么都好。
2004-9-6 08:29
0
雪    币: 208
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
17
[QUOTE]最初由 cyclotron 发布
[ Release : IDT Protector v0.9 ]
[ Author  :     cyclotron      ]

    备份及恢复IDT的小工具,飞叶前辈的东东在我的系统里不太好用,所以就专门写了一个for Win2k的版本,希望能在调试DBPE、Xpr和heXer与forgot修改的tElock时保护您的系统免受“蓝屏”和“重启”之苦。

调试xpr恢复idt没有用,蓝屏依旧。事实上应该恢复sst和sst shadow.
2004-9-6 08:33
0
雪    币: 154
活跃值: (216)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
18
sst 是什么?
2004-9-6 09:51
0
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
19
最初由 WiNrOOt 发布
:D 源代码放出来学习一下

升级以后给我发mail:D
2004-9-6 10:56
0
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
20
最初由 mYeXcKsN 发布
[QUOTE]最初由 cyclotron 发布
[ Release : IDT Protector v0.9 ]
[ Author : cyclotron ]

备份及恢复IDT的小工具,飞叶前辈的东东在我的系统里不太好用,所以就专门写了一个for Win2k的版本,希望能在调试DBPE、Xpr和heXer与forgot修改的tElock时保护您的系统免受“蓝屏”和“重启”之苦。



调试xpr恢复idt没有用,蓝屏依旧。事实上应该恢复sst和sst shadow.


谢谢,关于恢复恢复sst和sst shadow mYeXcKsN大侠能否提供一点资料:D
2004-9-6 10:57
0
雪    币: 154
活跃值: (216)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
21
找遍INTEL开发BOOK 1.2.3都没找到SST是什么,不知道你说的是什么
2004-9-6 11:13
0
雪    币: 208
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
22
最初由 cyclotron 发布


谢谢,关于恢复恢复sst和sst shadow mYeXcKsN大侠能否提供一点资料:D


非常简单,用r0cmd备份sst  sst shadow,然后,运行xpr加密的东西,然后,恢复sst sst shadow,这时,你就有机会dump被加密的PE了。还需要改一下xpr 的drive,才能attach debug. 不过xpr分段保护被加密的PE,不容易完全dump.有点像arm的copy mem-II.
2004-9-7 08:13
0
雪    币: 208
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
23
最初由 采臣・宁 发布
找遍INTEL开发BOOK 1.2.3都没找到SST是什么,不知道你说的是什么


system service table

或者 ssdt  system service descriptor table
2004-9-7 08:17
0
雪    币: 208
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
24
2004-9-7 08:20
0
雪    币: 154
活跃值: (216)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
25
http://www.security.org.sg/code/sdtrestore.html
:
Win2K/XP SDT Restore 0.2 (Proof-Of-Concept)
by Tan Chew Keong
Released : 06 Jul 2004
Updated : 13 Aug 2004

Download Version 0.2
Download Version 0.1

Introduction

Win32 Kernel Rootkits modify the behaviour of the system by Kernel Native API hooking. This technique is typically implemented by modifying the ServiceTable entries in the Service Descriptor Table (SDT). Such modification ensures that a replacement (detour) function installed by a rootkit is called prior to the original native API. The replacement function usually calls the original native API and modifies the output before returning the results to the user-space program. This technique allows kernel rootkits to hide files, processes, and to prevent process termination.

This proof-of-concept tool demonstrates the possibility of defeating such rootkits by removing Kernel Native APIs hooks and restoring the SDT back to its original state.

Kernel Native API Hooking by Service Descriptor Table Modification

In Windows, user-space applications request for system services by calling the APIs exported by the various DLLs. For example, to write data to an open file, pipe or device, the WriteFile API that is exported by kernel32.dll is usually used. Within kernel32.dll, the implementation of WriteFile API in turn calls the ZwWriteFile native API that is exported by ntdll.dll. The work done by ZwWriteFile is actually performed in kernel-space. Hence, the implementation of ZwWriteFile in ntdll.dll contains only minimal code to transit into kernel-space using interrupt 0x2E. The disassembly of ZwWriteFile is shown below.

1- MOV EAX, 0ED
2- LEA EDX, DWORD PTR SS:[ESP+4]
3- INT 2E
4- RETN 24

The magic number 0ED in line 1 is the Service Number for ZwWriteFile. It will be used to offset into the Service Table in kernel-space to locate the address of the function that implements the writefile service. The Service Descriptor Table can be referenced using the exported KeServiceDescriptorTable symbol. This is a structure with the following definition.
typedef struct ServiceDescriptorEntry {
        PDWORD ServiceTable;
        PDWORD CounterTableBase;
        DWORD  ServiceLimit;
        PBYTE  ArgumentTable;
} SDT;

The first member of the structure, ServiceTable, is an array of function pointers to the service functions. The DWORD value at ServiceTable[0xED] is a function pointer to NtWriteFile, which contains the actual code to write to files, pipes or devices. Hence, to modify the behaviour of the user-space WriteFile API, one simply needs to write a replacement function, load it into kernel space as a driver, and modify ServiceTable[0xED] to point to the replacement function. The replacement function needs to keep the original function pointer (original value of ServiceTable[0xED]) so that it can be called to perform the original defined function.

Example One - Process Hiding by Hooking ZwQuerySystemInformation

User-space programs can use the ToolHelp APIs to obtain a list of all running processes. The ToolHelp APIs in turn calls the ZwQuerySystemInformation native API exported by ntdll.dll to obtain the list. To hide processes, a kernel-space rootkit, which is loaded as a driver, can modify the function pointer at ServiceTable[0x97] (ZwQuerySystemInformation) to redirect the call to a replacement function. The replacement function first calls the original ZwQuerySystemInformation API to obtain an array containing information of all running process. The returned array is then modified to remove the entry containing the process to be hidden. Finally, the modified result is returned to the user-space program. This effectively prevents the user-space program from "seeing" the hidden process.

Example Two - Driver/Module Hiding by Hooking ZwQuerySystemInformation

User-space programs can obtain a list of all loaded drivers using the ZwQuerySystemInformation native API, specifying SystemModuleInformation as its first parameter. As mentioned earlier, ZwQuerySystemInformation is exported by ntdll.dll and can be called directly by user-space programs. In kernel-space, the ZwQuerySystemInformation native API obtains the list of loaded drivers by traversing the PsLoadedModuleList. A kernel-space rootkit can manipulate the results returned by ZwQuerySystemInformation by modifying ServiceTable[0x97] (ZwQuerySystemInformation) to point to a replacement fnuction. The replacement function will first call the original ZwQuerySystemInformation to get an array of all loaded drivers. The driver to be hidden (i.e. the rootkit) is then removed from the array. This manipulated array is returned to the user-space program.

SDT Restoring Technique Used by POC Code

This POC code restores the values of SDT entries by writing directly to \device\physicalmemory. Hence, it works entirely in user-space and do not need to load a driver. The following steps describe how the code works.

Use NtOpenSection to get a handle to \device\physicalmemory with SECTION_MAP_READ | SECTION_MAP_WRITE access. If this fails, modify the DACL of \device\physicalmemory by adding SECTION_MAP_WRITE access permission to the current user. Try to open \device\physicalmemory again.

Load ntoskrnl.exe into memory with proper alignment and locate the address of KeServiceDescriptorTable from the export table of ntoskrnl.exe

Use NtMapViewOfSection to map in the physical memory page at the address of KeServiceDescriptorTable.

Get the address of KeServiceDescriptorTable.ServiceTable from the page.

Use NtMapViewOfSection to map in the physical memory page containing the running kernel's SerivceTable. This address is available at KeServiceDescriptorTable.ServiceTable.

Use the address of KeServiceDescriptorTable.ServiceTable to offset into the loaded ntoskrnl.exe

Loop through all entries in KeServiceDescriptorTable.ServiceTable, comparing the copy in the kernel memory with the copy in the loaded ntoskrnl.exe. Restore to kernel memory (i.e. into the mapped page) any discrepancies that are detected. This code works based on the fact that a complete original copy of the ServiceTable exists in ntoskrnl.exe.

Screen Dump

C:\>sdtrestore
SDTrestore Version 0.1 Proof-of-Concept by SIG^2 G-TEC (www.security.org.sg)

KeServiceDescriptorTable                8046DFA0
KeServiceDecriptorTable.ServiceTable    804742B8
KeServiceDescriptorTable.ServiceLimit   248

ZwAllocateVirtualMemory    10 --[hooked by unknown at F754CE74]--
ZwCreateFile               20 --[hooked by unknown at F754CA85]--
ZwCreateKey                23 --[hooked by unknown at F754CC5E]--
ZwCreateProcess            29 --[hooked by unknown at F754CDB7]--
ZwDeleteFile               34 --[hooked by unknown at F754C80C]--
ZwGetTickCount             4C --[hooked by unknown at F754CE27]--
ZwLoadDriver               55 --[hooked by unknown at F754CBF2]--
ZwQueryDirectoryFile       7D --[hooked by unknown at F754C6E8]--
ZwQuerySystemInformation   97 --[hooked by unknown at F754C623]--
ZwSetInformationFile       C2 --[hooked by unknown at F754C8A8]--

Number of Service Table entries hooked = 10

WARNING:  THIS IS EXPERIMENTAL CODE.  FIXING THE SDT MAY HAVE GRAVE
CONSEQUENCES, SUCH AS SYSTEM CRASH, DATA LOSS OR SYSTEM CORRUPTION.
PROCEED AT YOUR OWN RISK.  YOU HAVE BEEN WARNED.

Fix SDT Entries (Y/N)? : y

[+] Patched SDT entry 10 to 804A257F
[+] Patched SDT entry 20 to 80497EF9
[+] Patched SDT entry 23 to 804B2483
[+] Patched SDT entry 29 to 804A9212
[+] Patched SDT entry 34 to 804D0584
[+] Patched SDT entry 4C to 80463FF2
[+] Patched SDT entry 55 to 8052DC72
[+] Patched SDT entry 7D to 80498541
[+] Patched SDT entry 97 to 80493B5B
[+] Patched SDT entry C2 to 80498C08

Limitations

This version is tested only on English Win2K SP2 and SP4, WinXP SP0 and SP1.
THIS IS EXPERIMENTAL CODE. FIXING THE SDT MAY HAVE GRAVE CONSEQUENCES, SUCH AS SYSTEM CRASH, DATA LOSS OR SYSTEM CORRUPTION. IT IS RECOMMENDED THAT YOU USE THIS CODE ONLY ON A TEST SYSTEM. PROCEED AT YOUR OWN RISK.
2004-9-7 09:03
0
游客
登录 | 注册 方可回帖
返回
//