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

Содержание

Журнал

Среда (06/16/10)

/dev/hvc0
09:36:04
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 121 packets, 41194 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:05
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 134 packets, 43449 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:06
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 146 packets, 44241 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:06
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 158 packets, 45033 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:07
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 172 packets, 48751 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:13
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 197 packets, 51672 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:14
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 209 packets, 52464 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:14
#iptables -L -v
Chain INPUT (policy ACCEPT 11 packets, 869 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 DROP 221 packets, 53256 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    any     default              default
09:36:15
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 14 packets, 1051 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 278 packets, 86139 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     default              default
09:36:35
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 15 packets, 1109 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 296 packets, 95721 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     default              default
09:36:44
#iptables -D OUTPUT -s 0.0.0.0 -d 0.0.0.0 -j ACCEPT

09:37:21
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 18 packets, 1062 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:27
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 24 packets, 1458 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:28
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 30 packets, 1854 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:29
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 36 packets, 2250 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:29
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 42 packets, 2646 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:30
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 48 packets, 3042 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:30
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 54 packets, 3438 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:31
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 60 packets, 3834 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:31
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 66 packets, 4230 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             default
09:37:32
#iptables -D OUTPUT -s 0.0.0.0 -d 0.0.0.0 -j ACCEPT
iptables: Bad rule (does a matching rule exist in that chain?).
09:37:39
#iptables -D OUTPUT -d 0.0.0.0 -j ACCEPT

09:37:54
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:55
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:56
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:56
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:57
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:58
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:58
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:59
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 29 packets, 1702 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1       17 36911 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:59
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 29 packets, 1702 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1       17 36911 ACCEPT     all  --  any    any     anywhere             anywhere
09:37:59
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 29 packets, 1702 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1       17 36911 ACCEPT     all  --  any    any     anywhere             anywhere
09:38:00
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 29 packets, 1702 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1       17 36911 ACCEPT     all  --  any    any     anywhere             anywhere
/dev/pts/1
09:39:19
#iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
09:39:29
#iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
09:39:41
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
09:41:52
#bg
[1]+ tcpdump -i eth0 -n -p icmp &
10:41:53.287540 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 9, length 64
09:41:53
#10:41:54.297593 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 10, length 64

09:41:55
#10:41:55.307701 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 11, length 64

09:41:58
#10:41:59.347642 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 15, length 64
jo10:42:00.357761 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 16, length 64
bs
[1]+  Running                 tcpdump -i eth0 -n -p icmp &
09:42:00
#10:42:01.367587 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 17, length 64
10:42:02.377663 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 18, length 64
10:42:03.387866 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 19, length 64
fg 1
tcpdump -i eth0 -n -p icmp
10:42:04.397693 IP 192.168.16.24 > 192.168.16.4: ICMP echo request, id 10193, seq 20, length 64
^C
21 packets captured
21 packets received by filter
0 packets dropped by kernel
09:42:21
#iptables -t filter -R 1 INPUT -p icmp -s 192.168.16.24 -j REJECT
iptables v1.4.6: Invalid rule number `INPUT'
Try `iptables -h' or 'iptables --help' for more information.
09:42:28
#iptables -t filter -R 1 -p icmp -s 192.168.16.24 -j REJECT
iptables v1.4.6: -R requires a rule number
Try `iptables -h' or 'iptables --help' for more information.
09:42:35
#iptables -t filter -R INPUT 1 -p icmp -s 192.168.16.24 -j REJECT

09:43:13
#man iptables
09:44:26
#man iptables
09:44:40
#netstat -lnp
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:110             0.0.0.0:*               LISTEN      1950/popa3d
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      6033/perl
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1000/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2593/exim4
tcp        0      0 0.0.0.0:65534           0.0.0.0:*               LISTEN      4845/xinetd
tcp6       0      0 :::5900                 :::*                    LISTEN      1026/Xvnc
tcp6       0      0 :::22                   :::*                    LISTEN      1000/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      2593/exim4
udp        0      0 0.0.0.0:10000           0.0.0.0:*                           6033/perl
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     2588     1077/gnome-keyring- /tmp/keyring-ljZs3L/socket
unix  2      [ ACC ]     STREAM     LISTENING     2382     985/dbus-daemon     /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     2813     1195/dbus-daemon    @/tmp/dbus-gbXyyvwoOE
unix  2      [ ACC ]     STREAM     LISTENING     2799     1191/ssh-agent      /tmp/ssh-WfUKnd1152/agent.1152
unix  2      [ ACC ]     STREAM     LISTENING     2430     1011/gdm            /var/run/gdm_socket
unix  2      [ ACC ]     STREAM     LISTENING     2872     1224/gconfd-2       /tmp/orbit-user/linc-4c8-0-2abf4729e80a8
unix  2      [ ACC ]     STREAM     LISTENING     2889     1219/firefox-bin    /tmp/orbit-user/linc-4c3-0-7d37809017e2
unix  2      [ ACC ]     STREAM     LISTENING     2475     1026/Xvnc           /tmp/.X11-unix/X0
09:45:23
#iptables -t filter -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     icmp --  fbsd4.net.nt         anywhere            reject-with icmp-admin-prohibited
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
09:45:31
#iptables -t filter -A INPUT --dport 110 -s 192.168.16.24 -j DROP
iptables v1.4.6: unknown option `--dport'
Try `iptables -h' or 'iptables --help' for more information.
09:46:09
#iptables -t filter -A INPUT --d-port 110 -s 192.168.16.24 -j DROP
iptables v1.4.6: unknown option `--d-port'
Try `iptables -h' or 'iptables --help' for more information.
09:46:14
#iptables -t filter -A INPUT -p tcp --dport 110 -s 192.168.16.24 -j DROP

09:46:21
#iptables -t filter -A INPUT -p udp --dport 110 -s 192.168.16.24 -j DROP

09:46:49
#man iptables
09:47:09
#vim /etc/protocols
09:47:23
#Updated from http://www.iana.org/assignments/protocol-numbers and other

09:48:17
#iptables -t filter -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     icmp --  fbsd4.net.nt         anywhere            reject-with icmp-admin-prohibited
DROP       tcp  -- !fbsd4.net.nt         anywhere            tcp dpt:pop3
DROP       udp  --  fbsd4.net.nt         anywhere            udp dpt:pop3
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
09:48:22
#iptables -t filter -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     icmp --  192.168.16.24        0.0.0.0/0           reject-with icmp-admin-prohibited
DROP       tcp  -- !192.168.16.24        0.0.0.0/0           tcp dpt:110
DROP       udp  --  192.168.16.24        0.0.0.0/0           udp dpt:110
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
09:48:37
#ssh 192.168.16.254
IPTABLES(8)                                      iptables 1.4.6                                     IPTABLES(8)
NAMEx debian 2.6.26-2-xen-686 #1 SMP Tue Mar 9 20:11:42 UTC 2010 i686
       iptables — administration tool for IPv4 packet filtering and NAT
SYNOPSIS
       iptables [-t table] {-A|-D} chain rule-specificationfree software;
       iptables [-t table] -I chain [rulenum] rule-specificationhe
       iptables [-t table] -R chain rulenum rule-specification
       iptables [-t table] -D chain rulenum
       iptables [-t table] -S [chain [rulenum]]NTY, to the extent
       iptables [-t table] {-F|-L|-Z} [chain [rulenum]] [options...]
...
Bad argument `PREROUTING'
                                                                                                                                                                                                                                                              -A PREROUTING -s 192.168.16.1 -d 192.168.16.254 -p tcp --dport 22222 -j DNAT --to-destinat
Try `iptables -h' or 'iptables --help' for more information.                                                                                  PREROUTING -s 192.168.16.1 -d 192.168.16.254 -p tcp --dport 22222 -j DNAT --to-destinati
                          APREROUTING -s 192.168.16.1 -d 192.168.16.254 -p tcp --dport 22222 -j DNAT --to-destinatio
debian:~# .16.24:22-t nat PREROUTING -s 192.168.16.1 -d 192.168.16.254 -p tcp --dport 22222 -j DNAT --to-destinatio
debian:~#
debian:~#
debian:~# exit
logout
Connection to 192.168.16.254 closed.
09:51:32
#ssh 192.168.16.254 -p 22222
ssh: connect to host 192.168.16.254 port 22222: Connection refused
/dev/pts/7
09:54:01
#nc 192.168.16.254 22222
(UNKNOWN) [192.168.16.254] 22222 (?) : Connection refused
09:54:09
#nc 192.168.16.254 22222
(UNKNOWN) [192.168.16.254] 22222 (?) : Connection refused
09:55:19
#nc 192.168.16.254 22222
(UNKNOWN) [192.168.16.254] 22222 (?) : Connection refused
09:56:39
#nc 192.168.16.254 22222
(UNKNOWN) [192.168.16.254] 22222 (?) : Connection refused
/dev/pts/9
09:59:47
#apt-get install rdesktop
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
НОВЫЕ пакеты, которые будут установлены:
  rdesktop
обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 345 пакетов не обновлено.
Необходимо скачать 133kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 475kB.
Получено:1 http://debian.org.ua squeeze/main rdesktop 1.6.0-3 [133kB]
Получено 133kБ за 0с (581kБ/c)
Выбор ранее не выбранного пакета rdesktop.
(Чтение базы данных ... на данный момент установлено 72218 файлов и каталогов.)
Распаковывается пакет rdesktop (из файла .../rdesktop_1.6.0-3_i386.deb)...
Обрабатываются триггеры для man-db ...
Настраивается пакет rdesktop (1.6.0-3) ...
/dev/pts/1
10:03:28
#exiyt
l3script: exiyt: команда не найдена
/dev/pts/7
10:03:36
#iptables-save > /tmp/ipta

10:03:43
#cat /tmp/ipta
# Generated by iptables-save v1.4.6 on Wed Jun 16 11:03:43 2010
*nat
:PREROUTING ACCEPT [4982:407345]
:POSTROUTING ACCEPT [1628:103141]
:OUTPUT ACCEPT [2252:140293]
COMMIT
# Completed on Wed Jun 16 11:03:43 2010
# Generated by iptables-save v1.4.6 on Wed Jun 16 11:03:43 2010
*mangle
:PREROUTING ACCEPT [1360330:95507131]
...
*filter
:INPUT ACCEPT [33089:2514657]
:FORWARD ACCEPT [0:0]
:OUTPUT DROP [0:0]
-A INPUT -s 192.168.16.24/32 -p icmp -j REJECT --reject-with icmp-admin-prohibited
-A INPUT ! -s 192.168.16.24/32 -p tcp -m tcp --dport 110 -j DROP
-A INPUT -s 192.168.16.24/32 -p udp -m udp --dport 110 -j DROP
-A OUTPUT -j ACCEPT
COMMIT
# Completed on Wed Jun 16 11:03:43 2010
10:03:45
#vim /tmp/ipta
10:06:57
#~
 14 :POSTROUTING ACCEPT [1526476:3549773418]
 15 COMMIT" 27L, 926C
 16 # Completed on Wed Jun 16 11:03:43 2010
 17 # Generated by iptables-save v1.4.6 on Wed Jun 16 11:03:43 2010
 18 *filter
 19 :INPUT ACCEPT [33089:2514657]
 20 :FORWARD ACCEPT [0:0]
 21 :OUTPUT DROP [0:0]
 22 -A INPUT -s 192.168.16.24/32 -p icmp -j REJECT --reject-with icmp-admin-prohibited
 23 -A INPUT ! -s 192.168.16.24/32 -p tcp -m tcp --dport 110 -j DROP
 24 -A INPUT -s 192.168.16.24/32 -p udp -m udp --dport 110 -j DROP
 25 -A OUTPUT -j ACCEPT
 26 COMMIT
 27 # Completed on Wed Jun 16 11:03:43 2010
прошло 10 минут
10:17:42
#~
IPTABLES(8)                                      iptables 1.4.6                                     IPTABLES(8)
NAME
       iptables — administration tool for IPv4 packet filtering and NAT
NAME
SYNOPSIS
       iptables [-t table] {-A|-D} chain rule-specificationtering and NAT
       iptables [-t table] -I chain [rulenum] rule-specification
       iptables [-t table] -R chain rulenum rule-specification
       iptables [-t table] -D chain rulenumle-specification
       iptables [-t table] -S [chain [rulenum]]
...
              nels (>= 2.6.11-rc1) don't have the ability to NAT to multiple ranges anymore.
       --random
              If option --random is used then port mapping will be randomized (kernel >= 2.6.21).
       --persistent
              Gives a client the same source-/destination-address for each  connection.   This  supersedes  the
              SAME target. Support for persistent mappings is available from 2.6.29-rc2.
   TCPMSS
       This  target allows to alter the MSS value of TCP SYN packets, to control the maximum size for that con‐
       nection (usually limiting it to your outgoing interface's MTU minus 40 for IPv4 or 60 for IPv6,  respec‐
       tively).  Of course, it can only be used in conjunction with -p tcp.  It is only valid in the mangle ta‐
10:20:59
#man iptables
прошло 57 минут
11:18:32
#man iptables
11:22:27
#ipt
iptables          iptables-apply    iptables-multi    iptables-restore  iptables-save     iptunnel
прошло 12 минут
11:34:49
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     icmp --  fbsd4.net.nt         anywhere            reject-with icmp-admin-prohibited
DROP       tcp  -- !fbsd4.net.nt         anywhere            tcp dpt:pop3
DROP       udp  --  fbsd4.net.nt         anywhere            udp dpt:pop3
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  --  192.168.0.0/24       192.168.16.0/24     tcp dpt:pop3
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
11:34:56
#iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     icmp --  192.168.16.24        0.0.0.0/0           reject-with icmp-admin-prohibited
DROP       tcp  -- !192.168.16.24        0.0.0.0/0           tcp dpt:110
DROP       udp  --  192.168.16.24        0.0.0.0/0           udp dpt:110
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  --  192.168.0.0/24       192.168.16.0/24     tcp dpt:110
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
прошло 11 минут
11:46:26
#iptables -n -S
iptables v1.4.6: Illegal option `-n' with this command
Try `iptables -h' or 'iptables --help' for more information.
11:46:35
#iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT DROP
-A INPUT -s 192.168.16.24/32 -p icmp -j REJECT --reject-with icmp-admin-prohibited
-A INPUT ! -s 192.168.16.24/32 -p tcp -m tcp --dport 110 -j DROP
-A INPUT -s 192.168.16.24/32 -p udp -m udp --dport 110 -j DROP
-A FORWARD -s 192.168.0.0/24 -d 192.168.16.0/24 -p tcp -m tcp --dport 110 -j DROP
-A OUTPUT -j ACCEPT
11:46:40
#iptables -D 4
iptables: Bad rule (does a matching rule exist in that chain?).
11:47:53
#iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     icmp --  192.168.16.24        0.0.0.0/0           reject-with icmp-admin-prohibited
DROP       tcp  -- !192.168.16.24        0.0.0.0/0           tcp dpt:110
DROP       udp  --  192.168.16.24        0.0.0.0/0           udp dpt:110
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  --  192.168.0.0/24       192.168.16.0/24     tcp dpt:110
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
11:48:28
#iptables -D 1
iptables: Bad rule (does a matching rule exist in that chain?).
11:48:47
#iptables -R INPUT
iptables v1.4.6: -R requires a rule number
Try `iptables -h' or 'iptables --help' for more information.
11:50:57
#iptables -R INPUT 1

11:51:02
#iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
           all  --  0.0.0.0/0            0.0.0.0/0
DROP       tcp  -- !192.168.16.24        0.0.0.0/0           tcp dpt:110
DROP       udp  --  192.168.16.24        0.0.0.0/0           udp dpt:110
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  --  192.168.0.0/24       192.168.16.0/24     tcp dpt:110
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
11:51:13
#iptables -D INPUT 1

11:51:37
#iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  -- !192.168.16.24        0.0.0.0/0           tcp dpt:110
DROP       udp  --  192.168.16.24        0.0.0.0/0           udp dpt:110
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  --  192.168.0.0/24       192.168.16.0/24     tcp dpt:110
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
11:51:41
#iptables -F INPUT

11:52:20
#iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  --  192.168.0.0/24       192.168.16.0/24     tcp dpt:110
Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
11:52:22
#iptables -F OUTPUT

/dev/hvc0
12:01:26
#vim /etc/protocols
12:01:26
#tc

12:01:26
#L
                  man iptables
CT --reject-with icmp-admin-prohibitedR INPUT 1 -p icmp -s 192.168.16.24 -j REJEC
12:01:26
#1 -p icmp -s 192.168.16.24 -j REJECT

12:01:58
#vim /etc/protocols
12:01:58
#tc

12:01:58
#L
                  man iptables
CT --reject-with icmp-admin-prohibitedR INPUT 1 -p icmp -s 192.168.16.24 -j REJEC
12:01:58
#1 -p icmp -s 192.168.16.24 -j REJECT

12:02:15
#iptables -t filter -P OUTPUT ALLO
iptables: Bad policy name. Run `dmesg' for more information.
12:02:19
#w
 13:02:19 up 1 day,  3:11,  4 users,  load average: 0,00, 0,00, 0,00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
user     console  :0               Tue09   27:11m  0.00s 29.22s fluxbox
user     pts/3    :0:S.1           Tue16   39:48   0.44s  0.20s ssh 192.168.16.
root     hvc0                      13:01    0.00s  0.04s  0.00s script -f -c l3
user     pts/7    :0:S.2           10:53    8:48   0.28s  0.20s /bin/bash
12:02:19
#iptables -t filter -P OUTPUT ALLOW
iptables: Bad policy name. Run `dmesg' for more information.
12:02:23
#iptables -t filter -P OUTPUT ACCEP
iptables: Bad policy name. Run `dmesg' for more information.
12:02:26
#iptables -t filter -P OUTPUT ACCEPT

Файлы

  • /tmp/ipta
  • /tmp/ipta
    >
    # Generated by iptables-save v1.4.6 on Wed Jun 16 11:03:43 2010
    *nat
    :PREROUTING ACCEPT [4982:407345]
    :POSTROUTING ACCEPT [1628:103141]
    :OUTPUT ACCEPT [2252:140293]
    COMMIT
    # Completed on Wed Jun 16 11:03:43 2010
    # Generated by iptables-save v1.4.6 on Wed Jun 16 11:03:43 2010
    *mangle
    :PREROUTING ACCEPT [1360330:95507131]
    :INPUT ACCEPT [1358921:95363999]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [1527300:3550097874]
    :POSTROUTING ACCEPT [1526476:3549773418]
    COMMIT
    # Completed on Wed Jun 16 11:03:43 2010
    # Generated by iptables-save v1.4.6 on Wed Jun 16 11:03:43 2010
    *filter
    :INPUT ACCEPT [33089:2514657]
    :FORWARD ACCEPT [0:0]
    :OUTPUT DROP [0:0]
    -A INPUT -s 192.168.16.24/32 -p icmp -j REJECT --reject-with icmp-admin-prohibited
    -A INPUT ! -s 192.168.16.24/32 -p tcp -m tcp --dport 110 -j DROP
    -A INPUT -s 192.168.16.24/32 -p udp -m udp --dport 110 -j DROP
    -A OUTPUT -j ACCEPT
    COMMIT
    # Completed on Wed Jun 16 11:03:43 2010
    

    Статистика

    Время первой команды журнала09:36:04 2010- 6-16
    Время последней команды журнала12:02:26 2010- 6-16
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %19.80
    Процент синтаксически неверно набранных команд, % 0.99
    Суммарное время работы с терминалом *, час 1.48
    Количество командных строк в единицу времени, команда/мин 1.14
    Частота использования команд
    iptables65|=============================================================| 61.32%
    man5|====| 4.72%
    vim4|===| 3.77%
    192.168.16.4:4|===| 3.77%
    nc4|===| 3.77%
    tc2|=| 1.89%
    L2|=| 1.89%
    12|=| 1.89%
    ~2|=| 1.89%
    ssh2|=| 1.89%
    10:41:59.3476421|| 0.94%
    10:41:55.3077011|| 0.94%
    ipt1|| 0.94%
    Updated1|| 0.94%
    bg1|| 0.94%
    10:42:01.3675871|| 0.94%
    iptables-save1|| 0.94%
    ipta1|| 0.94%
    exiyt1|| 0.94%
    netstat1|| 0.94%
    apt-get1|| 0.94%
    cat1|| 0.94%
    10:41:54.2975931|| 0.94%
    w1|| 0.94%
    ____
    *) Интервалы неактивности длительностью 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$