cron.2 maillog.2 netconf.log.4spooler.1 xferlog.4
cron.3 maillog.3 news spooler.2
cron.4 maillog.4 normal.log spooler.3
daily.log messages realtime.log spooler.4
daily.sh messages.1 samba transfer.log
# ls /var/run
atd.pid gpm.pid klogd.pid random-seed treemenu.cache
crond.pid identd.pid netreport runlevel.dir utmp
ftp.pids-all inetd.pid news syslogd.pid
一般我们要清除的日志有
lastlog
utmp(utmpx)
wtmp(wtmpx)
messages
syslog
sulog
一般把以上说的日志给擦一下,就能了.:)
下面我来说说上面这些我们要清除的日志的相关资料和清除方法.更周详的资料和其他的日志请你查看相关资料.
上面已对日志的功能做了简单陈述,那么这些日志文件到底记录的是什么呢?follow me
下面是个例子:
SunOS 5.7
login: gao
Password:
No directory! Logging in with home=/
Last login: Sun Feb 4 22:18:25 from 219.31.36.7
Sun Microsystems Inc. SunOS 5.7 Generic October 1998 $
然后注册程式用新的登陆时间和TTY信息更新lastlog文件,而且该程式带更新utmp wtmp.文件.
shell记录:
.sh_history(ksh),.history(csh),或.bash_history(bash)等,是shell执行时的历史记录.记录用户执行的命令.他一般存在于用户的主目录.别忘了去根目录看看.
1.日志都是一些文本形式的文件.最笨的方法是用文本编辑器来编辑日志文件.删除相关的记录.来达到擦拭脚印和隐藏自己的效果.
比如用vi等
但这样做是非常笨的.太麻烦,工作量太大.
2.用rm -f 来删掉日志.比如rm -f /usr/adm/lastlog
这样做是非常蠢的.
更容易被管理员发现有人入侵.不过,相对来说自己还是保护好了.:)
能用在一些不太重要的机器上.
3.用>定向符清除.
比如:
cat > /usr/log/lastlog
->这里输入你要的写的东西.最佳伪装得像一些,也能不输入哦.:)
^d ->这里的^d是按键 ctrl + d.
# .
4.当然最佳的是用日志清除工具.
输入几个命令让程式帮你擦:)
a.常见的日志清除工具.
下面介绍一个比较好的日志清除器.:)
http://packetstormsecurity.nl/UN ... ipers/wipe-1.00.tgz
他完万能清除
lastlog
utmp
utmpx
wtmp
wtmpx
下面我们来看看.(示范工作平台sunos 5.7)
# gzip -d wipe-1.00.tgz
# tar -xf wipe-1.00.tar
# cd wipe-1.00
# ls -al
总数32
drwxr-xr-x 2 root root 512 2月 4 20:48 .
drwxrwxrwx 6 root other 1024 2月 4 18:40 ..
-rw-r--r-- 1 root root 130 1997 1月 9 INSTALL
-rw-r--r-- 1 root staff 1389 1997 1月 9 Makefile
-rw-r--r-- 1 root root 498 1997 1月 9 README
-rw-r--r-- 1 root staff 10027 1997 1月 9 wipe.c
# make
Wipe v0.01 !
Usage: ’make ’ where System types are:
linux freebsd sunos4 solaris2 ultrix
aix irix digital bsdi netbsd hpux
#
我们能看到他需要出示 系统的选项.这些选项是:
linux freebsd sunos4 solaris2 ultrix
aix irix digital bsdi netbsd hpux
我们要清除相关的系统日志就必须在相同的系统下编译.
比如我们要在redhat等linux下编译,就应为: make linux
在freebsd下编译就应为:make freebsd
在sunos 4下编译,就应为: make sunos4
在sunos 5以上的系统里编译,就应为:make solaris2
# make solaris2
gcc -O3 -DHAVE_LASTLOG_H -DHAVE_UTMPX -o wipe wipe.c
# ls -al
总数94
drwxr-xr-x 2 root root 512 2月 4 21:03 .
drwxrwxrwx 6 root other1024 2月 4 18:40 ..
-rw-r--r-- 1 root root 130 1997 1月 9 INSTALL
-rw-r--r-- 1 root staff1389 1997 1月 9 Makefile
-rw-r--r-- 1 root root 498 1997 1月 9 README
-rwxr-xr-x 1 root other 30920 2月 4 21:03wipe