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

Содержание

Журнал

Вторник (08/11/09)

/dev/ttyp4
09:39:13
$ls -l /etc/passwd
-rw-r--r-- 1 root root 9392 2009-08-11 10:13 /etc/passwd
09:39:17
$vim /etc/passwd
09:39:26
$man 5
09:39:46
$man -
09:39:58
$man 8 inetd
09:41:11
$sudo netstat -lnp | less
09:41:26
$nc 127.0.0.1 bash
Use of uninitialized value in concatenation (.) or string at /etc/lilalo/l3config.pm line 12.
Can't open pidfile /tmp/.lilalo/l3-agent.pid for wrting: No such file or directory at /usr/local/bin/l3-agent line 922.
/root/.bash_profile: line 2: .bashrc: No such file or directory
ls -l;
итого 16
drwxr-xr-x   2 root root 2504 2009-08-10 14:50 bin
drwxr-xr-x   2 root root   48 2006-10-28 17:06 boot
drwxr-xr-x  10 root root 2820 2009-08-11 09:19 dev
drwxr-xr-x  59 root root 3496 2009-08-11 10:38 etc
drwxr-xr-x 205 root root 4920 2008-03-14 11:04 home
...
drwxr-xr-x   7 root root  400 2008-12-22 14:57 root
drwxr-xr-x   2 root root 2880 2009-08-10 14:50 sbin
drwxr-xr-x   2 root root   48 2007-12-23 16:30 srv
drwxr-xr-x  12 root root    0 2009-08-11 09:19 sys
drwxrwxrwt   5 root root  280 2009-08-11 10:41 tmp
drwxr-xr-x  11 root root  264 2007-12-23 16:42 usr
drwxr-xr-x  13 root root  312 2008-03-14 16:53 var
PS1=inetd_shell$
echo $PS1
inetd_shell$
09:42:23
$echo $PS1

09:42:36
$ssh 10.0.17.100
user@10.0.17.100's password:
09:43:59
$nc 127.0.0.1 bash
Use of uninitialized value in concatenation (.) or string at /etc/lilalo/l3config.pm line 12.
Can't open pidfile /tmp/.lilalo/l3-agent.pid for wrting: No such file or directory at /usr/local/bin/l3-agent line 922.
/root/.bash_profile: line 2: .bashrc: No such file or directory
ls -l
итого 16
drwxr-xr-x   2 root root 2504 2009-08-10 14:50 bin
drwxr-xr-x   2 root root   48 2006-10-28 17:06 boot
drwxr-xr-x  10 root root 2820 2009-08-11 09:19 dev
drwxr-xr-x  59 root root 3496 2009-08-11 10:38 etc
drwxr-xr-x 205 root root 4920 2008-03-14 11:04 home
...
drwxr-xr-x  11 root root  264 2007-12-23 16:42 usr
drwxr-xr-x  13 root root  312 2008-03-14 16:53 var
ping ya.ru -c 3
PING ya.ru (213.180.204.8) 56(84) bytes of data.
64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=50 time=48.8 ms
64 bytes from ya.ru (213.180.204.8): icmp_seq=2 ttl=50 time=48.3 ms
64 bytes from ya.ru (213.180.204.8): icmp_seq=3 ttl=50 time=48.3 ms
--- ya.ru ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 48.306/48.503/48.808/0.283 ms
09:44:23
$nc 192.168.16.1 65534

09:49:22
$whereis inetd
inetd: /usr/sbin/inetd /etc/inetd.conf /usr/share/man/man8/inetd.8.gz
09:49:38
$file /usr/sbin/inetd
/usr/sbin/inetd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped
09:49:46
$ldd /usr/sbin/inetd
        linux-gate.so.1 =>  (0xb7f87000)
        libwrap.so.0 => /lib/libwrap.so.0 (0xb7f78000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e44000)
        libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7e2d000)
        /lib/ld-linux.so.2 (0xb7f88000)
09:50:00
$vim /etc/ld.so.conf
09:51:18
$sudo ldconfig
  1 # Multiarch support
  2 /lib/i486-linux-gnu
  3 /usr/lib/i486-linux-gnu                                      (netrw v98)
"   /etc/ld.so.conf.d
"   Sorted by      name
"   Sort sequence: [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
~
~
~
~
~
~
~
~
~
~
~
~
<d.so.conf.d/i486-linux-gnu.conf" [только для чтения] 3L, 64C
09:51:23
$ldd /usr/sbin/inetd
        linux-gate.so.1 =>  (0xb7fca000)
        libwrap.so.0 => /lib/libwrap.so.0 (0xb7fbb000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e87000)
        libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7e70000)
        /lib/ld-linux.so.2 (0xb7fcb000)
09:51:34
$vim /etc/hosts
09:51:56
$whereis apt
apt: /etc/apt /usr/lib/apt /usr/share/apt /usr/share/man/man8/apt.8.gz
09:51:59
$whereis apt-get
apt-get: /usr/bin/apt-get /usr/X11R6/bin/apt-get /usr/bin/X11/apt-get /usr/share/man/man8/apt-get.8.gz
09:52:12
$ldd /usr/bin/apt-get
        linux-gate.so.1 =>  (0xb7f33000)
        libapt-pkg-libc6.3-6.so.3.11 => /usr/lib/libapt-pkg-libc6.3-6.so.3.11 (0xb7e69000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7d84000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7d5e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7d53000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7c1f000)
        /lib/ld-linux.so.2 (0xb7f34000)
09:52:18
$whereis ssh
ssh: /usr/bin/ssh /etc/ssh /usr/X11R6/bin/ssh /usr/bin/X11/ssh /usr/share/man/man1/ssh.1.gz
09:52:25
$ldd /usr/bin/ssh
        linux-gate.so.1 =>  (0xb7f8a000)
        libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7f70000)
        libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7e36000)
        libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0xb7e31000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7e1d000)
        libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7e07000)
        libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb7dd9000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xb7dbd000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xb7d41000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xb7d1b000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0xb7d18000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xb7d13000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7bdf000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7bdb000)
        /lib/ld-linux.so.2 (0xb7f8b000)
09:52:31
$vim /etc/ld.so.conf.d/
09:53:10
$nc 127.0.0.1 bash
 14 # address.
 15
 16 # You may wish to enable this to ensure any programs that don't
 17 # validate looked up hostnames still leave understandable logs. In past
 18 # versions of Debian this has been the default.
 20 ALL: ALL
~
~
"/etc/hosts.deny" 20L, 910C записано
Use of uninitialized value in concatenation (.) or string at /etc/lilalo/l3config.pm line 12.
Can't open pidfile /tmp/.lilalo/l3-agent.pid for wrting: No such file or directory at /usr/local/bin/l3-agent line 922.
/root/.bash_profile: line 2: .bashrc: No such file or directory
09:53:19
$sudo vim /etc/inetd.conf
09:54:14
$sudo /etc/init.d/openbsd-inetd restart
Restarting internet superserver: inetd.
09:54:33
$sudo vim /etc/hosts.allow
09:55:12
$nc 127.0.0.1 65534
[user@debian1:~]$ nc 127.0.0.1 bash
dircolors: либо переменная окружения SHELL отсутствует, либо не задан тип интерпретатора
debian1:/# exit
dircolors: либо переменная окружения SHELL отсутствует, либо не задан тип интерпретатора
debian1:/# exit
09:56:18
$nc 127.0.0.1 65534
 32
 33 #:RPC: RPC based services
 34
 35 #:HAM-RADIO: amateur-radio services
 36
    once -geometry 1024x768 -depth 24
 37 #:OTHER: Other services
 40 bash  stream tcp  nowait root  /usr/sbin/tcpd /bin/bash -i
 38
dircolors: либо переменная окружения SHELL отсутствует, либо не задан тип интерпретатора
 39 #vnc1 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd  -query 127.0.0.1 --
ls -l
09:56:27
$sudo vim /etc/hosts.allow
10:01:28
$ssh 192.168.16.21
   been installed, they're also available formatted in /usr/share/doc.
If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list.  If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page.  If you are not familiar with manual pages, type `man man'.
You may also use sysinstall(8) to re-enter the installation and
configuration utility.  Edit /etc/motd to change this login announcement.
прошла 21 минута
10:23:06
#[user@fbsd1:~]$ sudo apt-get install mc
|www|           Vim on the World Wide Web
|bugs|          Where to send bug reports
USER MANUAL: These files explain how to accomplish an editing task.
|usr_toc.txt|   Table Of Contents
Getting Started
|usr_01.txt|  About the manuals
|copying|d.conf About copyrights
Password:" [readonly] 216 lines, 8010 characters
sudo: apt-get: command not found
10:23:57
#[user@fbsd1:~]$ apt-get
[user@fbsd1:~]$ apt-get install
bash: apt-get: ËÏÍÁÎÄÁ ÎÅ ÎÁÊÄÅÎÁ
bash: apt-get: ËÏÍÁÎÄÁ ÎÅ ÎÁÊÄÅÎÁ
10:26:17
$ssh 192.168.16.21
[user@fbsd1:~]$ exit
exit
Connection to 192.168.16.21 closed.
Password:
Last login: Tue Aug 11 11:01:39 2009 from 192.168.16.1
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.  All rights reserved.
FreeBSD 6.3-RELEASE (SMP) #0: Wed Jan 16 04:45:45 UTC 2008
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
...
   http://www.FreeBSD.org/search/.  If the doc distribution has
   been installed, they're also available formatted in /usr/share/doc.
If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list.  If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page.  If you are not familiar with manual pages, type `man man'.
You may also use sysinstall(8) to re-enter the installation and
configuration utility.  Edit /etc/motd to change this login announcement.
Removing stale pidfile
10:27:05
#[user@fbsd1:~]$ vim /etc/rc.d/inetd
load_rc_config $name
run_rc_command "$1"
~
~
10:27:39
#[user@fbsd1:~]$

10:27:39
#[user@fbsd1:~]$

10:28:15
#[user@fbsd1:~]$ exit
[user@fbsd1:~]$ grep inetd /etc/defaults/rc.conf
inetd_enable="NO"               # Run the network daemon dispatcher (YES/NO).
inetd_program="/usr/sbin/inetd" # path to inetd, if you want a different one.
inetd_flags="-wW -C 60"         # Optional flags to inetd
exit
Connection to 192.168.16.21 closed.
10:28:48
$apt-get install xinetd
E: Не могу открыть файл блокировки /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
10:29:28
$vim /etc/xinetd.
10:29:56
$vim /etc/syslog.conf
10:30:52
$vim /etc/xinetd.conf
10:31:01
$vim /etc/xinetd.d/
10:31:01
$vim /etc/xinetd.d/
10:31:49
$vim /etc/xinetd.d/time
10:32:42
$apt-get install xco
xcolmix       xcolorsel     xconq-common  xcontrib
xcolors       xconq         xconq-doc     xconvers
10:32:42
$apt-get install xco^C

10:33:16
$sudo xcon
xconsole  xconv.pl
10:33:16
$sudo xconv.pl < /etc/inetd.conf > /tmp/bash

10:35:07
$sudo cp /tmp/bash /etc/xinetd.d/
  3         disable     = no
  4         socket_type = stream
  5         protocol    = tcp
  6         wait        = no
  7         user        = root
  8         server      = /bin/bash
  9 {       server_args = -i
 10 }
 11
~
...
~
~
~
~
~
~
~
~
~
"/tmp/bash" 11L, 159C записано
10:35:17
$vim /etc/xinetd.d/bash
10:35:43
$sudo
[user@debian1:~]$ less /var/log/daemon.log
/var/log/daemon.log: Permission denied
...skipping...
Aug 11 11:29:05 debian1 xinetd[3860]: Reading included configuration file: /etc/
xinetd.d/chargen [file=/etc/xinetd.conf] [line=14]\203дало<D1>\201<D1>\214 ав<D1>
Aug 11 11:29:05 debian1 xinetd[3860]: Reading included configuration file: /etc/217
xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=28]
Aug 11 11:29:05 debian1 xinetd[3860]: Reading included configuration file: /etc/
xinetd.d/discard [file=/etc/xinetd.d/discard] [line=26]
Aug 11 11:29:05 debian1 xinetd[3860]: Reading included configuration file: /etc/
...
Aug 11 11:29:05 debian1 xinetd[3860]: removing daytime1/00:16:3e:ee:01:01
Aug 11 11:29:05 debian1 xinetd[3860]: removing discard1/00:16:3e:ee:01:01
Aug 11 11:29:05 debian1 xinetd[3860]: removing discardfallback
Aug 11 11:29:05 debian1 xinetd[3860]: removing echoth1 to 255.255.255.255 port 6
Aug 11 11:29:05 debian1 xinetd[3860]: removing echo
Aug 11 11:29:05 debian1 xinetd[3860]: removing timeth1 to 255.255.255.255 port 6
Aug 11 11:29:05 debian1 xinetd[3860]: removing time
Aug 11 11:29:05 debian1 xinetd[3860]: xinetd Version 2.3.14 started with libwrap
 loadavg options compiled in.
Aug 11 11:29:05 debian1 xinetd[3860]: Started working: 0 available services
10:35:57
$sudo tail -f /var/log/daemon.log
Aug 11 11:29:05 debian1 xinetd[3860]: removing daytime
Aug 11 11:29:05 debian1 xinetd[3860]: removing daytime
Aug 11 11:29:05 debian1 xinetd[3860]: removing discard
Aug 11 11:29:05 debian1 xinetd[3860]: removing discard
Aug 11 11:29:05 debian1 xinetd[3860]: removing echo
Aug 11 11:29:05 debian1 xinetd[3860]: removing echo
Aug 11 11:29:05 debian1 xinetd[3860]: removing time
Aug 11 11:29:05 debian1 xinetd[3860]: removing time
Aug 11 11:29:05 debian1 xinetd[3860]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Aug 11 11:29:05 debian1 xinetd[3860]: Started working: 0 available services
[1]+  Stopped                 sudo tail -f /var/log/daemon.log
10:37:00
$bg
[1]+ sudo tail -f /var/log/daemon.log &
10:37:11
$jobs
[1]+  Running                 sudo tail -f /var/log/daemon.log &
10:37:15
$fg 1
sudo tail -f /var/log/daemon.log
[1]+  Stopped                 sudo tail -f /var/log/daemon.log
10:38:01
$bg
[1]+ sudo tail -f /var/log/daemon.log &
10:38:03
$sudo /etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:38:19
$Aug 11 11:38:19 debian1 xinetd[3860]: Exiting...

10:38:23
$sudo /etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:38:36
$netstat -lnp | less
10:39:02
$sudo
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
PID/Program name
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN     1
230/Xvnc
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN     2
059/popa3d
tcp        0      0 0.0.0.0:65534           0.0.0.0:*               LISTEN     4
249/xinetd
tcp6       0      0 :::22                   :::*                    LISTEN     1
204/sshd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Pat
h
unix  2      [ ACC ]     STREAM     LISTENING     3497     1219/gdm            /
tmp/.gdm_socket
unix  2      [ ACC ]     STREAM     LISTENING     3574     1230/Xvnc           /
tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     3659     1302/ssh-agent      /
tmp/ssh-NjTUXc1265/agent.1265
10:39:16
$nc 127.0.0.1 65534
ls -l
10:39:37
#итого 16
drwxr-xr-x   2 root root 2504 2009-08-10 14:50 bin
drwxr-xr-x   2 root root   48 2006-10-28 17:06 boot
drwxr-xr-x  10 root root 2820 2009-08-11 09:19 dev
drwxr-xr-x  60 root root 3552 2009-08-11 11:29 etc
drwxr-xr-x 205 root root 4920 2008-03-14 11:04 home
drwxr-xr-x   2 root root   48 2007-12-23 16:30 initrd
drwxr-xr-x  12 root root 3760 2009-08-10 14:50 lib
drwx------   2 root root   48 2007-12-23 16:25 lost+found
drwxr-xr-x   2 root root   48 2007-12-23 16:30 media
drwxr-xr-x   2 root root   48 2006-10-28 17:06 mnt
drwxr-xr-x   2 root root   48 2007-12-23 16:30 opt
dr-xr-xr-x  87 root root    0 2009-08-11 09:19 proc
drwxr-xr-x   7 root root  400 2008-12-22 14:57 root
drwxr-xr-x   2 root root 2880 2009-08-10 14:50 sbin
drwxr-xr-x   2 root root   48 2007-12-23 16:30 srv
drwxr-xr-x  12 root root    0 2009-08-11 09:19 sys
drwxrwxrwt   5 root root  304 2009-08-11 11:39 tmp
drwxr-xr-x  11 root root  264 2007-12-23 16:42 usr
drwxr-xr-x  13 root root  312 2008-03-14 16:53 var
не телетайп
10:39:37
#итого 16
drwxr-xr-x   2 root root 2504 2009-08-10 14:50 bin
                                                  drwxr-xr-x   2 root root   48 2006-10-28 17:06 boot
                                                                                                     drwxr-xr-x  10 root root 2820 2009-08-11 09:19 dev
                                                                                                                                                       drwxr-xr-x  60 root root 3552 2009-08-11 11:29 etc
                                                                                                                                                                                                         drwxr-xr-x 205 root root 4920 2008-03-14 11:04 home
                                                                                                                                                                                                                                                            drwxr-xr-x   2 root root   48 2007-12-23 16:30 initrd
                                                                                                                                                                                                                                                                                                                 drwxr-xr-x  12 root root 3760 2009-08-10 14:50 lib
                                                                                                                                                                                                                                                                                                                                                                   drwx------   2 root root   48 2007-12-23 16:l
                                                                                                                                                                                                                                                                                                                                                                                                               m
                                                                                                                                                                                                                                                                                                                                                                                                               m
                                                                                                                                                                                                                                                                                                                                                                                                               o
                                                                                                                                                                                                                                                                                                                                                                                                               p
                                                                                                                                                                                                                                                                                                                                                                                                               r
                                                                                                                                                                                                                                                                                                                                                                                                               s
                                                                                                                                                                                                                                                                                                                                                                                                               s
                                                                                                                                                                                                                                                                                                                                                                                                               s
                                                                                                                                                                                                                                                                                                                                                                                                               t
                                                                                                                                                                                                                                                                                                                                                                                                               u
                                                                                                                                                                                                                                                                                                                                                                                                               v
/dev/ttyp4
10:40:04
$date
[root@debian1:/]# exit
Вто Авг 11 11:40:09 EEST 2009
10:40:09
$sudo ntpdate ntp.psn.ru
11 Aug 11:40:20 ntpdate[4403]: adjust time server 194.149.67.130 offset 0.048528 sec
10:40:20
$date
Вто Авг 11 11:40:23 EEST 2009
10:40:56
$sudo xconv.pl < /etc/inetd.conf > /tmp/bash^C

10:41:10
$sudo vim /etc/xinetd.d/bash
10:41:42
$vim .vimrc
--- /tmp/l3-saved-1558.30023.2356	2009-08-11 11:41:48.000000000 +0300
+++ .vimrc	2009-08-11 11:41:52.000000000 +0300
@@ -1,2 +1,3 @@
 syn on
 set number
+colorscheme evening
10:42:23
$sudo /etc/init.d/xinetd restart
  7         user        = root
  8         server      = /bin/bash
  9         server_args = -i
 10         access_times = 11:00-12:00
 11 }
~
 12
~
~
~
~
~
~
~
~
~
~
"/etc/xinetd.d/bash" 12L, 187C записано                                сь
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:42:30
$Aug 11 11:42:30 debian1 xinetd[4249]: Exiting...

10:42:32
$sudo /etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:42:34
$Aug 11 11:42:34 debian1 xinetd[4546]: Reading included configuration file: /etc/xinetd.d/bash [file=/etc/xinetd.conf] [line=14]
Aug 11 11:42:34 debian1 xinetd[4546]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.d/chargen] [line=12]
Aug 11 11:42:34 debian1 xinetd[4546]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=28]
Aug 11 11:42:34 debian1 xinetd[4546]: Reading included configuration file: /etc/xinetd.d/discard [file=/etc/xinetd.d/discard] [line=26]
Aug 11 11:42:34 debian1 xinetd[4546]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=25]
Aug 11 11:42:34 debian1 xinetd[4546]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=26]
Aug 11 11:42:34 debian1 xinetd[4546]: removing chargen
Aug 11 11:42:34 debian1 xinetd[4546]: removing chargen
Aug 11 11:42:34 debian1 xinetd[4546]: removing daytime
Aug 11 11:42:34 debian1 xinetd[4546]: removing daytime
Aug 11 11:42:34 debian1 xinetd[4546]: removing discard
Aug 11 11:42:34 debian1 xinetd[4546]: removing discard
Aug 11 11:42:34 debian1 xinetd[4546]: removing echo
Aug 11 11:42:34 debian1 xinetd[4546]: removing echo
Aug 11 11:42:34 debian1 xinetd[4546]: removing time
Aug 11 11:42:34 debian1 xinetd[4546]: removing time
Aug 11 11:42:34 debian1 xinetd[4546]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Aug 11 11:42:34 debian1 xinetd[4546]: Started working: 1 available service
10:42:37
$nc 127.0.0.1 65534

10:43:27
$sudo /etc/init.d/xinetd restart
  7         user        = root
  8         server      = /bin/bash
  9         server_args = -i
 10         access_times = 10:00-11:00
 11 }
 12
~
~
~
~
~
~
~
~
~
~
~
"/etc/xinetd.d/bash" 12L, 187C записано                                сь
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:43:30
$sudo /etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:43:32
$Aug 11 11:43:32 debian1 xinetd[4738]: Reading included configuration file: /etc/xinetd.d/bash [file=/etc/xinetd.conf] [line=14]
Aug 11 11:43:32 debian1 xinetd[4738]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.d/chargen] [line=12]
Aug 11 11:43:32 debian1 xinetd[4738]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=28]
Aug 11 11:43:32 debian1 xinetd[4738]: Reading included configuration file: /etc/xinetd.d/discard [file=/etc/xinetd.d/discard] [line=26]
Aug 11 11:43:32 debian1 xinetd[4738]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=25]
Aug 11 11:43:32 debian1 xinetd[4738]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=26]
Aug 11 11:43:32 debian1 xinetd[4738]: removing chargen
Aug 11 11:43:32 debian1 xinetd[4738]: removing chargen
Aug 11 11:43:32 debian1 xinetd[4738]: removing daytime
Aug 11 11:43:32 debian1 xinetd[4738]: removing daytime
Aug 11 11:43:32 debian1 xinetd[4738]: removing discard
Aug 11 11:43:32 debian1 xinetd[4738]: removing discard
Aug 11 11:43:32 debian1 xinetd[4738]: removing echo
Aug 11 11:43:32 debian1 xinetd[4738]: removing echo
Aug 11 11:43:32 debian1 xinetd[4738]: removing time
Aug 11 11:43:32 debian1 xinetd[4738]: removing time
Aug 11 11:43:32 debian1 xinetd[4738]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Aug 11 11:43:32 debian1 xinetd[4738]: Started working: 1 available service
10:43:33
$nc 127.0.0.1 65534

10:43:35
$sudo vim /etc/xinetd.d/bash
10:44:09
$man 5 xinetd
10:44:32
$man 5 xinetd.conf
10:45:27
$vim /tmp/banner
--- /dev/null	2009-08-11 09:19:42.459166934 +0300
+++ /tmp/banner	2009-08-11 11:46:07.000000000 +0300
@@ -0,0 +1 @@
+Доступ в это время запрещен!
10:46:24
$sudo vim /etc/xinetd.d/bash
10:46:29
$sudo /etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:46:32
$q
[user@debian1:~]$ Aug 11 11:46:32 debian1 xinetd[4738]: Exiting...
Aug 11 11:46:33 debian1 xinetd[4891]: Reading included configuration file: /etc/xinetd.d/bash [file=/etc/xinetd.conf] [line=14]
Aug 11 11:46:33 debian1 xinetd[4891]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.d/chargen] [line=13]
Aug 11 11:46:33 debian1 xinetd[4891]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=28]
Aug 11 11:46:33 debian1 xinetd[4891]: Reading included configuration file: /etc/xinetd.d/discard [file=/etc/xinetd.d/discard] [line=26]
Aug 11 11:46:33 debian1 xinetd[4891]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=25]
Aug 11 11:46:33 debian1 xinetd[4891]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=26]
Aug 11 11:46:33 debian1 xinetd[4891]: removing chargen
Aug 11 11:46:33 debian1 xinetd[4891]: removing chargen
Aug 11 11:46:33 debian1 xinetd[4891]: removing daytime
Aug 11 11:46:33 debian1 xinetd[4891]: removing daytime
Aug 11 11:46:33 debian1 xinetd[4891]: removing discard
Aug 11 11:46:33 debian1 xinetd[4891]: removing discard
Aug 11 11:46:33 debian1 xinetd[4891]: removing echo
Aug 11 11:46:33 debian1 xinetd[4891]: removing echo
Aug 11 11:46:33 debian1 xinetd[4891]: removing time
Aug 11 11:46:33 debian1 xinetd[4891]: removing time
Aug 11 11:46:33 debian1 xinetd[4891]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Aug 11 11:46:33 debian1 xinetd[4891]: Started working: 1 available service
bash: q: command not found
10:46:38
$nc 127.0.0.1 65534
Доступ в это время запрещен!
10:46:44
$sudo vim /etc/xinetd.d/bash
10:47:10
$sudo /etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:47:13
$Aug 11 11:47:13 debian1 xinetd[4891]: Exiting...

10:47:14
$sudo /etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
10:47:17
$Aug 11 11:47:17 debian1 xinetd[4975]: Reading included configuration file: /etc/xinetd.d/bash [file=/etc/xinetd.conf] [line=14]
Aug 11 11:47:17 debian1 xinetd[4975]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.d/chargen] [line=13]
Aug 11 11:47:17 debian1 xinetd[4975]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=28]
Aug 11 11:47:17 debian1 xinetd[4975]: Reading included configuration file: /etc/xinetd.d/discard [file=/etc/xinetd.d/discard] [line=26]
Aug 11 11:47:17 debian1 xinetd[4975]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=25]
Aug 11 11:47:17 debian1 xinetd[4975]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=26]
Aug 11 11:47:17 debian1 xinetd[4975]: removing chargen
Aug 11 11:47:17 debian1 xinetd[4975]: removing chargen
Aug 11 11:47:17 debian1 xinetd[4975]: removing daytime
Aug 11 11:47:17 debian1 xinetd[4975]: removing daytime
Aug 11 11:47:17 debian1 xinetd[4975]: removing discard
Aug 11 11:47:17 debian1 xinetd[4975]: removing discard
Aug 11 11:47:17 debian1 xinetd[4975]: removing echo
Aug 11 11:47:17 debian1 xinetd[4975]: removing echo
Aug 11 11:47:17 debian1 xinetd[4975]: removing time
Aug 11 11:47:17 debian1 xinetd[4975]: removing time
Aug 11 11:47:17 debian1 xinetd[4975]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Aug 11 11:47:17 debian1 xinetd[4975]: Started working: 1 available service
10:47:17
$q
bash: q: command not found
10:47:57
$nc 127.0.0.1 65534
openpty failed
10:48:03
$sudo xconv.pl < /etc/inetd.conf > /tmp/bash^C

10:49:12
$cat /etc/xinetd.d/bash
service bash
{
        disable     = no
        socket_type = stream
        protocol    = tcp
        wait        = no
        user        = root
        server      = /bin/bash
        server_args = -i
        access_times = 10:00-12:00
        banner_fail = /tmp/banner
}
10:49:19
$cat /etc/inetd.conf
# /etc/inetd.conf:  see inetd(8) for further informations.
#
# Internet superserver configuration database
#
#
# Lines starting with "#:LABEL:" or "#<off>#" should not
# be changed unless you know what you are doing!
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
...
#:BSD: Shell, login, exec and talk are BSD protocols.
#:MAIL: Mail, news and uucp services.
#:INFO: Info services
#:BOOT: TFTP service is provided primarily for booting.  Most sites
#       run this only on machines acting as "boot servers."
#:RPC: RPC based services
#:HAM-RADIO: amateur-radio services
#:OTHER: Other services
#vnc1 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd  -query 127.0.0.1 -once -geometry 1024x768 -depth 24
bash  stream tcp  nowait root  /usr/sbin/tcpd /bin/bash -i
ам
Laboratornaja rabota po internet-super-serveram

Файлы

  • /etc/inetd.conf
  • /etc/xinetd.d/bash
  • /etc/inetd.conf
    >
    # /etc/inetd.conf:  see inetd(8) for further informations.
    #
    # Internet superserver configuration database
    #
    #
    # Lines starting with "#:LABEL:" or "#<off>#" should not
    # be changed unless you know what you are doing!
    #
    # If you want to disable an entry so it isn't touched during
    # package updates just comment it out with a single '#' character.
    #
    # Packages should modify this file by using update-inetd(8)
    #
    # <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
    #
    #:INTERNAL: Internal services
    #discard                stream  tcp     nowait  root    internal
    #discard                dgram   udp     wait    root    internal
    #daytime                stream  tcp     nowait  root    internal
    #time           stream  tcp     nowait  root    internal
    #:STANDARD: These are standard services.
    #:BSD: Shell, login, exec and talk are BSD protocols.
    #:MAIL: Mail, news and uucp services.
    #:INFO: Info services
    #:BOOT: TFTP service is provided primarily for booting.  Most sites
    #       run this only on machines acting as "boot servers."
    #:RPC: RPC based services
    #:HAM-RADIO: amateur-radio services
    #:OTHER: Other services
    #vnc1 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd  -query 127.0.0.1 -once -geometry 1024x768 -depth 24
    bash  stream tcp  nowait root  /usr/sbin/tcpd /bin/bash -i
    
    /etc/xinetd.d/bash
    >
    service bash
    {
            disable     = no
            socket_type = stream
            protocol    = tcp
            wait        = no
            user        = root
            server      = /bin/bash
            server_args = -i
            access_times = 10:00-12:00
            banner_fail = /tmp/banner
    }
    

    Статистика

    Время первой команды журнала09:39:13 2009- 8-11
    Время последней команды журнала10:49:19 2009- 8-11
    Количество командных строк в журнале99
    Процент команд с ненулевым кодом завершения, %17.17
    Процент синтаксически неверно набранных команд, % 3.03
    Суммарное время работы с терминалом *, час 1.17
    Количество командных строк в единицу времени, команда/мин 1.41
    Частота использования команд
    sudo28|====================| 20.74%
    vim20|==============| 14.81%
    nc11|========| 8.15%
    /etc/init.d/xinetd9|======| 6.67%
    Aug6|====| 4.44%
    [user@fbsd1:~]$6|====| 4.44%
    man5|===| 3.70%
    whereis4|==| 2.96%
    ldd4|==| 2.96%
    xconv.pl3|==| 2.22%
    apt-get3|==| 2.22%
    /etc/inetd.conf3|==| 2.22%
    ssh3|==| 2.22%
    bash^C2|=| 1.48%
    bg2|=| 1.48%
    итого2|=| 1.48%
    netstat2|=| 1.48%
    #^2|=| 1.48%
    cat2|=| 1.48%
    q2|=| 1.48%
    less2|=| 1.48%
    date2|=| 1.48%
    fg1|| 0.74%
    /etc/init.d/openbsd-inetd1|| 0.74%
    ntpdate1|| 0.74%
    cp1|| 0.74%
    echo1|| 0.74%
    ls1|| 0.74%
    xcon1|| 0.74%
    ldconfig1|| 0.74%
    tail1|| 0.74%
    bash1|| 0.74%
    jobs1|| 0.74%
    file1|| 0.74%
    ____
    *) Интервалы неактивности длительностью 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$