/l3/users/sergo/xg-ids/localhost.localdomain/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 |
|
#ls -la /etc/init.d
total 168 drwxr-xr-x 2 root root 2048 Nov 13 16:27 . drwxr-xr-x 95 root root 4096 Nov 13 16:32 .. -rw-r--r-- 1 root root 846 Sep 10 2004 README -rwxr-xr-x 1 root root 4351 Nov 10 21:01 apache2 -rwxr-xr-x 1 root root 1074 Jan 18 2002 atd -rw-r--r-- 1 root root 2593 Sep 10 2004 bootclean.sh -rwxr-xr-x 1 root root 1529 Jan 5 2005 bootlogd -rwxr-xr-x 1 root root 1371 Sep 10 2004 bootmisc.sh -rwxr-xr-x 1 root root 935 Sep 10 2004 checkfs.sh ... -rwxr-xr-x 1 root root 541 Apr 6 2006 sudo -rwxr-xr-x 1 root root 2079 Nov 13 12:34 sysklogd -rwxr-xr-x 1 root root 2567 Sep 22 03:15 syslog-ng -rwxr-xr-x 1 root root 6138 May 29 2005 udev -rwxr-xr-x 1 root root 854 May 29 2005 udev-mtab -rwxr-xr-x 1 root root 509 Sep 10 2004 umountfs -rwxr-xr-x 1 root root 1291 Sep 10 2004 umountnfs.sh -rwxr-xr-x 1 root root 1381 Sep 10 2004 urandom -rwxr-xr-x 1 root root 1805 Aug 3 01:47 x11-common -rwxr-xr-x 1 root root 1963 Oct 2 22:41 xfree86-common |
#ls -la /etc/init.d|grep cro
-rwxr-xr-x 1 root root 1096 Jul 28 2004 cron |
#/etc/init.d/cron restart
Restarting periodic command scheduler: cron. |
#apt-get install php5-extentions
Reading package lists... Done Building dependency tree... Done E: Couldn't find package php5-extentions |
#apt-get unstall php5
E: Invalid operation unstall |
#apt-get uninstall php5
E: Invalid operation uninstall |
#apt-get uninstall php5
E: Invalid operation uninstall |
#apt-get
apt 0.6.46.3 for linux i386 compiled on Nov 2 2006 11:40:57 Usage: apt-get [options] command apt-get [options] install|remove pkg1 [pkg2 ...] apt-get [options] source pkg1 [pkg2 ...] apt-get is a simple command line interface for downloading and installing packages. The most frequently used commands are update and install. Commands: update - Retrieve new lists of packages upgrade - Perform an upgrade ... -f Attempt to continue if the integrity check fails -m Attempt to continue if archives are unlocatable -u Show a list of upgraded packages as well -b Build the source package after fetching it -V Show verbose version numbers -c=? Read this configuration file -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp See the apt-get(8), sources.list(5) and apt.conf(5) manual pages for more information and options. This APT has Super Cow Powers. |
#apt-get remove php5
Reading package lists... Done Building dependency tree... Done The following packages will be REMOVED: php5 0 upgraded, 0 newly installed, 1 to remove and 347 not upgraded. Need to get 0B of archives. After unpacking 0B of additional disk space will be used. Do you want to continue [Y/n]? (Reading database ... 72069 files and directories currently installed.) Removing php5 ... |
#apt-get uninstall php4
E: Invalid operation uninstall |
#apt-get install php4
Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: libapache2-mod-php4 libzzip-0-12 php4-common Suggested packages: php-pear The following packages will be REMOVED: libapache2-mod-php5 The following NEW packages will be installed: libapache2-mod-php4 libzzip-0-12 php4 php4-common ... Selecting previously deselected package libapache2-mod-php4. Unpacking libapache2-mod-php4 (from .../libapache2-mod-php4_4%3a4.4.4-6_i386.deb) ... Selecting previously deselected package php4. Unpacking php4 (from .../php4_4%3a4.4.4-6_all.deb) ... Setting up libzzip-0-12 (0.12.83-8) ... Setting up php4-common (4.4.4-6) ... Setting up libapache2-mod-php4 (4.4.4-6) ... Creating config file /etc/php4/apache2/php.ini with new version Forcing reload of web server (apache2).... Setting up php4 (4.4.4-6) ... |
#apt-get install php4-extentions
Reading package lists... Done Building dependency tree... Done E: Couldn't find package php4-extentions |
#mc -a
|
#apt-get install php4-mysql
Reading package lists... Done Building dependency tree... Done The following NEW packages will be installed php4-mysql 0 upgraded, 1 newly installed, 0 to remove and 347 not upgraded. Need to get 18.5kB of archives. After unpacking 57.3kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! php4-mysql Install these packages without verification [y/N]? y Get: 1 http://debian.org.ua unstable/main php4-mysql 4:4.4.4-6 [18.5kB] Fetched 18.5kB in 0s (101kB/s) Selecting previously deselected package php4-mysql. (Reading database ... 72113 files and directories currently installed.) Unpacking php4-mysql (from .../php4-mysql_4%3a4.4.4-6_i386.deb) ... Setting up php4-mysql (4.4.4-6) ... |
#ps ax
PID TTY STAT TIME COMMAND 1 ? S 0:00 ini 2 ? S 0:00 [keventd] 3 ? SN 0:00 [ksoftirqd_CPU0] 4 ? S 0:00 [kswapd] 5 ? S 0:00 [bdflush] 6 ? S 0:00 [kupdated] 99 ? S 0:00 [kjournald] 121 ? S 0:00 [kjournald] 122 ? S 0:00 [kjournald] ... 13330 ? S 0:00 /usr/sbin/apache2 -k start 13331 ? S 0:00 /usr/sbin/apache2 -k start 13332 ? S 0:00 /usr/sbin/apache2 -k start 13335 ? S 0:00 /usr/sbin/apache2 -k start 13337 pts/7 S 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/m 13339 pts/7 S 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/m 13340 ? S 0:00 /usr/sbin/apache2 -k start 13342 pts/7 S 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/m 13345 pts/7 S 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/m 13346 pts/14 R+ 0:00 ps ax |
#top
top - 17:24:17 up 5:33, 5 users, load average: 0.34, 0.28, 0.31 Tasks: 128 total, 3 running, 125 sleeping, 0 stopped, 0 zombie Cpu(s): 36.4% user, 1.3% system, 0.0% nice, 62.3% idle Mem: 515716k total, 495108k used, 20608k free, 70292k buffers PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND Swap: 979924k total, 56k used, 979868k free, 255012k cached 1387 root 19 0 7520 7516 2092 S 34.8 1.5 43:18.40 l3-agent 13352 root 13 0 1120 1120 848 R 1.6 0.2 0:00.58 top 1548 root 9 0 51712 18m 2984 S 1.0 3.6 8:35.07 Xorg 12692 user 9 0 16980 16m 14m S 0.3 3.3 0:05.60 kdeinit ... 479 root 7 -4 436 436 384 S 0.0 0.1 0:00.01 udevd 575 root 9 0 0 0 0 S 0.0 0.0 0:00.00 khubd 1038 daemon 9 0 440 440 372 S 0.0 0.1 0:00.00 portmap 1229 messageb 9 0 988 988 864 S 0.0 0.2 0:00.00 dbus-daemon-1 1235 root 9 0 836 836 700 S 0.0 0.2 0:00.00 dirmngr 1271 Debian-e 9 0 1728 1724 1464 S 0.0 0.3 0:00.00 exim4 1277 root 9 0 712 712 640 S 0.0 0.1 0:00.00 inetd 1281 lp 9 0 888 888 760 S 0.0 0.2 0:00.00 lpd 1289 root 8 0 1556 1556 1428 S 0.0 0.3 0:00.01 sshd 1294 user 9 0 1612 1612 1132 S 0.0 0.3 0:03.04 famd |
#ls
dbootstrap_settings nohup.out test-syslog.sh install-report.template phpsyslogng-2.6.tar |
#apt-get install ettercap
Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: ettercap-common libnet1 libpcap0.8 The following NEW packages will be installed ettercap ettercap-common libnet1 libpcap0.8 0 upgraded, 4 newly installed, 0 to remove and 347 not upgraded. Need to get 641kB of archives. After unpacking 1933kB of additional disk space will be used. Do you want to continue [Y/n]? ... Selecting previously deselected package libpcap0.8. Unpacking libpcap0.8 (from .../libpcap0.8_0.9.5-1_i386.deb) ... Selecting previously deselected package ettercap-common. Unpacking ettercap-common (from .../ettercap-common_1%3a0.7.3-1.2_i386.deb) ... Selecting previously deselected package ettercap. Unpacking ettercap (from .../ettercap_1%3a0.7.3-1.2_i386.deb) ... Setting up libnet1 (1.1.2.1-2) ... Setting up libpcap0.8 (0.9.5-1) ... Setting up ettercap-common (0.7.3-1.2) ... Setting up ettercap (0.7.3-1.2) ... |
#ettercap -T -M arp /192.168.15.1/ /192.168.15.254/ -L log
Tue Nov 14 09:56:01 2006 UDP 192.168.15.1:32793 --> 192.168.15.254:53 | .v...........xgu.ru..... Tue Nov 14 09:56:01 2006 UDP 192.168.15.254:53 --> 192.168.15.1:32793 | .v...........xgu.ru.............&;..............&;...ns2.imena.com.ua.........&;...ns3.8........&;...ns1.8.d......&;...'.".4......&;..Q.*..R......&;..XQ.. Tue Nov 14 09:56:31 2006 UDP 192.168.15.1:32793 --> 192.168.15.254:53 | .w...........xgu.ru..... Tue Nov 14 09:56:35 2006 ... Tue Nov 14 09:56:52 2006 UDP 192.168.15.1:32793 --> 192.168.15.254:53 | .x...........xgu.ru..... Tue Nov 14 09:56:52 2006 UDP 192.168.15.254:53 --> 192.168.15.1:32793 | .x...........xgu.ru.............&...............&....ns3.imena.com.ua.........&....ns1.8........&....ns2.8.R......&....'.".d......&...Q.*..4......&...XQ.. Closing text interface... ARP poisoner deactivated. RE-ARPing the victims... Unified sniffing was stopped. |
#ld
ld: no input files |
#ls
dbootstrap_settings log.eci nohup.out test-syslog.sh install-report.template log.ecp phpsyslogng-2.6.tar |
#etterlog log.eci | more
|
#lz
Reading directory of standard input. gzip: compressed data not read from a terminal. Use -f to force decompression. For help, type: gzip -h |
#ls
1.txt install-report.template log.ecp phpsyslogng-2.6.tar dbootstrap_settings log.eci nohup.out test-syslog.sh |
#more 1.txt
|
#apt-get install john
Reading package lists... Done Building dependency tree... Done The following NEW packages will be installed john 0 upgraded, 1 newly installed, 0 to remove and 347 not upgraded. Need to get 553kB of archives. After unpacking 1098kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! john Install these packages without verification [y/N]? Y Get: 1 http://debian.org.ua unstable/main john 1.6-40 [553kB] Fetched 553kB in 3s (177kB/s) Preconfiguring packages ... Selecting previously deselected package john. (Reading database ... 72241 files and directories currently installed.) Unpacking john (from .../archives/john_1.6-40_i386.deb) ... Setting up john (1.6-40) ... |
#john --user=user /etc/shadow
Loaded 1 password (FreeBSD MD5 [32/32]) password (user) guesses: 1 time: 0:00:00:00 100% (2) c/s: 2622 trying: password |
#john 1.txt
(SEDUN:2) (SERGEI:1) (SERGEI:2) (SERGEINB:1) (SERGEINB:2) (Serj:2) (SERJ:1) (SERJ:2) (Shulga:2) (Siryk:2) ... GAVRILO (inf6a:1) _49 (ned:2) RNIZM (servicerunner:2) GE[ (tota:1) FYUTK (Kiss5:1) MARTYNO (info04:1) PETLITS (info03:1) UFKBY (Galin:1) guesses: 467 time: 0:00:07:27 (3) c/s: 79997779 trying: SIKSKRE - DDGSSOR Session aborted |
#telnet 192.168.15.254
Trying 192.168.15.254... Connected to 192.168.15.254. Escape character is '^]'. Debian GNU/Linux testing/unstable herz.linux.nt login: user Password: Last login: Mon Nov 13 09:53:24 2006 from 192.168.15.193 on pts/3 Linux herz.linux.nt 2.6.17-prexen #3 PREEMPT Thu Aug 10 00:28:25 EEST 2006 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. No mail. Agent pid 13683 user@herz:~$ exit logout Connection closed by foreign host. |
#arp -an
? (192.168.15.1) at 00:0A:01:D4:D3:6F [ether] on eth0 ? (192.168.15.254) at 00:0A:01:D4:D3:6F [ether] on eth0 |
#telnet 192.168.15.254
Trying 192.168.15.254... Connected to 192.168.15.254. Escape character is '^]'. Debian GNU/Linux testing/unstable herz.linux.nt login: user Password: Last login: Tue Nov 14 10:12:23 2006 from linux2.linux.nt on pts/3 Linux herz.linux.nt 2.6.17-prexen #3 PREEMPT Thu Aug 10 00:28:25 EEST 2006 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. No mail. Agent pid 13683 user@herz:~$ exit logout Connection closed by foreign host. |
#ls -la
total 682 drwxr-xr-x 11 root root 1024 2006-11-14 10:17 . drwxr-xr-x 21 root root 1024 2006-11-13 13:52 .. -rw------- 1 root root 25869 2006-11-14 10:00 1.txt drwx------ 2 root root 1024 2006-11-13 08:59 .aptitude -rw------- 1 root root 7948 2006-11-13 17:51 .bash_history -rw-r--r-- 1 root root 22 2006-11-13 11:21 .bash_profile -rw-r--r-- 1 root root 450 2006-11-13 11:21 .bashrc -rw-r--r-- 1 root root 179 2006-11-12 21:16 dbootstrap_settings drwx------ 2 root root 1024 2006-11-13 11:18 .gconf ... -rw------- 1 root root 2688 2006-11-14 09:56 log.ecp drwxr-xr-x 3 root root 1024 2006-11-13 17:19 .mc -rw------- 1 root root 5325 2006-11-13 16:45 .mysql_history -rw------- 1 root root 431343 2006-11-13 17:51 nohup.out -rw-r--r-- 1 root root 163840 2005-06-16 03:45 phpsyslogng-2.6.tar -rw-r--r-- 1 root root 110 2004-11-10 18:10 .profile -rw------- 1 root root 80 2006-11-14 10:11 restore drwx------ 2 root root 1024 2006-11-13 09:37 .ssh -rwxr--r-- 1 root root 274 2006-11-13 14:44 test-syslog.sh -rw------- 1 root root 9123 2006-11-13 17:10 .viminfo |
#vi ~/.l3rc
1c1 < l3cd=/users/sergo/xg-ids/localhost.localdomain/root --- > l3cd=/users/sergo/xg-ids/linux2.unix.nt/root |
#ls
1.txt john.pot nohup.out test-syslog.sh dbootstrap_settings log.eci phpsyslogng-2.6.tar install-report.template log.ecp restore |
#etterlog log.ecp|more
|
#apt-cache stat
E: Invalid operation stat |
#vi ~user/.l3rc
1c1 < l3cd=/users/sergo/xg-ids/localhost.localdomain/user --- > l3cd=/users/sergo/xg-ids/linux2.unix.nt/user |
#vi ~/.l3rc
|
#pkill -1 l3-agent
|
#apt-
apt-cache apt-extracttemplates apt-key apt-cdrom apt-ftparchive apt-sortpkgs apt-config apt-get |
#man atp-cache
|
#man apt-cache
|
#apt-cache stats
Total package names : 28579 (1143k) Normal packages: 22294 Pure virtual packages: 1026 Single virtual packages: 923 Mixed virtual packages: 541 Missing: 3795 Total distinct versions: 34634 (1662k) Total dependencies: 230046 (6441k) Total ver/file relations: 37064 (593k) Total Provides mappings: 6652 (133k) Total globbed strings: 99 (1098) Total dependency version space: 964k Total slack space: 74.9k Total space accounted for: 10.0M |
#apt-cache search arpwatch
arpwatch - Ethernet/FDDI station activity monitor |
#apt-get install arpwatch
Reading package lists... Done Building dependency tree... Done Suggested packages: snmp The following NEW packages will be installed arpwatch 0 upgraded, 1 newly installed, 0 to remove and 347 not upgraded. Need to get 124kB of archives. After unpacking 389kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! arpwatch Install these packages without verification [y/N]? Y Get: 1 http://debian.org.ua stable/main arpwatch 2.1a13-2 [124kB] Fetched 124kB in 1s (83.0kB/s) Selecting previously deselected package arpwatch. (Reading database ... 72285 files and directories currently installed.) Unpacking arpwatch (from .../arpwatch_2.1a13-2_i386.deb) ... Setting up arpwatch (2.1a13-2) ... Starting Ethernet/FDDI station monitor daemon: (chown arpwatch /var/lib/arpwatch/arp.dat) arpwatch. |
#tail /var/log/messages
Nov 14 09:38:24 linux2 kernel: pci_hotplug: PCI Hot Plug PCI Core version: 0.5 Nov 14 09:38:24 linux2 kernel: pci_hotplug: PCI Hot Plug PCI Core version: 0.5 Nov 14 09:38:32 linux2 lpd[2601]: restarted Nov 14 09:38:36 linux2 kernel: apm: BIOS version 1.2 Flags 0x07 (Driver version 1.16) Nov 14 09:39:08 linux2 kernel: inserting floppy driver for 2.4.27-2-686 Nov 14 09:39:08 linux2 kernel: Floppy drive(s): fd0 is 1.44M Nov 14 09:39:08 linux2 kernel: FDC 0 is a post-1991 82077 Nov 14 09:55:14 linux2 kernel: eth0: Setting promiscuous mode. Nov 14 09:55:14 linux2 kernel: device eth0 entered promiscuous mode Nov 14 09:57:05 linux2 kernel: device eth0 left promiscuous mode |
#tail /var/log/syslog
Nov 14 09:55:14 linux2 kernel: device eth0 entered promiscuous mode Nov 14 09:57:05 linux2 kernel: device eth0 left promiscuous mode Nov 14 10:09:02 linux2 /USR/SBIN/CRON[3624]: (root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm) Nov 14 10:09:02 linux2 /USR/SBIN/CRON[3625]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm) Nov 14 10:17:01 linux2 /USR/SBIN/CRON[3682]: (root) CMD ( run-parts --report /etc/cron.hourly) Nov 14 10:30:07 linux2 arpwatch: Running as uid=107 gid=109 Nov 14 10:30:07 linux2 arpwatch: listening on eth0 Nov 14 10:30:24 linux2 arpwatch: new station 192.168.15.254 0:a:1:d4:d1:39 eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.1 0:a:1:d4:d3:6f eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.2 0:4:76:a1:f2:5a eth0 |
#tail -f /var/log/syslog
Nov 14 09:55:14 linux2 kernel: device eth0 entered promiscuous mode Nov 14 09:57:05 linux2 kernel: device eth0 left promiscuous mode Nov 14 10:09:02 linux2 /USR/SBIN/CRON[3624]: (root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm) Nov 14 10:09:02 linux2 /USR/SBIN/CRON[3625]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm) Nov 14 10:17:01 linux2 /USR/SBIN/CRON[3682]: (root) CMD ( run-parts --report /etc/cron.hourly) Nov 14 10:30:07 linux2 arpwatch: Running as uid=107 gid=109 Nov 14 10:30:07 linux2 arpwatch: listening on eth0 Nov 14 10:30:24 linux2 arpwatch: new station 192.168.15.254 0:a:1:d4:d1:39 eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.1 0:a:1:d4:d3:6f eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.2 0:4:76:a1:f2:5a eth0 Nov 14 10:32:09 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#mail
No mail for root |
#su - user
|
$mail
Mail version 8.1.2 01/15/2001. Type ? for help. "/var/mail/user": 5 messages 5 new >N 1 root@localhost.lo Mon Nov 13 11:13 22/908 Debconf: Configuring mozi N 2 arpwatch@localhos Tue Nov 14 10:30 20/802 new station (linux.nt) et N 3 arpwatch@localhos Tue Nov 14 10:31 20/814 new station (linux1.linux N 4 arpwatch@localhos Tue Nov 14 10:31 20/818 new station (linux2.linux N 5 arpwatch@localhos Tue Nov 14 10:32 24/984 changed ethernet address & t 5 Message 5: From arpwatch@localhost.localdomain Tue Nov 14 10:32:09 2006 ... ethernet address: 0:a:1:d4:d3:6f ethernet vendor: Sohoware, Inc. old ethernet address: 0:a:1:d4:d1:39 old ethernet vendor: Sohoware, Inc. timestamp: Tuesday, November 14, 2006 10:32:09 +0200 previous timestamp: Tuesday, November 14, 2006 10:30:24 +0200 delta: 1 minute & q Saved 1 message in /home/user/mbox Held 4 messages in /var/mail/user |
$exit
exit |
#tail -f /var/log/syslog
Nov 14 10:17:01 linux2 /USR/SBIN/CRON[3682]: (root) CMD ( run-parts --report /etc/cron.hourly) Nov 14 10:30:07 linux2 arpwatch: Running as uid=107 gid=109 Nov 14 10:30:07 linux2 arpwatch: listening on eth0 Nov 14 10:30:24 linux2 arpwatch: new station 192.168.15.254 0:a:1:d4:d1:39 eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.1 0:a:1:d4:d3:6f eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.2 0:4:76:a1:f2:5a eth0 Nov 14 10:32:09 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:22 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:23 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:24 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#vi /etc/syslog-ng/syslog-ng.conf
|
#vi /usr/local/bin/myscript
5,6c5 < echo $line | grep -q arpwatch && echo Nuzhno proverit ARP >> /tmp/myscript.log < echo $line | grep -q arpwatch && echo Nuzhno proverit ARP | gnokii --sendsms +380671234567 --- > echo $line | grep -q 'arpwatch: changed ethernet address' && echo Pomenyalsya adres $line > /tmp/arplog |
#tail /var/log/syslog
Nov 14 10:17:01 linux2 /USR/SBIN/CRON[3682]: (root) CMD ( run-parts --report /etc/cron.hourly) Nov 14 10:30:07 linux2 arpwatch: Running as uid=107 gid=109 Nov 14 10:30:07 linux2 arpwatch: listening on eth0 Nov 14 10:30:24 linux2 arpwatch: new station 192.168.15.254 0:a:1:d4:d1:39 eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.1 0:a:1:d4:d3:6f eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.2 0:4:76:a1:f2:5a eth0 Nov 14 10:32:09 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:22 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:23 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:24 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#cat | logger -t arpwatch
changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#tail /var/log/syslog
Nov 14 10:30:07 linux2 arpwatch: Running as uid=107 gid=109 Nov 14 10:30:07 linux2 arpwatch: listening on eth0 Nov 14 10:30:24 linux2 arpwatch: new station 192.168.15.254 0:a:1:d4:d1:39 eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.1 0:a:1:d4:d3:6f eth0 Nov 14 10:31:06 linux2 arpwatch: new station 192.168.15.2 0:4:76:a1:f2:5a eth0 Nov 14 10:32:09 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:22 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:23 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:33:24 linux2 arpwatch: ethernet mismatch 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 Nov 14 10:36:42 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#ls /tmp
kde-user lost+found ssh-SBZicH2686 zman3Q2zp9 ksocket-user myscript.log ssh-vvtfby2686 |
#vi /usr/local/bin/myscript
|
#ls /tmp
kde-user lost+found ssh-SBZicH2686 zman3Q2zp9 ksocket-user myscript.log ssh-vvtfby2686 |
#/etc/init.d/syslog-ng restart
Stopping system logging: syslog-ng. Starting system logging: syslog-ng. |
#cat | logger -t arpwatch
changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#ls /tmp
arplog ksocket-user myscript.log ssh-vvtfby2686 kde-user lost+found ssh-SBZicH2686 zman3Q2zp9 |
#cat /tmp/arplog
Pomenyalsya adres Nov 14 10:37:27 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#vi /usr/local/bin/myscript
5c5,9 < echo $line | grep -q 'arpwatch: changed ethernet address' && echo Pomenyalsya adres $line > /tmp/arplog --- > echo $line | grep -q 'arpwatch: changed ethernet address' && echo Pomenyalsya adres $line >> /tmp/arplog > set $line > echo ip=$9 >> /tmp/arplog > shift > echo mac=$9 >> /tmp/arplog |
#cat | logger -t arpwatch
changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#/etc/init.d/syslog-ng
Stopping system logging: syslog-ng. Starting system logging: syslog-ng. |
#cat | logger -t arpwatch
changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 |
#cat /tmp/arplog
Pomenyalsya adres Nov 14 10:38:58 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 ip=version='2.0rc3' mac= Pomenyalsya adres Nov 14 10:39:05 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 ip=192.168.15.254 mac=0:a:1:d4:d3:6f |
#ssh user@192.168.15.254
Password: Linux herz.linux.nt 2.6.17-prexen #3 PREEMPT Thu Aug 10 00:28:25 EEST 2006 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. No mail. Last login: Tue Nov 14 10:16:54 2006 from linux2.linux.nt Agent pid 13683 user@herz:~$ su - Password: -su: l3-agent: command not found |
#minicom
** Line 2 of the глобальном config file not understood |
#LANG=C
|
#minicom
** Line 2 of the global config file not understood Device /dev/ttyS0 is locked. |
#minicom
Welcome to minicom 2.1 OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n Compiled on Nov 4 2005, 18:10:30. Press CTRL-A Z for help on special keys CTRL-A Z for help | 38400 8N1 | NOR | Minicom 2.1 | VT102 | Offline |
#apt-cache search snmp util
ap-utils - Access Point SNMP Utils for Linux iptotal - monitor for IP traffic, not requiring SNMP npadmin - Query information from SNMP featured printer netwox - networking utilities scli - a collection of SNMP command line management tools tinysnmp-tools - TinySNMP Utilities |
#apt-cache search snmp tool
iptotal - monitor for IP traffic, not requiring SNMP npadmin - Query information from SNMP featured printer cacti - Frontend to rrdtool for monitoring systems and services cpqarrayd - monitoring tool for HP (Compaq) SmartArray controllers ifstat - InterFace STATistics Monitoring mrtg - multi router traffic grapher munin-node - network-wide graphing framework (node) netwox - networking utilities netwox-doc - documentation for netwox toolbox nut-snmp - A meta SNMP Driver subsystem for the nut - Network UPS Tools ... python-pysnmp4 - Python SNMP library for agents and managers (unstable branch) python-pysnmp4-doc - Python SNMP library for agents and managers (unstable branch) scli - a collection of SNMP command line management tools spong-www - A systems and network monitoring system -- web interface tcpdump - A powerful tool for network monitoring and data acquisition tinysnmp-tools - TinySNMP Utilities tkmib - NET SNMP (Simple Network Management Protocol) MIB Browser torrus-apache - Universal front-end for Round-Robin Databases (for apache 1.x) torrus-apache2 - Universal front-end for Round-Robin Databases (for apache 2.x) torrus-common - Universal front-end for Round-Robin Databases (common files) |
#apt-cache search net-snmp
libsnmp4.2 - NET SNMP (Simple Network Management Protocol) Library libsnmp4.2-dev - NET SNMP (Simple Network Management Protocol) Development Files libgsnmp0 - an SNMP library implementation based on glib and gnet libgsnmp0-dev - an SNMP library implementation based on glib and gnet (development files) libnet-snmp-perl - Script SNMP connections libsnmp-ruby - simple network management protocol bindings for ruby libsnmp-ruby1.8 - simple network management protocol bindings for ruby 1.8 mbrowse - a SNMP MIB browser |
#apt-cache search ucd-snmp
|
#apt-cache search snmp | less
|
#apt-get install snmp
Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: libsnmp-base libsnmp9 The following NEW packages will be installed libsnmp-base libsnmp9 snmp 0 upgraded, 3 newly installed, 0 to remove and 347 not upgraded. Need to get 3959kB of archives. After unpacking 7754kB of additional disk space will be used. Do you want to continue [Y/n]? ... Selecting previously deselected package libsnmp-base. (Reading database ... 72310 files and directories currently installed.) Unpacking libsnmp-base (from .../libsnmp-base_5.2.3-2_all.deb) ... Selecting previously deselected package libsnmp9. Unpacking libsnmp9 (from .../libsnmp9_5.2.3-2_i386.deb) ... Selecting previously deselected package snmp. Unpacking snmp (from .../archives/snmp_5.2.3-2_i386.deb) ... Setting up libsnmp-base (5.2.3-2) ... Setting up libsnmp9 (5.2.3-2) ... Setting up snmp (5.2.3-2) ... |
#. /etc/bash_completion
|
#vi /root/.bashrc
|
#vi /etc/bash.bashrc
|
#vi /etc/bash.bashrc
Vot tak vklyuchaetsya bash_completion |
#ping 192.168.15.200
PING 192.168.15.200 (192.168.15.200) 56(84) bytes of data. 64 bytes from 192.168.15.200: icmp_seq=1 ttl=255 time=2.68 ms --- 192.168.15.200 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 2.680/2.680/2.680/0.000 ms |
#snmpget
snmpget snmpgetnext |
#snmpget
snmpget snmpgetnext |
#snmpget -v2c -c public 192.168.15.200 sysName.0
SNMPv2-MIB::sysName.0 = STRING: Switch |
#snmpget -v2c -c public 192.168.15.200 sysLocatiom.0
sysLocatiom.0: Unknown Object Identifier (Sub-id not found: (top) -> sysLocatiom) |
#snmpget -v2c -c public 192.168.15.200 sysLocation.0
SNMPv2-MIB::sysLocation.0 = STRING: Kiev, Pobedy av., 53, 4th floor |
#snmpget -v2c -c public 192.168.15.200 sysContact.0
SNMPv2-MIB::sysContact.0 = STRING: Igor Chubin igor@chub.in |
#vi cisco-show-run
|
#snmpwalk -v2c -c public 192.168.15.200 .
SNMPv2-SMI::transmission.7.2.1.10.19 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.10.20 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.10.21 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.10.22 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.10.23 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.10.24 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.10.25 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.11.1 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.11.2 = Counter32: 0 SNMPv2-SMI::transmission.7.2.1.11.3 = Counter32: 0 ... SNMPv2-SMI::mib-2.17.1.4.1.1.26 = INTEGER: 26 SNMPv2-SMI::mib-2.17.1.4.1.1.27 = INTEGER: 27 SNMPv2-SMI::mib-2.17.1.4.1.1.28 = INTEGER: 28 SNMPv2-SMI::mib-2.17.1.4.1.1.29 = INTEGER: 29 SNMPv2-SMI::mib-2.17.1.4.1.1.31 = INTEGER: 31 SNMPv2-SMI::mib-2.17.1.4.1.1.32 = INTEGER: 32 SNMPv2-SMI::mib-2.17.1.4.1.1.33 = INTEGER: 33 SNMPv2-SMI::mib-2.17.1.4.1.1.34 = INTEGER: 34 SNMPv2-SMI::mib-2.17.1.4.1.1.35 = INTEGER: 35 SNMPv2-SMI::mib-2.17.1.4.1.1.36 = INTEGER: 36 |
#snmpwalk -v2c -c public 192.168.15.200 . | wc -l
11669 |
#vi /usr/local/bin/get-port-by-mac
5c5 < my $SNMP_switch="192.168.15.99"; --- > my $SNMP_switch="192.168.15.200"; |
Pomenyalsya adres Nov 14 10:38:58 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 ip=version='2.0rc3' mac= Pomenyalsya adres Nov 14 10:39:05 linux2 arpwatch: changed ethernet address 192.168.15.254 0:a:1:d4:d3:6f (0:a:1:d4:d1:39) eth0 ip=192.168.15.254 mac=0:a:1:d4:d3:6f
Время первой команды журнала | 16:51:08 2006-11-13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 11:30:19 2006-11-14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 17.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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