ke vinsID:iiprogram
1165391次访问,排名20好友0人,关注者51
残云收夏暑,新雨带秋岚!
iiprogram的文章
原创 1359 篇
翻译 0 篇
转载 1238 篇
评论 345 篇
Kevins的公告
    留言


自2005年07月20日

Kevins的聯係方式:
unix@yiii.net


天氣預報


最近评论
niuwed:有完整的代码吗?
liuin:高人,学习了
山东啥:你好 下载已经失效了 可以再提供吗?
山东啥:你好 下载已经失效了 可以再提供吗?
山东啥:你好 下载已经失效了 可以再提供吗?
文章分类
收藏
相册
1
test
美女
*NUX技术
delphij
hitbsecconf2005
knoppix-std
linux admin
linuxsir
LWN.net
最爱chinaunix
HOT SITES
cnbeta
et8论坛
eyeos 中文
ntdebugging
rootkit
taiwan.cnet
techeblog
web代理
三联生活周刊
中国传统节日
中日文翻译
国学网
深度
看雪学院
驱动开发网
编程技术和代码下载
80x86 Opcodes
awarenetwork
bo2k-plugins
borland update site
C++/C电子书籍
c++builder 研究
chinaaspx文档
code source
codecomments
codeguru
codegurus
codeproject
coffee个人
cprogramming
crack-warez
CrackZ's Reverse Engineering
csdn
csdnbbs文档简易
dd调试技巧代码
debugman
delphi盒子
dephi goo site
diybl
Doron Holan's Blog: Kernel-Mode Drivers
driverdevelop
driverdevsite
electronicstalk_driver
EliCZ
ext2fsd
Flier's Sky
FWB
icode
itconsult_vc
jiurl系统研究
kernel resource
kernel source
kernel-mode development link
krugle.com
LCC
lookcode
mad hook api
mfc
Michael Howard's Web Log
ms_srv protocol
msdn magazine
network code
newhua_deve
ntkernel.com
osronline
pcvc
planet-source-code
putty code
reactos
RECON
reverse-engineering
shadowgo 个人blog
smartphone开发
sockaddr.com
Source Code Search Engine
tty64
tutorialdownloads
txakynetwork(driver,firewall)
undocumented.ntinternals
uty oldblog(driver&kernel)
vbs脚本
vccode
VCFORGE
vchelp
vckbase
vc-qq
vczx
vc原动力
vc原动力
vc在线
wasm.ru
webcrazyjp
Windows network services internals
世纪站长
中国站长源码
免费ie代理1
免费代理2
拼搏
操作系统开发研究
服务器开发技术
源代码
源代码下载2
电子书
编程网摘
藏鲸阁
豆豆源码
個人輔站
another blog?
个人blog-3
人气第一的台湾小美女
個人blog
個人技術輔2
资料blog
软件工具下载
0DAY 下载
0DAY-ART
chinaitpwo资料
flash下载
icwin资料
infoxa
MYEBOOK.CN
scitech.susx
soft8
source520
tooooold_searcj
torrentreactor.net
VCBOOK
xpbook
卡饭
文学ebook
核心编程
水电
源码天空
绿色下载
计算机与信息技术杂志
超好电子书籍站
非凡绿色下载
高校教材
硬件系统
hri.sourceforge.net
juniper mannel
资讯安全国内站
艾克索夫實驗室
0GINR
0ginr
0ginr论坛
51tiger.com安全
5eCur!ty Labs
5iliby
6code
77169
aloner
Alter's home page
antiprotect
astalavista
axis#ph4nt0m BLOG
ayarei/
bluehack
c.i.s.r.t
chinafe
CISRT
cncert
cto技术圈-ddos
cvcvxk
darkshell
debugman
debugman_wintools
dm-0day
dummy24
enet安全
eva
FCG
flowercode
FreeWin
friend-hsy
greatdong
h31home
H4x0r's Blog
hackee
heifou team
http://hi.baidu.com/yuange1975
huaidan's blog
icylife
inkings
insigma
internet worm
isip.cn
Juniper-bbs
kendivblog
KIJS
lenmo
loveshell
loveshell
luoluo
LYSOFT
lzx
majun 's blog
micropoint
mj0011
n4ry
NCPh
ne365-virus
neeao's blog
neeao's millow exp
Nethackonline 网络黑客在线
nop
nosec.org
open-bug
open-bug
PANTAO
raystyle
redhyphone union
regeliu
regshot
sometips
sudami
sysadmin.cn
System Repair Engineer安全检测
System Repair Engineer安全检测
T4NK's blog
team509
techtarget中文
TINK'S BLOG
unpack
unpackcn
uuty
vfocus
vxk
vxk大侠
Windows PowerShell及微软脚本
windowssky
xizi1023 blog
xwind
yiming 管理
yunshu-blog
ZUOJIE
zwell
一蓑烟雨
东来blog
中国x黑客小组
中国信息安全研究小组(CISRG)
中国信息安全组织
中国协议分析网
中国安全信息网-企业安全方案
从c开始
冷漠blog
刘涛涛blog
华夏同盟bbs
南域剑盟
危特网安
大牛蛙
安 翼 网 络
安全中国(RSS)
安全警戒
幻影
当下放下
影子鹰安全
微点blog
成都黑客在线
攻防blog
木马帝国
武汉黑客联盟
源码网
溢出专题study
白细胞
立华软件园安全防线
第八个男人
网安俱乐部
网络安全日志
艾克索夫實驗室.
补天
邪恶八进制
邪恶八进制
邪恶的hackza镜像
邪恶的oldexp
陆麟的主页
飞花堂
鬼仔blog
黑客百宝箱
資訊安全国外站
(kernel,virus code)
0DAY
158apps
62nds virus source
62nds-virus-code
advdbg.com
alexfedoto
allife(RSS)
Alter.Org.UA
anticode(RSS)
ANTIrootkit
antirootkit
ANYSIDE-EXP
anyside-exploit
arteam
astalavista.com
auscert
bifrost
bjwever
Black Hats Manual Software Security Auditing, Cracking,
blackcode.com(RSS)
blackhat mirror
blacksecurity
blogs.borland
bluemicro.digibase
bugtraq
bugtraq2
cert.org
chasenet.org-birfost
codebreakers-journal
community.reverse-engineering
Computer Forensics
computerterrorism
cool linux hack tool site
crackserver
CrackZ's Reverse Engineering
CVC电脑病毒
dark it sec
defcon
determina
dkcs security
DOXARA
eeye_0day_tra
eggheadcafe
elicz
elitehackers
elitehaven
European Hacker Conference
EVA的回收站
Evilcry
Expcode
exploit-1
exploitdatabase
foro.elhacke
Fortinet Security Research Team(RSS)
fredeyk
freexploit
freon-security
frsirt(RSS)
f-secure.weblog
Full Disclosure
full-disclosure
full-disclosure
gmc9
gmer
governmentsecurity(RSS)
h4cky0u
hackcoza
hackerscenter(RSS)
hackersclub
hackersplayground
hackwire(RSS)
haking.pl
he4dev
heapoverflow(RSS)
hexview
hick.org
hitbsecconf
hi-tech.nsys
hsc.fr(RSS)
icst.org.tw(RSS)
igniteds
infosecdaily
infosecwriters
infosyssec
insecure.org
internals
invisiblethings
jav.ch(RSS)
jeffrey.vanderstad
kd-team
l33tsecurity
labs.idefense
lcamtuf.coredump
malware analyze & reverse engineering
Mark Russinovich blog(cool)
markrussinovich
MC AV-Test site
Memory Forensic
metasploit-SHELLCODE(RSS)
microsoft安全(RSS)
milw0rm-shellcode(RSS)
MSDN杂志
msuiche
mtaulty(RSS)
mwcollect
nessus
nessus_plugin
net-security
net-security
network-file-explorers
networksecurityarchive(cool)
neworder.box.sk
neworder.box.sk
ngssoftware(RSS)
nirsoft
niscc.gov.uk(RSS)
NIST
nmd-labs
nnove-exploits
northsecuritylabs
noxusfiles
ntbugtraq
ntcore
nteam.ru
ntsecurity
Obsidis
offensivecomputing
offensivecomputing
omcd
only4gurus
Open Source Vulnerability Database
opennet.ru-exp
openrce(RSS)
openrce
openrce-articles
opensc
open-security
opferman
osvdb
packetstorm(RSS)
phenoelit.de
progenic
pulltheplug
PWDUMP6
Raymond Chen(msdn)
RECON
remoteassessment-exploit-file
remote-exploit
Reverse Compilation Techniques
reverse engineering team
ring 0 debugger
rootkit.com
rootkitunhooker(unreal)
ruder.cdut
RUS-CERT
s0ftpj.org
sabre-security
sabre-security
sec-consult(RSS)
seclist-fulldisclosure
secunia.com
secunia.com
secureworks
secureworks
securiteam
security.ittoolbox
security.nnov.ru
security.org.sg-code
securityarchitects
security-briefings
securitycatalyst(RSS)
securitydot-exploit
securityfocus(RSS)
securityforest
securitylab.ru
security-protocols(RSS)
securityreasonExploitAlert
securitysearch.net
securitytracker
sensepost
spywareinfo
Stanford's stinson
SUCK-O
sweRAT
sysinternals forum
taosecurity
taosecurity.blogspot(cool)
techmeme
techmeme.
tenablesecurity
THC(RSS)
thc.org
The 20 Most Critical Internet Security Vulnerabilities
the Month of Kernel Bugs
The Open Source Vulnerability Database
theaimsgroup bug
thebugs.ws
thenetworksecurity
tibbar(RSS)
tibbar
tippingpoint
topix-tech
triviasecurity
undergroundnews(RSS)
undocumented
undocumented.ntinternals
uninformed
uninformed
uninformed
uninformed.org
US-CERT
virustotal detect
vuln-search
VX Heavens
wd-3(RSS)
websense
WebSense Security Labs
whitehat
wilderssecurity
Win NT, Win 2000, and Win XP Security Tips
Windows network services internals
windowsecurity(RSS)
WOODMANN
woodmann.com
xatrix.org
xzziroz
yorn security
ZDNET_security
zdnet's security
zero day (RSS)
zone-h
zone-h.
反汇编引擎distorm
最新被黑站点
查询windows不明进程
汇编引擎yasm
经典phrack(RSS)
经典ussrback(RSS)
存档
订阅我的博客
XML聚合  FeedSky

原创 Rootkit 1: Detection Hide Process 收藏

新一篇: Recognizer & FS & Filter  | 旧一篇: 如何写windows系统已保护的内存区域

什么叫rootkit?   它是由有用的小型程序组成的工具包,使得攻击者能够保持访问计算机上具有最高权限的用户“root”.rootkit是能够持久或可靠地、无法检测地存在于计算机上的一组程序和代码. rootkit主要分为下列大类: 1 进程隐藏 2 文件隐藏 3 端口隐藏 4 注册表隐藏 5 驱动服务隐藏 Part I: 进程隐藏 一:序言   下列情况不在讨论之中(没进程)   1 通过CreateRemoteThread Inject代码到另一个进程(有种病毒就用这种方法,实现内存感染的;其实还有更多应用)   2 通过CreateRemoteThread LoadLibray一dll到另一个进程(屏蔽Ctrl+Alt+Del,就是通过这种方法和SetWindowLog实现) 二:进程隐藏   1 Hook/InlineHook Api NtQuerySystemInformation(taskmgr.exe就是用这个函数得到Process list)   2 Hook/InlineHook Api Process32Next   3 把要隐藏的进程的EPROCESS从LIST_ENTRY中摘除     a)ring0下驱动实现,注意:Nt/2000/xp/2003中PID和FLINK在EPROCESS中的offset不尽相同     b)ring3下利用call gate结合\Device\PhysicalMemory内核对象实现   二:检测进程隐藏   我们重要讨论一下杀毒软件Kaspersky和rootkit检测工具Icesword的两种方法:     1 kaspersky的方法:kaspersky从6.0中加入了主动防御功能,它detour了SwapContext. lkd> u KiSwapThread L20 nt!KiSwapThread: 804dd66e 8bff             mov     edi,edi 804dd670 56               push    esi 804dd671 57               push    edi 804dd672 3ea120f0dfff     mov     eax,ds:[ffdff020] 804dd678 8bf0             mov     esi,eax 804dd67a 8b4608           mov     eax,[esi+0x8] 804dd67d 85c0             test    eax,eax 804dd67f 8b7e04           mov     edi,[esi+0x4] 804dd682 0f8557ba0000     jne     nt!KiSwapThread+0x16 (804e90df) 804dd688 53               push    ebx 804dd689 0fbe5e10         movsx   ebx,byte ptr [esi+0x10] 804dd68d 33d2             xor     edx,edx 804dd68f 8bcb             mov     ecx,ebx 804dd691 e86bffffff       call    nt!KiFindReadyThread (804dd601) 804dd696 85c0             test    eax,eax 804dd698 0f843e990000     je      nt!KiSwapThread+0x2e (804e6fdc) 804dd69e 5b               pop     ebx 804dd69f 8bc8             mov     ecx,eax 804dd6a1 e80cf7ffff       call    nt!KiSwapContext (804dcdb2) 804dd6a6 84c0             test    al,al 804dd6a8 8a4f58           mov     cl,[edi+0x58] 804dd6ab 8b7f54           mov     edi,[edi+0x54] 804dd6ae 8b3570864d80     mov     esi,[nt!_imp_KfLowerIrql (804d8670)] 804dd6b4 0f85d10a0100     jne     nt!KiSwapThread+0x56 (804ee18b) 804dd6ba ffd6             call    esi 804dd6bc 8bc7             mov     eax,edi 804dd6be 5f               pop     edi 804dd6bf 5e               pop     esi 804dd6c0 c3               ret lkd> u KiSwapContext L20 nt!KiSwapContext: 804dcdb2 83ec10           sub     esp,0x10 804dcdb5 895c240c         mov     [esp+0xc],ebx 804dcdb9 89742408         mov     [esp+0x8],esi 804dcdbd 897c2404         mov     [esp+0x4],edi 804dcdc1 892c24           mov     [esp],ebp 804dcdc4 8b1d1cf0dfff     mov     ebx,[ffdff01c] 804dcdca 8bf1             mov     esi,ecx 804dcdcc 8bbb24010000     mov     edi,[ebx+0x124] 804dcdd2 89b324010000     mov     [ebx+0x124],esi 804dcdd8 8a4f58           mov     cl,[edi+0x58] 804dcddb e8d9000000       call    nt!SwapContext (804dceb9) 804dcde0 8b2c24           mov     ebp,[esp] 804dcde3 8b7c2404         mov     edi,[esp+0x4] 804dcde7 8b742408         mov     esi,[esp+0x8] 804dcdeb 8b5c240c         mov     ebx,[esp+0xc] 804dcdef 83c410           add     esp,0x10 804dcdf2 c3               ret lkd> u SwapContext L10 nt!SwapContext: 804dceb9 0ac9             or      cl,cl 804dcebb 26c6462d02       mov     byte ptr es:[esi+0x2d],0x2 804dcec0 9c               pushfd 804dcec1 8b0b             mov     ecx,[ebx] 804dcec3 e948cfa077       jmp     f7ee9e10(注意:这个地址不在NTOSKRNL.EXE范围中,落在klif.sys范围中,<它用了相对转跳,这样可以节约两个字节,cs:08>) 804dcec8 90               nop 804dcec9 90               nop 804dceca 51               push    ecx 804dcecb 0f8534010000     jne     nt!SwapContext+0x14d (804dd005) 804dced1 833d8c29568000 cmp dword ptr [nt!PPerfGlobalGroupMask (8056298c)],0x0 804dced8 0f85fe000000     jne     nt!SwapContext+0x124 (804dcfdc) 804dcede 0f20c5           mov     ebp,cr0 804dcee1 8bd5             mov     edx,ebp 804dcee3 8a4e2c           mov     cl,[esi+0x2c] 804dcee6 884b50           mov     [ebx+0x50],cl 804dcee9 fa               cli 考虑到机器的效率,SwapContext是用汇编代码实现的,看看它具体功能(实现自己看代码吧:)): ;++ ; ; Routine Description: ; ;    This routine is called to swap context from one thread to the next. ;    It swaps context, flushes the data, instruction, and translation ;    buffer caches, restores nonvolatile integer registers, and returns ;    to its caller. ; ;    N.B. It is assumed that the caller (only caller's are within this ;         module) saved the nonvolatile registers, ebx, esi, edi, and ;         ebp. This enables the caller to have more registers available. ; ; Arguments: ; ;    cl - APC interrupt bypass disable (zero enable, nonzero disable). ;    edi - Address of previous thread. ;    esi - Address of next thread. ;    ebx - Address of PCR. ; ; Return value: ; ;    al - Kernel APC pending. ;    ebx - Address of PCR. ;    esi - Address of current thread object. ; ;-- (虽然悬挂或等待的线程,不会获得cpu时间,但在SwapContext的时候仍然要检测,知道Thread了,得到对应Process也就容易了) 注:这个方法最初是J. Butler提出的,参见:http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=1232409     2 IceSword的方法:以前的方法是检测EPRCOESS,后来改成了PspCidTable      a)全局变量PspCidTable是一个HANDLE_TABLE的指针,这个变量并没有被NTOSKRNL导出,这个HANDLE_TABLE的表保存着所有进程和线程对象的指针.   b)PID(进程ID)和 ThreadID(线程ID)就是在这个句柄表中的索引,这个HANDLE_TABLE不属于任何进程,也没有链在HANDLE_TABLE链上.   c)PspCidTable在PsLookupProcessByProcessId中被用到,所以可以在此函数中搜索PspCidTalbe变量以定位其地址.   d)得到PspCidTable这个句柄表地址后,IceSword调用ExEnumHandleTable. 这个函数的函数原形是: BOOLEAN ExEnumHandleTable( IN PHANDLE_TABLE HandleTable, IN EX_ENUMERATE_HANDLE_ROUTINE EnumHandleProcedure, IN PVOID EnumParameter, OUT PHANDLE Handle OPTIONAL) 参数说明: HandleTable        : 句柄表,可以用PspCidTable做参数. EnumHandleProcedure: 类型为BOOLEAN (*EX_ENUMERATE_HANDLE_ROUTINE)(HANDLE_TALBE_ENTRY*,DWORD PID,PVOID Param)函数指针. EnumParameter      : 传送给EnumHandleProcedure函数的参数. Handle             : 此函数返回True时此参数才有效,为停止枚举前所枚举的句柄(可选). 功能说明: 调用ExEnumHandleTable函数的时,在每次枚举到表中的一个句柄时都会调用一次回调函数; 回调函数返回值为FALSE时继续枚举句柄表,返回TRUE时则停止枚举. 我们来看看他的具体实现吧! BOOLEAN ExEnumHandleTable(     IN PHANDLE_TABLE HandleTable,     IN EX_ENUMERATE_HANDLE_ROUTINE EnumHandleProcedure,     IN PVOID EnumParameter,     OUT PHANDLE Handle OPTIONAL     )

/*++

Routine Description:

    This function enumerates all the valid handles in a handle table.     For each valid handle in the handle table, the specified eumeration     function is called. If the enumeration function returns TRUE, then     the enumeration is stopped, the current handle is returned to the     caller via the optional Handle parameter, and this function returns     TRUE to indicated that the enumeration stopped at a specific handle.

Arguments:

    HandleTable - Supplies a pointer to a handle table.

    EnumHandleProcedure - Supplies a pointer to a fucntion to call for         each valid handle in the enumerated handle table.

    EnumParameter - Supplies an uninterpreted 32-bit value that is passed         to the EnumHandleProcedure each time it is called.

    Handle - Supplies an optional pointer a variable that receives the         Handle value that the enumeration stopped at. Contents of the         variable only valid if this function returns TRUE.

Return Value:

    If the enumeration stopped at a specific handle, then a value of TRUE     is returned. Otherwise, a value of FALSE is returned.

--*/

{

    PHANDLE_ENTRY HandleEntry;     BOOLEAN ResultValue;     PHANDLE_ENTRY TableEntries;     PHANDLE_ENTRY TableBound;     ULONG TableIndex;

    PAGED_CODE();

    ASSERT(HandleTable != NULL);

    //     // Lock the handle table exclusive and enumerate the handle entries.     //

    ResultValue = FALSE;     ExLockHandleTableShared(HandleTable);     TableBound = HandleTable->TableBound;     TableEntries = HandleTable->TableEntries;     HandleEntry = &TableEntries[1];     while (HandleEntry < TableBound) {         if (ExIsEntryUsed(TableEntries, TableBound, HandleEntry)) {             TableIndex = HandleEntry - TableEntries;             if ((*EnumHandleProcedure)(HandleEntry,                                         INDEX_TO_HANDLE(TableIndex),                                         EnumParameter)) {

                if (ARGUMENT_PRESENT(Handle)) {                     *Handle = INDEX_TO_HANDLE(TableIndex);                 }

                ResultValue = TRUE;                 break;             }         }

        HandleEntry += 1;     }

    ExUnlockHandleTableShared(HandleTable);     return ResultValue; } (PS:IceSword的检测方法部分参见匿名用户的文章,非常感谢!)

发表于 @ 2008年06月30日 23:45:00|评论(loading...)|收藏

新一篇: Recognizer & FS & Filter  | 旧一篇: 如何写windows系统已保护的内存区域

评论:没有评论。

发表评论  


登录
Csdn Blog version 3.1a
Copyright © Kevins