有关unix中的LOG文件知识总结(二)
>首页 -> 社会专题 -> 硬件网络 2010-07-08 来源: 作者: 【】 浏览:1468

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  

您看到此篇文章时的感受是:
Tags: 责任编辑:佚名
免责申明: 除原创及很少部分因网文图片遗失而补存外,本站不存储任何有版权的内容。你看到的文章和信息及网址索引均由机器采集自互联网,由于时间不同,内容可能完全不同,请勿拿本网内容及网址索引用于交易及作为事实依据,仅限参考,不会自行判断者请勿接受本站信息,本网转载,并不意味着赞同其观点或证实其内容的真实性.如涉及版权等问题,请立即联系管理员,我们会予以更改或删除,保证您的权利.对使用本网站信息和服务所引起的后果,本网站不作任何承诺.
首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论:0条】 【关闭】 【返回顶部
更多
上一篇覆盖Centos服务器,安装Windows s.. 下一篇实用的网络检测net命令总结
密码: (新用户注册)

最新文章

图片主题

热门文章

推荐文章

相关文章

便民服务

手机扫描

空间赞助

快速互动

论坛互动
讨论留言

有事联系

有哪个那个什么的,赶紧点这里给DOVE发消息

统计联系

MAIL:gnlt@Dovechina.com
正在线上:1360

版权与建议

任何你想说的