日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

UNIX應(yīng)急響應(yīng)攻略( 二 )


[root@ay4z3ro foo]# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 0.2 1356 496 ? S 19:07 0:04 init
root 2 0.0 0.0 0 0 ? SW 19:07 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SWN 19:07 0:00 [ksoftirqd_CPU0]
root 4 0.0 0.0 0 0 ? SW 19:07 0:00 [kswapd]
root 5 0.0 0.0 0 0 ? SW 19:07 0:00 [bdflush]
root 6 0.0 0.0 0 0 ? SW 19:07 0:00 [kupdated]
root 7 0.0 0.0 0 0 ? SW< 19:07 0:00 [mdrecoveryd]
root 11 0.0 0.0 0 0 ? SW 19:07 0:00 [kjournald]
root 114 0.0 0.5 2108 1304 ? S 19:07 0:00 devfsd /dev
root 209 0.0 0.0 0 0 ? SW 19:07 0:00 [khubd]
root 338 0.0 0.0 0 0 ? SW 19:07 0:00 [kjournald]
rpc 620 0.0 0.2 1496 520 ? S 19:07 0:00 [portmap]
root 636 0.0 0.2 1452 624 ? S 19:07 0:00 syslogd -m 0
…………………(以下省略)
Ps命令輸出中的START字段顯示了程序開始運(yùn)行的時(shí)間 , 對(duì)于查出攻擊時(shí)間很有幫助 。有時(shí)僅通過時(shí)間就能識(shí)別可疑進(jìn)程 。
Linux下還可以通過strings –f /proc/[0-9]*/cmdline來查看系統(tǒng)中運(yùn)行進(jìn)程的完整命令行參數(shù) , 但是這個(gè)并不完全可信 。
因?yàn)楣粽呱踔敛恍枰迦雰?nèi)核模塊 , 而只在應(yīng)用層的編碼中加入語句就能欺騙我們 。
===============
檢測LKM Rootkit
===============
內(nèi)核模塊后門,還有什么比這個(gè)更臭屁的呢?Solaris,Linux和幾乎所有的Unix都支持LKM(Loadable Kernel Modules),
用普通的方法無法檢測其存在 , 這給應(yīng)急響應(yīng)帶來了極大的挑戰(zhàn)性 。對(duì)于我們來說 , 解決的辦法是找到那些lkm rootkit ,
并熟悉 , 解剖他們 。有時(shí)lkm rootkit雖然被成功裝載 , 但在系統(tǒng)的某些細(xì)節(jié)上會(huì)出現(xiàn)“異常 , 甚至可能使系統(tǒng)在運(yùn)行一段時(shí)間后徹底崩潰 。
還有 , lkm雖然活動(dòng)在ring0核心態(tài) , 但是攻擊者往往會(huì)在系統(tǒng)的某處留下痕跡 , 比如攻擊者為了讓系統(tǒng)每次關(guān)閉或重啟后能自動(dòng)裝入他安置的
內(nèi)核后門 , 可能會(huì)改寫/etc/modules.conf或/etc/rc.local.
kstat/ksec是檢測lkm非常方便的工具,前者用于Linux , 后者用于*BSD.
[root@ay4z3ro kstat]# ./kstat
Usage: ./kstat [-i iff] [-P] [-p pid] [-M] [-m addr] [-s]
-i iff may be specifIEd as 'all' or as name (e.g. eth0)
displays info about the queried interface
-P displays all processes
-p pid is the process id of the queried task
-M displays the kernel's LKMs' linked list
-m addr is the hex address of the queried module
displays info about the module to be found at addr
-s displays info about the system calls' table
其中-s參數(shù)最有用 , 它顯示了系統(tǒng)調(diào)用入口的信息 , 能檢測市面上最流行的knark和adore這兩個(gè)內(nèi)核后門 ,
但理論上他并不能檢測出所有的lkm rootkit.
Kstat/ksec站點(diǎn):http://www.s0ftpj.org
其實(shí)熟悉內(nèi)核攻擊的人都知道Kstat單純檢查sys_call_table[]的方式如今已經(jīng)
被攻擊的一方完全超越 , e4gle很早也寫過這類文章 。
有興趣可以看看2002焦點(diǎn)峰會(huì)jbtzhm的《內(nèi)核后門實(shí)現(xiàn)及其檢測》
現(xiàn)在Linuxforum安全版版主madsys在Phrack61上有篇文章:
Finding hidden kernel modules (the extrem way)--鏈接:
http://www.linuxforum.net/forum/gshowflat.php?Cat=&Board=security&Number=434871&page=0&vIEw=collapsed&sb=5&o=all&fpart=
======================
檢測開放端口和關(guān)聯(lián)進(jìn)程
======================
[root@ay4z3ro foo]# netstat –anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 620/
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 908/X
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 880/sshd
udp 0 0 0.0.0.0:111 0.0.0.0:* 620/
Active Unix domain sockets (servers and established)

推薦閱讀