# 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