TopPs与Unhide
Top/Ps 与 Unhide
1. Top/Ps 命令是如何工作的
Top/Ps 命令本质是不断读取/proc/pid
下的文件信息。这是通过opendir
和readdir
两个系统调用实现的。在readdir
内部再执行以下系统调用:
stat()
确认文件openat()
打开文件句柄read()
读取内容close()
关闭文件
如此不断循环执行。
2. 产生问题
如果在某些状态下,readdir
系统调用被hook
,Top/Ps命令则无法获取到全部进程(某些进程被隐藏),此时该如何显示这些隐藏进程呢?
3. Unhide 登场
unhide 是一个小巧的网络取证工具,能够发现那些借助rootkit,LKM及其它技术隐藏的进程和TCP / UDP端口。
与Top/Ps之流不同,Unhide 并不是通过readdir
系统调用来遍历/proc
目录的,而是直接根据PID,从小到大,依次访问/proc/$pid
目录。将结果与Top命令的将结果取差集,就是那些隐藏进程了。
4. 附:Unhide使用方式
Unhide 20130526
Copyright © 2013 Yago Jesus & Patrick Gouin
License GPLv3+ : GNU GPL version 3 or later
http://www.unhide-forensics.info
NOTE : This version of unhide is for systems using Linux >= 2.6
/*******************************/
Usage: unhide [options] test_list
/*******************************/
Option :
-V Show version and exit
-v verbose
-h display this help
-m more checks (available only with procfs, checkopendir & checkchdir commands)
-r use alternate sysinfo test in meta-test
-f log result into unhide-linux.log file
-o same as '-f'
-d do a double check in brute test
Test_list :
Test_list is one or more of the following
Standard tests :
brute
proc
procall
procfs
quick
reverse
sys
Elementary tests :
checkbrute
checkchdir
checkgetaffinity
checkgetparam
checkgetpgid
checkgetprio
checkRRgetinterval
checkgetsched
checkgetsid
checkkill
checknoprocps
checkopendir
checkproc
checkquick
checkreaddir
checkreverse
checksysinfo
checksysinfo2
checksysinfo3
版权声明:
本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自
闲人亭!
喜欢就支持一下吧