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

Содержание

Журнал

Вторник (03/13/07)

/dev/pts/15
11:17:10
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:17:12
#vim /etc/hosts.allow
14c14
< ALL: EXEPT LOCAL : deny 
---
> #ALL: EXEPT LOCAL : deny 
11:17:17
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
2+2#
4
^]
telnet> q
Connection closed.
11:17:22
#vim /etc/hosts.allow
13c13,14
< calc: LOCAL
---
> calc: linux1.net.nt : allow 
> ALL : ALL : deny
11:17:56
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:17:58
#hostname
linux1
11:18:03
#vim /etc/hosts.allow
13c13
< calc: linux1.net.nt : allow 
---
> calc: 127.0.0.1 : allow 
11:18:15
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:18:19
#grep calc /etc/services
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
calc            22222/tcp       #Calc
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:18:32
#vim /etc/hosts.allow
11:18:58
#vim /etc/hosts.deny
20c20
< #ALL: ALL
---
> ALL: ALL
11:19:07
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:19:10
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:19:11
#vim /etc/hosts.deny
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:19:29
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:19:30
#vim /etc/hosts.deny
20c20
< ALL EXEPT LOCAL: ALL
---
> ALL EXEPT 127.0.0.1 : ALL
11:19:42
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:19:43
#vim /etc/hosts.deny
20c20
< ALL EXEPT 127.0.0.1 : ALL
---
> ALL EXCEPT 127.0.0.1: ALL
11:20:10
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:20:11
#vim /etc/hosts.deny
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:20:22
#telnet 127.0.0.1 22222
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]
telnet> q
Connection closed.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:20:36
#telnet linux1.net.nt 22222
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
^]
telnet> q
Connection closed.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:20:49
#vim /etc/hosts.deny
19c19,20
< ALL: PARANOID
---
> #ALL: PARANOID
> ALL : ALL
11:21:05
#telnet linux1.net.nt 22222
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
Connection closed by foreign host.
11:21:06
#vim /etc/hosts.allow
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:21:31
#telnet linux1.net.nt 22222
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
Connection closed by foreign host.
11:21:33
#telnet 127.0.0.1 22222
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:21:41
#vim /etc/hosts.allow
11:21:52
#tail /var/log/daemon.log
Mar 13 11:17:58 linux1 xinetd[10135]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:18:19 linux1 xinetd[10172]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:10 linux1 xinetd[10237]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:11 linux1 xinetd[10247]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:30 linux1 xinetd[10276]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:43 linux1 xinetd[10305]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:20:11 linux1 xinetd[10340]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:21:06 linux1 xinetd[10415]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:21:33 linux1 xinetd[10449]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:21:40 linux1 xinetd[10458]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
11:22:00
#vim /etc/hosts.allow
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:22:39
#telnet 127.0.0.1 22222
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:22:45
#tail /var/log/daemon.log
Mar 13 11:18:19 linux1 xinetd[10172]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:10 linux1 xinetd[10237]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:11 linux1 xinetd[10247]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:30 linux1 xinetd[10276]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:43 linux1 xinetd[10305]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:20:11 linux1 xinetd[10340]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:21:06 linux1 xinetd[10415]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:21:33 linux1 xinetd[10449]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:21:40 linux1 xinetd[10458]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:22:45 linux1 xinetd[10529]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
11:22:47
#telnet 192.168.16.1 22222
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 192.168.16.1...
Connected to 192.168.16.1.
Escape character is '^]'.
Connection closed by foreign host.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:23:03
#tail /var/log/daemon.log
Mar 13 11:19:10 linux1 xinetd[10237]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:11 linux1 xinetd[10247]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:30 linux1 xinetd[10276]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:19:43 linux1 xinetd[10305]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:20:11 linux1 xinetd[10340]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:21:06 linux1 xinetd[10415]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:21:33 linux1 xinetd[10449]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:21:40 linux1 xinetd[10458]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:22:45 linux1 xinetd[10529]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:23:03 linux1 xinetd[10550]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
11:23:05
#vim /etc/hosts.allow
13c13
< calc: 127.0.0.1 
---
> ALL: 127.0.0.1 : allow
11:23:26
#telnet 192.168.16.1 22222
Trying 192.168.16.1...
Connected to 192.168.16.1.
Escape character is '^]'.
Connection closed by foreign host.
11:23:29
#telnet 127.0.0.1 22222
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
2+2#
4
^]
telnet> q
Connection closed.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:23:38
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
2+2#
4
^]
telnet> q
Connection closed.
11:23:46
#telnet 192.168.16.1 22222
Trying 192.168.16.1...
Connected to 192.168.16.1.
Escape character is '^]'.
Connection closed by foreign host.
11:23:49
#cat /etc/hosts.allow
#                   and /usr/doc/netbase/portmapper.txt.gz
#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8), rpc.mountd(8) and
# /usr/share/doc/portmap/portmapper.txt.gz for further information.
ALL: 127.0.0.1 : allow
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:23:57
#cat /etc/hosts.deny
# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
#                  See the manual pages hosts_access(5), hosts_options(5)
#                  and /usr/doc/netbase/portmapper.txt.gz
#
# Example:    ALL: some.host.name, .some.domain
#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper. See portmap(8)
# and /usr/doc/portmap/portmapper.txt.gz for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.
# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
#ALL: PARANOID
ALL : ALL
11:24:05
#vim /etc/hosts.allow
13c13,14
< ALL: 127.0.0.1 : allow
---
> #ALL: 127.0.0.1 : allow
> calc: 127.0.0.1 : allow
11:24:29
#telnet 192.168.16.1 22222
Trying 192.168.16.1...
Connected to 192.168.16.1.
Escape character is '^]'.
Connection closed by foreign host.
11:24:33
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:24:36
#vim /etc/xinetd.conf
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:24:58
#vim /etc/hosts.allow
11:25:08
#man host_access
11:25:13
#. /etc/bash_completion
       Efforts have been made to have netcat "do the right thing" in  all  its
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:25:23
#man host
11:25:23
#man hosts_access
11:26:06
#vim /etc/hosts.allow
14a15
> calc: LOCAL : allow
11:26:32
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:26:37
#vim /etc/hosts.allow
14,15c14,15
< calc: 127.0.0.1 : allow
< calc: LOCAL : allow
---
> ALL: 127.0.0.1 : allow
> ALL: LOCAL : allow
11:26:59
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]
telnet> q
Connection closed.
11:27:03
#telnet linux1 22222
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
Connection closed by foreign host.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:27:09
#vim /etc/hosts.allow
15d14
< ALL: LOCAL : allow
11:27:22
#man hosts_access
11:28:27
#vim /etc/hosts.allow
14c14
< ALL: 127.0.0.1 : allow
---
> ALL: @net.nt : allow
11:28:58
#telnet linux1 22222
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
Connection closed by foreign host.
11:29:01
#telnet linux1 22222
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
Connection closed by foreign host.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:29:06
#man hosts_access
11:29:57
#vim /etc/hosts.allow
14c14
< ALL: @net.nt : allow
---
> ALL: .net.nt : allow
11:30:04
#telnet linux1 22222
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
2+2#
4
^]
telnet> q
Connection closed.
11:30:13
#vim /etc/hosts.allow
14c14
< ALL: .net.nt : allow
---
> ALL: .net.nt EXCEPT linux1.net.nt: allow
11:30:38
#telnet linux1 22222
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
Connection closed by foreign host.
11:30:40
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
11:30:49
#ping linux1
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
PING linux1.net.nt (192.168.16.1) 56(84) bytes of data.
64 bytes from linux1.net.nt (192.168.16.1): icmp_seq=1 ttl=64 time=0.063 ms
64 bytes from linux1.net.nt (192.168.16.1): icmp_seq=2 ttl=64 time=0.051 ms
--- linux1.net.nt ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.051/0.057/0.063/0.006 ms
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:31:01
#vim /etc/hosts.allow
14c14
< ALL: .net.nt EXCEPT linux1.net.nt: allow
---
> ALL: 127.0.0.1 .net.nt EXCEPT linux1.net.nt: allow
11:31:23
#telnet 127.0.0.1 22222
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
2+2#
4
^]
telnet> q
Connection closed.
11:31:31
#telnet linux1 22222
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Trying 192.168.16.1...
Connected to linux1.net.nt.
Escape character is '^]'.
Connection closed by foreign host.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:31:38
#vim /etc/hosts.allow
11:32:10
#apt-get install xinetd
       Efforts have been made to have netcat "do the right thing" in  all  its
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:32:27
#vim /etc/inetd.conf
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:32:38
#ls -l /etc/init.d/*inetd*
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
-rwxr-xr-x 1 root root  222 2007-03-13 11:04 /etc/init.d/inetd
-rwxr-xr-x 1 root root 2354 2006-09-10 23:41 /etc/init.d/openbsd-inetd
-rwxr-xr-x 1 root root 1481 2006-05-08 19:09 /etc/init.d/xinetd
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:33:07
#vimdiff /etc/init.d/inetd /etc/init.d/openbsd-inetd
                                           [ -x $DAEMON -a -e /etc/inetd.conf ]
  --------------------------------------
  # doesn't need to be run.                [ -e /etc/default/openbsd-inetd ] &&
  --------------------------------------
  --------------------------------------   . /lib/lsb/init-functions
  --------------------------------------
                                           checkportmap () {
  --------------------------------------     if ! grep -v -s "^ *#" /etc/inetd.c
                                               return 0
  --------------------------------------     fi
...
                                               log_action_msg "         disable
  --------------------------------------     elif ! /usr/bin/rpcinfo -u localhos
                                               log_action_msg "WARNING: portmapp
  --------------------------------------       log_action_msg "         (Comment
                                               log_action_msg "         disable
  --------------------------------------     fi
                                           }
  --------------------------------------
                      5,1            66% <nit.d/openbsd-inetd 36,0-1         22%
  --------------------------------------
11:33:56
#vimdiff /etc/init.d/inetd /etc/init.d/openbsd-i

11:33:58
#vim /etc/init.d/openbsd-inetd
11:34:09
#vim /etc/init.d/inetd
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:34:22
#/etc/init.d/xinetd restart
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:34:29
#vim /etc/xinetd.conf
11:35:41
#ls -lm /etc/xinetd.d/
chargen, daytime, discard, echo, time
11:35:49
#ls -l
итого 5
-rw-r--r-- 1 root root 798 2006-05-09 14:40 chargen
-rw-r--r-- 1 root root 660 2006-05-09 14:40 daytime
-rw-r--r-- 1 root root 536 2006-05-09 14:40 discard
-rw-r--r-- 1 root root 580 2006-05-09 14:40 echo
-rw-r--r-- 1 root root 727 2006-05-09 14:40 time
11:35:51
#vim /etc/xinetd.d/chargen
30c30
< 
---
> bc dgram udp wait root /usr/bin/bc 
11:36:18
#pkill -1 xinetd
       Efforts have been made to have netcat "do the right thing" in  all  its
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:36:23
#tail /var/log/daemon.log
Mar 13 11:24:33 linux1 xinetd[10672]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:24:36 linux1 xinetd[10679]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:26:36 linux1 xinetd[10854]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:27:09 linux1 xinetd[10898]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:29:01 linux1 xinetd[11000]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:29:06 linux1 xinetd[11007]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:30:40 linux1 xinetd[11110]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:30:49 linux1 xinetd[11121]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:31:38 linux1 xinetd[11179]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:34:29 linux1 xinetd[9623]: Exiting...
11:36:32
#tail /var/log/daemon.log
Mar 13 11:24:33 linux1 xinetd[10672]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:24:36 linux1 xinetd[10679]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:26:36 linux1 xinetd[10854]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:27:09 linux1 xinetd[10898]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:29:01 linux1 xinetd[11000]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:29:06 linux1 xinetd[11007]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:30:40 linux1 xinetd[11110]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:30:49 linux1 xinetd[11121]: libwrap refused connection to calc (libwrap=bc) from 127.0.0.1
Mar 13 11:31:38 linux1 xinetd[11179]: libwrap refused connection to calc (libwrap=bc) from 192.168.16.1
Mar 13 11:34:29 linux1 xinetd[9623]: Exiting...
11:36:36
#date
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
Вто Мар 13 11:36:42 EET 2007
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:36:42
#/etc/init.d/xinetd start
Starting internet superserver: xinetd.
11:36:49
#tail /var/log/daemon.log
Mar 13 11:36:49 linux1 xinetd[11635]: removing daytime
Mar 13 11:36:49 linux1 xinetd[11635]: removing daytime
Mar 13 11:36:49 linux1 xinetd[11635]: removing discard
Mar 13 11:36:49 linux1 xinetd[11635]: removing discard
Mar 13 11:36:49 linux1 xinetd[11635]: removing echo
Mar 13 11:36:49 linux1 xinetd[11635]: removing echo
Mar 13 11:36:49 linux1 xinetd[11635]: removing time
Mar 13 11:36:49 linux1 xinetd[11635]: removing time
Mar 13 11:36:49 linux1 xinetd[11635]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Mar 13 11:36:49 linux1 xinetd[11635]: Started working: 2 available services
11:36:53
#grep chargen /etc/services
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
chargen         19/tcp          ttytst source
chargen         19/udp          ttytst source
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:37:03
#netstat -lnp | grep :19
tcp        0      0 0.0.0.0:19              0.0.0.0:*               LISTEN     11635/xinetd
11:37:18
#teelnet 127.0.0.1 19
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
bash: teelnet: command not found
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
11:37:29
#telnet 127.0.0.1 19
"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi
#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk
%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl
&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm
'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn
()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno
)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop
*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq
+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr
...
NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}!"#$%&'()*+,-./012345678
OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}!"#$%&'()*+,-./0123456789
PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}!"#$%&'()*+,-./0123456789:
QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}!"#$%&'()*+,-./0123456789:;
RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}!"#$%&'()*+,-./0123456789:;<
STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}!"#$%&'()*+,-./0123456789:;<=
TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}!"#$%&'()*+,-./0123456789:;<=>
^]
telnet> q
Connection closed.
11:37:38
#vim /etc/xinetd.d/chargen
11:38:12
#vim /etc/xinetd.conf
11:38:31
#telnet linux1 22222
       Efforts have been made to have netcat "do the right thing" in  all  its
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
прошло 28 минут
12:06:32
#nmap
Nmap 4.11 ( http://www.insecure.org/nmap/ )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
  Can pass hostnames, IP addresses, networks, etc.
  Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254
  -iL <inputfilename>: Input from list of hosts/networks
  -iR <num hosts>: Choose random targets
  --exclude <host1[,host2][,host3],...>: Exclude hosts/networks
  --excludefile <exclude_file>: Exclude list from file
HOST DISCOVERY:
...
  --datadir <dirname>: Specify custom Nmap data file location
  --send-eth/--send-ip: Send using raw ethernet frames or IP packets
  --privileged: Assume that the user is fully privileged
  -V: Print version number
  -h: Print this help summary page.
EXAMPLES:
  nmap -v -A scanme.nmap.org
  nmap -v -sP 192.168.0.0/16 10.0.0.0/8
  nmap -v -iR 10000 -P0 -p 80
SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES
12:06:37
#nmap 10.0.17.2
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-03-13 12:06 EET
Interesting ports on 10.0.17.2:
Not shown: 1667 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
111/tcp  open  rpcbind
389/tcp  open  ldap
427/tcp  open  svrloc
524/tcp  open  ncp
636/tcp  open  ldapssl
5801/tcp open  vnc-http-1
5901/tcp open  vnc-1
5902/tcp open  vnc-2
6002/tcp open  X11:2
8080/tcp open  http-proxy
8443/tcp open  https-alt
Nmap finished: 1 IP address (1 host up) scanned in 0.383 seconds
12:06:42
#X
       various  modes.   If you believe that it is doing the wrong thing under
       whatever circumstances, please notify me and tell me how you  think  it
       should  behave.   If  netcat  is not able to do some task you think up,
       minor tweaks to the code will probably fix that.  It provides  a  basic
       and  easily-modified  template  for writing other network applications,
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
X     X11   Xorg
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
12:06:42
#apt-cache search xvnc
       and I certainly encourage people to make custom mods and  send  in  any
       improvements  they  make  to  it.  Continued feedback from the Internet
[root@linux1:~]#
[root@linux1:~]#
[root@linux1:~]#
linuxvnc - VNC server to monitor a tty
tkvnc - Displays a list of (defined) machines to start VNC to
xtightvncviewer - virtual network computing client software for X
xvnc4viewer - Virtual network computing client software for X
xvncviewer - Virtual network computing client software for X
xwnc - Mix of Xvnc and XDarwin with improved protocol
netscsid                             nroff
netstat                              nslookup
network-admin                        nstat
newaliases                           nsupdate
[root@linux1:~]# man nc
Переформатирование nc(1), подождите...
NC(1)                                                                    NC(1)
/dev/pts/3
12:08:05
#nc
Cmd line:

Файлы

  • /etc/hosts.allow
  • /etc/hosts.deny
  • /etc/hosts.allow
    >
    #                   and /usr/doc/netbase/portmapper.txt.gz
    #
    # Example:    ALL: LOCAL @some_netgroup
    #             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
    #
    # If you're going to protect the portmapper use the name "portmap" for the
    # daemon name. Remember that you can only use the keyword "ALL" and IP
    # addresses (NOT host or domain names) for the portmapper, as well as for
    # rpc.mountd (the NFS mount daemon). See portmap(8), rpc.mountd(8) and
    # /usr/share/doc/portmap/portmapper.txt.gz for further information.
    ALL: 127.0.0.1 : allow
    netscsid                             nroff
    netstat                              nslookup
    network-admin                        nstat
    newaliases                           nsupdate
    [root@linux1:~]# man nc
    Переформатирование nc(1), подождите...
    NC(1)                                                                    NC(1)
    
    /etc/hosts.deny
    >
    # /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
    #                  See the manual pages hosts_access(5), hosts_options(5)
    #                  and /usr/doc/netbase/portmapper.txt.gz
    #
    # Example:    ALL: some.host.name, .some.domain
    #             ALL EXCEPT in.fingerd: other.host.name, .other.domain
    #
    # If you're going to protect the portmapper use the name "portmap" for the
    # daemon name. Remember that you can only use the keyword "ALL" and IP
    # addresses (NOT host or domain names) for the portmapper. See portmap(8)
    # and /usr/doc/portmap/portmapper.txt.gz for further information.
    #
    # The PARANOID wildcard matches any host whose name does not match its
    # address.
    # You may wish to enable this to ensure any programs that don't
    # validate looked up hostnames still leave understandable logs. In past
    # versions of Debian this has been the default.
    #ALL: PARANOID
    ALL : ALL
    

    Статистика

    Время первой команды журнала11:17:10 2007- 3-13
    Время последней команды журнала12:08:05 2007- 3-13
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %62.38
    Процент синтаксически неверно набранных команд, % 0.99
    Суммарное время работы с терминалом *, час 0.85
    Количество командных строк в единицу времени, команда/мин 1.98
    Частота использования команд
    telnet34|=================================| 33.33%
    vim32|===============================| 31.37%
    tail6|=====| 5.88%
    man5|====| 4.90%
    grep3|==| 2.94%
    ls3|==| 2.94%
    /etc/init.d/xinetd2|=| 1.96%
    nmap2|=| 1.96%
    vimdiff2|=| 1.96%
    cat2|=| 1.96%
    teelnet1|| 0.98%
    ping1|| 0.98%
    pkill1|| 0.98%
    X1|| 0.98%
    nc1|| 0.98%
    .1|| 0.98%
    netstat1|| 0.98%
    apt-get1|| 0.98%
    hostname1|| 0.98%
    apt-cache1|| 0.98%
    date1|| 0.98%
    ____
    *) Интервалы неактивности длительностью 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$