/l3/users/clint/nt-lNet/linux4.linux.nt/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 |
|
#exit
Connection to 192.168.15.2 closed. |
#netstat -lp | grep inetd
![]() |
#/etc/init.d/inetd restart
Restarting internet superserver: inetd. |
#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 rabotaet! |
#who
user :0 Sep 18 09:42 user pts/1 Sep 19 12:45 (:0.0) user pts/3 Sep 18 16:24 (:0.0) user pts/7 Sep 19 12:57 (:0.0) |
#[root@linux4:/]# Connection closed by foreign host.
![]() |
#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 |
#iptables -A INPUT -p icmp -j DROP
|
#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 |
#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 |
#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 |
#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 |
$su -
Password: l3-agent is already running: pid=4645; pidfile=/root/.lilalo/l3-agent.pid |
#watch iptables -L -v
|
#watch iptables -L -v
|
#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 |
#iptables -D INPUT -p icmp -j DROP
|
#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 |
#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 |
#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 |
#iptables -A INPUT -s 192.168.15.254 -j DROP
|
#ping 192.168.15.254
![]() 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 |
#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 |
#iptables -L --line-nubers
![]() iptables v1.2.11: Unknown arg `--line-nubers' Try `iptables -h' or 'iptables --help' for more information. |
#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 |
#iptables -D INPUT 1
|
#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 |
#telnet 127.0.0.1 chargen
Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. ^] telnet> q Connection closed. |
#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. |
#telnet 127.0.0.1 chargen
Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. ^] telnet> q Connection closed. |
#iptables -A INPUT --dport 19 -p tcp -j DROP
![]() iptables v1.2.11: Unknown arg `--dport' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A INPUT -p tcp --dport 53 -j DROP
|
#telnet 127.0.0.1 chargen
![]() Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Connection closed by foreign host. |
#telnet 192.168.15.4 19
![]() Trying 192.168.15.4... Connected to 192.168.15.4. Escape character is '^]'. Connection closed by foreign host. |
#iptables -A INPUT -p tcp --dport 19 -j DROP
|
#telnet 192.168.15.4 19
![]() Trying 192.168.15.4... ^]q ^]q |
#iptables -D INPUT -p tcp --dport 53 -j DROP
|
#telnet 192.168.15.4 19
![]() Trying 192.168.15.4... |
#iptables -D INPUT -p tcp --dport 19 -j DROP
|
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whit
![]() |
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith t
![]() |
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tc
![]() |
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tcp-re
![]() |
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tcp-reset
![]() iptables v1.2.11: Unknown arg `--reject-whith' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-whith tcp-reset
![]() iptables v1.2.11: Unknown arg `--reject-whith' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-with tcp-reset
|
#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 |
#nmap -sS 192.168.15.4
![]() bash: nmap: command not found |
#apt-get install nmap
Reading Package Lists... Done Building Dependency Tree... Done The following NEW packages will be installed: 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) ... |
#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 |
#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 |
#iptables -D INPUT 1
|
#telnet 192.168.15.4 19
![]() |
#iptables -A INPUT -p tcp --dport 19 -j DROP
|
#nmap 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:54 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.407 seconds by default connet sposob of scan |
#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 |
#nmap -sF 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 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 |
#nmap -p 22 '192.168.15.*'
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:56 EEST Interesting ports on linux2.linux.nt (192.168.15.2): PORT STATE SERVICE 22/tcp open ssh MAC Address: 00:15:F2:6B:55:25 (Asustek Computer) Interesting ports on linux3.lucky.linux.nt (192.168.15.3): PORT STATE SERVICE 22/tcp open ssh MAC Address: 00:0E:A6:20:53:20 (Asustek Computer) Interesting ports on linux4.max.linux.nt (192.168.15.4): PORT STATE SERVICE 22/tcp open ssh 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 |
#iptables -D INPUT -p tcp --dport 19 -j DROP
|
#iptables -A INPUT -p tcp --dport 19 -j RESET --reset-with tcp-reset
![]() iptables v1.2.11: Unknown arg `--reset-with' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A INPUT -p tcp --dport 19 -j REJECT --reject-with tcp-reset
|
#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 |
#nmap -p 19 192.168.15.4
![]() |
#telnet 192.168.15.4
![]() Trying 192.168.15.4... telnet: Unable to connect to remote host: Connection refused |
#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 |
#nmap -p -sS 19 192.168.15.4
![]() 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! |
#nmap -p 19
![]() Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 14:59 EEST Invalid target host specification: 19 QUITTING! |
#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 |
#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 |
#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 |
#iptables -D INPUT 1
|
#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 close all ports no ostavit` tolko 22 i 25 port |
#iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
#iptables -A INPUT -p tcp --dport 25 -j ACCEPT
|
#iptables -A INPUT -p tcp -j DROP
|
#iptables -D INPUT -p tcp -j DROP
|
#iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
|
#nmap 192.168.15.4
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-09-19 15:03 EEST Interesting ports on linux4.max.linux.nt (192.168.15.4): Not shown: 1679 closed ports PORT STATE SERVICE 22/tcp open ssh Nmap finished: 1 IP address (1 host up) scanned in 0.211 seconds |
#netstat -lnp | grep :25
![]() |
#ping mail.ru
PING mail.ru (194.67.57.26) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.26): icmp_seq=2 ttl=111 time=150 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=3 ttl=111 time=179 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=4 ttl=111 time=168 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=5 ttl=111 time=91.6 ms --- mail.ru ping statistics --- 5 packets transmitted, 4 received, 20% packet loss, time 4026ms rtt min/avg/max/mdev = 91.678/147.258/179.040/33.699 ms |
#man iptables
i net svjazi s vmeshnim mirom для устранения - нужно отрезать лишь первый пакут с флагом syn |
#iptables -D INPUT 3
|
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT tcp -- anywhere anywhere tcp dpt:smtp REJECT tcp -- anywhere anywhere tcp flags:SYN,RST,ACK/SYN reject-with tcp-reset Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -F INPUT
|
Время первой команды журнала | 14:21:12 2006- 9-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:13:51 2006- 9-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 20.22 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 2.25 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 0.88 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.69 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008