# inetd。conf this file describes the services that will be available # through the inetd tcp/ip super server. to re-configure # the running inetd process, edit this file, then send the # inetd process a sighup signal。
#
ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd # finger, systat and netstat give out user information which may be ...............
#!/bin/sh # rc。m this file is executed by init(8) when the system is being # initialized for one of the "multi user" run levels (i.e. # levels 1 through 6). it usually does mounting of file # systems et al. # start the sendmail daemon: # if [ -x /usr/sbin/sendmail ]; then # echo "starting sendmail daemon (/usr/sbin/sendmail -bd -q 15m)… " # /usr/sbin/sendmail -bd -q 15m # fi ............
# last | more fishduck ttyp6 nexus tue sep 28 16:03 still logged in birdrat ttyp5 speedy tue sep 28 15:57 still logged in root tty1 tue sep 28 12:54 still logged in 將顯示誰什么時候登陸進來,登陸了多長時間等信息。通過查看你可以發現非法登陸者信息。 你也可以查看以前的wtmp文件如wtmp.1, 你可以用命令: # last -f /var/log/wtmp.1 | more 但是你還需要注意你的log文件的狀態信息,如果它特別小 或者大小為0 則說明可能有攻擊者進入系統,并 且修改了這個文件。為了防止任何用戶修改某些文件,如對log文件只允許添加,而不允許刪除操作等等: 可以通過使用linux intrusion detection system可以防止攻擊者修改log文件password 文件等。該工具 可以在啟動lilo時來決定是否允許對某些特定文件的修改。該工具的詳細信息可以通過訪問 www.soaring-bird.com.cn/oss_proj/lids/index.html獲得。 系統的所有進程的祖父進程被成稱為"init",其進程id號是1。你可以通過下面的命令,看到init進程信息。 # ps ax | grep init 1 ? s 6:03 init 系統在啟動時的init進程將會啟動"inetd"進程,正如前面提到的該進程實現監聽網絡請求,監聽是通過網 絡端口號來實現的。 例如你telnet到你的linux服務器上時,實際上你上請求inetd進程啟動進程in.telnetd進 程在23端口來處理你的訪問請求實現通信。隨后,in.telnetd進程啟動一個詢問你的用戶名和密碼的進程, 然后你 就登陸到機器了。inetd同時監聽很多端口來等待訪問請求,然后激活完成相關服務的程序。你可 以通過查看文件/etc/services來看哪個服務使用哪個端口。從節省資源角度來說,利用一個進程而不是每 種服務對應一個進程是有意義的。 當一個攻擊者第一次訪問你的站點時,他們往往使用成為端口掃描儀的工具,通過該工具攻擊者來查看 你開放了那些系統服務。linux上比較出名的一個端口掃描儀是nmap. 可以從http://www.insecure.org/nmap/index.html下載得到該軟件,最新的版本甚至有一個圖形化 界面nmapfe。下面我們就運行nmap看可以得到什么結果: 選項'-ss',指使用tcp syn, 也就是半連接half-pen掃描, '-o',只同時探測被掃描系統的操作系統o。 (利用os指紋的技術,可以參見http://www.isbase.com/book/showqueryl.asp?libid=271)攻擊者知道了 對方使用的何種操作系統就可以有針對性的尋找該操作系統的常見漏洞
# nmap -ss -o localhost
starting nmap v. 2.3beta5 by fyodor ([email protected], www.insecure.org/nmap/) interesting ports on localhost (127.0.0.1): port state protocol service 21 open tcp ftp 23 open tcp telnet 25 open tcp smtp 53 open tcp domain 79 open tcp finger 80 open tcp http 98 open tcp linuxconf 111 open tcp sunrpc 113 open tcp auth 139 open tcp netbios-ssn 513 open tcp login 514 open tcp shell 515 open tcp printer
tcp sequence prediction: class=random positive increments difficulty=4360068 (good luck!) remote operating system guess: linux 2.1.122 - 2.2.12
nmap run completed -- 1 ip address (1 host up) scanned in 2 seconds
#!/bin/bash # # run through rpm database and report inconsistencies # for rpmlist in `rpm -qa` # these quotes are back quotes do echo " ----- $rpmlist -----" ; rpm -v $rpmlist done > /tmp/rpmverify.out