社会专题
靓丽女人 黑白社会 硬件网络 天下军事 教育咨询 星新一代 汽车电子 幽默笑话 农村特色 有书有道 软件技术 玄幻奇幻 办公达人 便民服务 免费资源 代码效果 美文园地 寻医问药 健康保健 时尚酷玩 天文地理 科技科幻 美食天下 游山玩水 历史天空 制作教程
FLASH频道
女生游戏 益智游戏 有声艺术 有声故事 电脑运用 休闲游戏 MTV类 运动游戏
聚划算
商旅游玩 装潢装饰 家电家具 服装服饰 健康保健 二手特色 生活必备 数码产品
映讯频道
喜剧片 国内片 情感片 动作片 战争片 纪录之窗 欧美剧集 明星云集 动漫片 港澳台剧 大陆剧 科幻片 恐怖片 浓缩电影 教育教学 艺术无界 一技之长 邻国热剧
下载中心
音体美合 信息社政 英语外语 科学自然 常用软件 语文数学 手机软件 红绿软件
图片中心
制作美图 生活图片 美女欣赏 实物图片 艺术欣赏 风景欣赏
领券购
热销女装 热血男装 生活必须 电子电器 手机电脑 旅游出行 学习艺术 吃货优选
新闻中心
一语惊人 奇闻趣事 热点专栏 曝光台 消费警示 今日观察 IT业界 消费主张 动态备忘 专利之窗
关闭
当前位置:首页社会专题硬件网络
有关unix中的LOG文件知识总结

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  

提示:输入修改代码都可运行!
4
酒精度
79
顶一下
相关阅读
内容加载中……