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

Содержание

Журнал

Вторник (09/19/06)

/dev/pts/2
14:18:43
#netstat -lp | grep inetd

14:18:46
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:18:49
#netstat -lp | grep inetd
tcp        0      0 *:time                  *:*                     LISTEN     11297/inetd
tcp        0      0 *:auth                  *:*                     LISTEN     11297/inetd
tcp        0      0 *:chargen               *:*                     LISTEN     11297/inetd
14:18:50
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:18:54
#netstat -lp | grep inetd
tcp        0      0 *:time                  *:*                     LISTEN     11315/inetd
tcp        0      0 *:auth                  *:*                     LISTEN     11315/inetd
tcp        0      0 *:chargen               *:*                     LISTEN     11315/inetd
14:18:55
#vi /etc/inetd.conf
27c27
< time		stream	tcp	nowait	root /bin/sh 	
---
> time		stream	tcp	nowait	root /bin/sh sh 	
14:19:20
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:19:22
#netstat -lp | grep inetd
tcp        0      0 *:time                  *:*                     LISTEN     11350/inetd
tcp        0      0 *:auth                  *:*                     LISTEN     11350/inetd
tcp        0      0 *:chargen               *:*                     LISTEN     11350/inetd
14:19:23
#vi /etc/inetd.conf
27c27
< time		stream	tcp	nowait	root /bin/sh sh 	
---
> time		stream	tcp	nowait	root /bin/sh sh-i 	
14:19:53
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:19:55
#netstat -lp | grep inetd

14:19:57
#netstat -lp | grep inetd

14:19:58
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:20:00
#netstat -lp | grep inetd
tcp        0      0 *:time                  *:*                     LISTEN     11411/inetd
tcp        0      0 *:auth                  *:*                     LISTEN     11411/inetd
tcp        0      0 *:chargen               *:*                     LISTEN     11411/inetd
14:20:01
#vi /etc/inetd.conf
27c27
< time		stream	tcp	nowait	root /bin/sh sh-i 	
---
> time		stream	tcp	nowait	root /bin/bash bash -i 	
14:20:33
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:20:35
#netstat -lp | grep inetd
tcp        0      0 *:time                  *:*                     LISTEN     11447/inetd
tcp        0      0 *:auth                  *:*                     LISTEN     11447/inetd
tcp        0      0 *:chargen               *:*                     LISTEN     11447/inetd
14:20:36
#vi /etc/inetd.conf
27c27
< time		stream	tcp	nowait	root /bin/bash bash -i 	
---
> time		stream	tcp	nowait	root /bin/sh sh -i 	
14:20:58
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:21:01
#netstat -lp | grep inetd

14:21:03
#netstat -lp | grep inetd

14:21:04
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:21:06
#netstat -lp | grep inetd
tcp        0      0 *:time                  *:*                     LISTEN     11556/inetd
tcp        0      0 *:auth                  *:*                     LISTEN     11556/inetd
tcp        0      0 *:chargen               *:*                     LISTEN     11556/inetd
14:21:08
#vi /etc/inetd.conf
27c27
< time		stream	tcp	nowait	root /bin/sh sh -i 	
---
> time		stream	tcp	nowait	root /bin/bash bash -i 	
14:21:46
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:21:47
#netstat -lp | grep inetd

14:21:49
#/etc/init.d/inetd restart
Restarting internet superserver: inetd.
14:21:51
#netstat -lp | grep inetd
tcp        0      0 *:time                  *:*                     LISTEN     11647/inetd
tcp        0      0 *:auth                  *:*                     LISTEN     11647/inetd
tcp        0      0 *:chargen               *:*                     LISTEN     11647/inetd
14:30:04
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
14:30:09
#iptables -A INPUT -p icmp -j DROP

14:31:13
#ping 192.168.15.4
PING 192.168.15.4 (192.168.15.4) 56(84) bytes of data.
--- 192.168.15.4 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5013ms
14:31:24
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       icmp --  anywhere             anywhere
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
14:31:33
#iptables -L -v
Chain INPUT (policy ACCEPT 560 packets, 28122 bytes)
 pkts bytes target     prot opt in     out     source               destination
    6   504 DROP       icmp --  any    any     anywhere             anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 581 packets, 46483 bytes)
 pkts bytes target     prot opt in     out     source               destination
14:31:57
#ping 192.168.15.4
PING 192.168.15.4 (192.168.15.4) 56(84) bytes of data.
:
--- 192.168.15.4 ping statistics ---
32 packets transmitted, 0 received, 100% packet loss, time 31027ms
14:33:22
#iptables -L -v
Chain INPUT (policy ACCEPT 1675 packets, 104K bytes)
 pkts bytes target     prot opt in     out     source               destination
   38  3192 DROP       icmp --  any    any     anywhere             anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 1739 packets, 126K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:33:26
#iptables -D INPUT -p icmp -j DROP

14:33:48
#ping 192.168.15.4
                                                                               PING 192.168.15.4 (192.168.15.4) 56(84) bytes of data.
64 bytes from 192.168.15.4: icmp_seq=1 ttl=64 time=0.065 ms
64 bytes from 192.168.15.4: icmp_seq=2 ttl=64 time=0.045 ms
--- 192.168.15.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.045/0.055/0.065/0.010 ms
14:33:51
#ping 192.168.15.4
                                                                               PING 192.168.15.4 (192.168.15.4) 56(84) bytes of data.
64 bytes from 192.168.15.4: icmp_seq=1 ttl=64 time=0.073 ms
64 bytes from 192.168.15.4: icmp_seq=2 ttl=64 time=0.048 ms
--- 192.168.15.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 0.048/0.060/0.073/0.014 ms
14:34:00
#ping 192.168.15.4
PING 192.168.15.4 (192.168.15.4) 56(84) bytes of data.
64 bytes from 192.168.15.4: icmp_seq=1 ttl=64 time=0.053 ms
64 bytes from 192.168.15.4: icmp_seq=2 ttl=64 time=0.046 ms
64 bytes from 192.168.15.4: icmp_seq=3 ttl=64 time=0.046 ms
64 bytes from 192.168.15.4: icmp_seq=4 ttl=64 time=0.048 ms
64 bytes from 192.168.15.4: icmp_seq=5 ttl=64 time=0.048 ms
64 bytes from 192.168.15.4: icmp_seq=6 ttl=64 time=0.049 ms
--- 192.168.15.4 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 4997ms
rtt min/avg/max/mdev = 0.046/0.048/0.053/0.006 ms
14:34:08
#iptables -A INPUT -s 192.168.15.254 -j DROP
Chain INPUT (policy ACCEPT 3808 packets, 198K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 3896 packets, 282K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:37:30
#ping 192.168.15.254
Chain OUTPUT (policy ACCEPT 4960 packets, 352K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
--- 192.168.15.254 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1013ms
14:39:03
#ping 192.168.15.2
                                                                               PING 192.168.15.2 (192.168.15.2) 56(84) bytes of data.
64 bytes from 192.168.15.2: icmp_seq=1 ttl=64 time=0.197 ms
64 bytes from 192.168.15.2: icmp_seq=2 ttl=64 time=0.178 ms
--- 192.168.15.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1005ms
rtt min/avg/max/mdev = 0.178/0.187/0.197/0.016 ms
14:39:06
#iptables -L --line-nubers
   73  9764 DROP       all  --  any    any     192.168.15.254       anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 8658 packets, 587K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               iptables v1.2.11: Unknown arg `--line-nubers'
Try `iptables -h' or 'iptables --help' for more information.
14:41:10
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    DROP       all  --  192.168.15.254       anywhere
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
14:41:28
#iptables -D INPUT 1
Chain INPUT (policy ACCEPT 8500 packets, 396K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 8682 packets, 597K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:41:43
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
14:41:46
#telnet 127.0.0.1 chargen
                                                                               Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]
telnet> q
Connection closed.
14:43:43
#telnet 127.0.0.1 19
                                                                               Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]
telnet> ^]q
?Invalid command
telnet> ^]q
?Invalid command
telnet> q
Connection closed.
14:44:04
#telnet 127.0.0.1 chargen
                                                                               Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]
telnet> q
Connection closed.
14:44:36
#iptables -A INPUT --dport 19 -p tcp -j DROP
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 10836 packets, 749K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               iptables v1.2.11: Unknown arg `--dport'
Try `iptables -h' or 'iptables --help' for more information.
14:45:24
#iptables -A INPUT -p tcp --dport 53 -j DROP
Chain INPUT (policy ACCEPT 10642 packets, 490K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       tcp  --  any    any     anywhere             anywhere
        tcp dpt:domain
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 10851 packets, 753K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:45:49
#telnet 127.0.0.1 chargen
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 10860 packets, 754K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
14:45:59
#telnet 192.168.15.4 19
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 11392 packets, 790K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               Trying 192.168.15.4...
Connected to 192.168.15.4.
Escape character is '^]'.
Connection closed by foreign host.
14:46:31
#iptables -A INPUT -p tcp --dport 19 -j DROP
Chain INPUT (policy ACCEPT 11181 packets, 513K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       tcp  --  any    any     anywhere             anywhere
        tcp dpt:domain
    1    60 DROP       tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 11399 packets, 791K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:46:43
#telnet 192.168.15.4 19
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 11418 packets, 796K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               Trying 192.168.15.4...
^]q
^]q
14:47:07
#iptables -D INPUT -p tcp --dport 53 -j DROP
Chain INPUT (policy ACCEPT 11714 packets, 537K bytes)
 pkts bytes target     prot opt in     out     source               destination
    5   300 DROP       tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 11944 packets, 832K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:47:25
#telnet 192.168.15.4 19
Trying 192.168.15.4...
14:47:32
#iptables -D INPUT -p tcp --dport 19 -j DROP
Chain INPUT (policy ACCEPT 11723 packets, 538K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 11957 packets, 836K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:47:59
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whit
Chain INPUT (policy ACCEPT 12253 packets, 562K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 12494 packets, 875K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:47:59
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith t
Chain INPUT (policy ACCEPT 12769 packets, 582K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 13013 packets, 908K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:47:59
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tc

14:47:59
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tcp-re

14:47:59
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 13025 packets, 913K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               iptables v1.2.11: Unknown arg `--reject-whith'
Try `iptables -h' or 'iptables --help' for more information.
14:49:25
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 13037 packets, 916K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               iptables v1.2.11: Unknown arg `--reject-whith'
Try `iptables -h' or 'iptables --help' for more information.
14:50:04
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-with tcp-reset
Chain INPUT (policy ACCEPT 13303 packets, 606K bytes)
 pkts bytes target     prot opt in     out     source               destination
    1    60 REJECT     tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen reject-with tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 13556 packets, 948K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:50:08
#telnet 192.168.15.4 19
Trying 192.168.15.4...
telnet: Unable to connect to remote host: Connection refused
flags syn send but ack ne polucheno
flags syn send but ack ne polucheno iptab
14:51:57
#nmap -sS 192.168.15.4
 pkts bytes target     prot opt in     out     source               destination
    1    60 REJECT     tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen reject-with tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 14676 packets, 1033K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               bash: nmap: command not found
14:52:29
#apt-get install nmap
  nmap
0 upgraded, 1 newly installed, 0 to remove and 801 not upgraded.
Need to get 736kB of archives.
After unpacking 2515kB of additional disk space will be used.
Get:1 http://debian.org.ua testing/main nmap 4.11-1 [736kB]
Fetched 736kB in 5s (131kB/s)
Выбор ранее не выбранного пакета nmap.
(Чтение базы данных... на данный момент установлено 102957 файлов и каталогов.)
Распаковывается пакет nmap (из файла .../archives/nmap_4.11-1_i386.deb)...
Настраивается пакет nmap (4.11-1) ...
14:52:47
#nmap -sS 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:52 EEST
Interesting ports on linux4.max.linux.nt (192.168.15.4):
Not shown: 1673 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
37/tcp  open  time
110/tcp open  pop3
111/tcp open  rpcbind
113/tcp open  auth
515/tcp open  printer
909/tcp open  unknown
Nmap finished: 1 IP address (1 host up) scanned in 0.222 seconds
14:53:02
#iptables -L --line-numbers
                                                                               Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    REJECT     tcp  --  anywhere             anywhere            tcp dpt:chargen reject-with tcp-reset
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
14:53:15
#iptables -D INPUT 1
Chain INPUT (policy ACCEPT 18861 packets, 1625K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 18947 packets, 1236K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:53:52
#telnet 192.168.15.4 19
Chain INPUT (policy ACCEPT 19381 packets, 1646K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 19470 packets, 1270K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:53:52
#iptables -A INPUT -p tcp --dport 19 -j DROP
Chain INPUT (policy ACCEPT 19388 packets, 1647K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 19481 packets, 1273K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:54:23
#nmap 192.168.15.4
PORT    STATE    SERVICE
19/tcp  filtered chargen
22/tcp  open     ssh
37/tcp  open     time
110/tcp open     pop3
111/tcp open     rpcbind
113/tcp open     auth
515/tcp open     printer
909/tcp open     unknown
Nmap finished: 1 IP address (1 host up) scanned in 1.407 seconds
by default connet sposob of scan
14:55:18
#nmap -sS 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:55 EEST
Interesting ports on linux4.max.linux.nt (192.168.15.4):
Not shown: 1672 closed ports
PORT    STATE    SERVICE
19/tcp  filtered chargen
22/tcp  open     ssh
37/tcp  open     time
110/tcp open     pop3
111/tcp open     rpcbind
113/tcp open     auth
515/tcp open     printer
909/tcp open     unknown
Nmap finished: 1 IP address (1 host up) scanned in 1.381 seconds
syn-sposob
14:55:41
#nmap -sF 192.168.15.4
PORT    STATE         SERVICE
19/tcp  open|filtered chargen
22/tcp  open|filtered ssh
37/tcp  open|filtered time
110/tcp open|filtered pop3
111/tcp open|filtered rpcbind
113/tcp open|filtered auth
515/tcp open|filtered printer
909/tcp open|filtered unknown
Nmap finished: 1 IP address (1 host up) scanned in 1.445 seconds
fin-sposob
14:56:00
#nmap -p 22 '192.168.15.*'
Interesting ports on fbsd1.linux.nt (192.168.15.21):
PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: 00:01:02:B4:61:10 (3com)
Interesting ports on linux.nt (192.168.15.254):
PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: 00:0A:01:D4:D1:39 (Sohoware)
Nmap finished: 256 IP addresses (5 hosts up) scanned in 5.533 seconds
po portu 22 seti 192.168.15.0
14:56:55
#iptables -D INPUT -p tcp --dport 19 -j DROP
Chain INPUT (policy ACCEPT 31100 packets, 2137K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 31227 packets, 1812K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:57:06
#iptables -A INPUT -p tcp --dport 19 -j RESET --reset-with tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 31240 packets, 1817K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               iptables v1.2.11: Unknown arg `--reset-with'
Try `iptables -h' or 'iptables --help' for more information.
14:57:46
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-with tcp-reset
Chain INPUT (policy ACCEPT 31633 packets, 2160K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 REJECT     tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen reject-with tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 31768 packets, 1853K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:58:27
#nmap -p 19 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:58 EEST
Interesting ports on linux4.max.linux.nt (192.168.15.4):
PORT   STATE  SERVICE
19/tcp closed chargen
Nmap finished: 1 IP address (1 host up) scanned in 0.037 seconds
14:58:48
#nmap -p 19 192.168.15.4
Chain INPUT (policy ACCEPT 31649 packets, 2162K bytes)
 pkts bytes target     prot opt in     out     source               destination
    1    44 REJECT     tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen reject-with tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 31789 packets, 1857K bytes)
 pkts bytes target     prot opt in     out     source               destination
14:58:58
#telnet 192.168.15.4
    2    88 REJECT     tcp  --  any    any     anywhere             anywhere
        tcp dpt:chargen reject-with tcp-reset
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 32322 packets, 1893K bytes)
 pkts bytes target     prot opt in     out     source               destination
                                                                               Trying 192.168.15.4...
telnet: Unable to connect to remote host: Connection refused
14:59:07
#nmap -p 19 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:59 EEST
Interesting ports on linux4.max.linux.nt (192.168.15.4):
PORT   STATE  SERVICE
19/tcp closed chargen
Nmap finished: 1 IP address (1 host up) scanned in 0.038 seconds
14:59:10
#nmap -p -sS 19 192.168.15.4
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 32386 packets, 1900K bytes)
 pkts bytes target     prot opt in     out     source               destination
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:59 EEST
Error #486: Your port specifications are illegal.  Example of proper form: "-100,200-1024,3000-4000,60000-"
QUITTING!
14:59:24
#nmap -p 19
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 32426 packets, 1904K bytes)
 pkts bytes target     prot opt in     out     source               destination
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:59 EEST
Invalid target host specification: 19
QUITTING!
14:59:39
#nmap -p 19 -sS 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:59 EEST
Interesting ports on linux4.max.linux.nt (192.168.15.4):
PORT   STATE  SERVICE
19/tcp closed chargen
Nmap finished: 1 IP address (1 host up) scanned in 0.036 seconds
14:59:51
#nmap -p 19 -sF 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:59 EEST
Interesting ports on linux4.max.linux.nt (192.168.15.4):
PORT   STATE  SERVICE
19/tcp closed chargen
Nmap finished: 1 IP address (1 host up) scanned in 0.038 seconds
14:59:57
#iptables -L
                                                                               Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     tcp  --  anywhere             anywhere            tcp dpt:chargen reject-with tcp-reset
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Статистика

Время первой команды журнала14:18:43 2006- 9-19
Время последней команды журнала14:59:57 2006- 9-19
Количество командных строк в журнале89
Процент команд с ненулевым кодом завершения, %23.60
Процент синтаксически неверно набранных команд, % 1.12
Суммарное время работы с терминалом *, час 0.69
Количество командных строк в единицу времени, команда/мин 2.16
Частота использования команд
iptables30|===========================| 27.27%
netstat13|===========| 11.82%
grep13|===========| 11.82%
nmap13|===========| 11.82%
telnet10|=========| 9.09%
/etc/init.d/inetd10|=========| 9.09%
#^8|=======| 7.27%
ping7|======| 6.36%
vi5|====| 4.55%
apt-get1|| 0.91%
____
*) Интервалы неактивности длительностью 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$