/l3/users/eb/2009/linux16/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 |
|
#telnet 192.168.107.2
Trying 192.168.107.2... telnet: Unable to connect to remote host: Connection timed out |
#ping -f 192.168.107.2
PING 192.168.107.2 (192.168.107.2) 56(84) bytes of data. |
#ssh root@192.168.107.2
ssh: connect to host 192.168.107.2 port 22: Connection timed out |
#telnet 192.168.107.2
Trying 192.168.107.2... telnet: Unable to connect to remote host: Connection refused |
#ping 192.168.107.2
PING 192.168.107.2 (192.168.107.2) 56(84) bytes of data. From 10.0.35.1: icmp_seq=2 Redirect Host(New nexthop: 10.0.35.22) --- 192.168.107.2 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1008ms |
#ssh root@192.168.107.2
Linux linux14 2.6.29-2-686 #1 SMP Sun May 17 17:56:29 UTC 2009 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Jun 2 13:34:51 2009 from linux11.unix.nt l3-agent is already running: pid=22520; pidfile=/root/.lilalo/l3-agent.pid |
#ping 192.168.107.1
PING 192.168.107.1 (192.168.107.1) 56(84) bytes of data. 64 bytes from 192.168.107.1: icmp_seq=1 ttl=63 time=0.218 ms --- 192.168.107.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.218/0.218/0.218/0.000 ms |
#ssh 192.168.107.2
|
#w
13:55:03 up 22:46, 20 users, load average: 0,00, 0,00, 0,00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/2 linux9.unix.nt 09:48 1:24m 0.12s 0.00s script -f -c ba root pts/6 192.168.106.2 10:04 1:17m 0.16s 0.01s script -f -c ba root pts/8 192.168.108.2 13:54 1.00s 0.01s 0.01s script -f -c ba root pts/10 192.168.107.2 12:16 1:38m 0.03s 0.00s script -f -c ba root pts/14 linux3.unix.nt 10:17 48:49 0.07s 0.00s script -f -c ba root pts/16 192.168.103.2 10:17 3:10m 0.10s 0.00s script -f -c ba root pts/18 linux15.unix.nt 10:17 3:09m 0.10s 0.01s script -f -c ba root pts/20 192.168.105.2 10:18 1:14m 0.03s 0.02s script -f -c ba ... root pts/32 linux1.unix.nt 10:57 1:01m 0.02s 0.00s script -f -c ba root pts/34 192.168.101.2 11:08 1:33m 0.03s 0.01s script -f -c ba root pts/36 192.168.107.2 11:10 2:44m 0.00s 0.00s script -f -c ba root pts/12 192.168.102.2 10:16 2:02m 0.13s 0.00s script -f -c ba root pts/0 :pts/2:S.0 Mon17 1:04m 0.09s 0.02s script -f -c /b root pts/3 linux6.unix.nt Mon17 2:15m 0.21s 0.00s script -f -c ba root pts/24 :pts/31:S.1 10:41 1:00m 0.11s 0.03s script -f -c /b root pts/38 :pts/23:S.2 11:33 2:20m 0.00s 0.00s script -f -c /b root pts/40 192.168.104.8 11:39 2:15m 0.03s 0.01s script -f -c ba root pts/42 linux13.unix.nt 11:48 1:01m 0.03s 0.00s script -f -c ba |
#screen -x pts/10
|
#telnet 192.168.107.2
Trying 192.168.107.2... telnet: Unable to connect to remote host: Connection refused |
#ssh 192.168.107.2
ssh: connect to host 192.168.107.2 port 22: Connection timed out |
#telnet 192.168.107.2
Trying 192.168.107.2... telnet: Unable to connect to remote host: Connection refused |
#ыssh user@192.168.107.2
The authenticity of host '192.168.107.2 (192.168.107.2)' can't be established. RSA key fingerprint is 34:6c:c2:da:38:7c:d7:17:e9:cd:17:8d:e7:cf:f1:a6. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.107.2' (RSA) to the list of known hosts. user@192.168.107.2's password: Linux linux14 2.6.29-2-686 #1 SMP Sun May 17 17:56:29 UTC 2009 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Sat May 30 12:57:57 2009 |
$ifconfig
bash: ifconfig: команда не найдена |
#nmap 192.168.107.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 13:58 EEST Interesting ports on 192.168.107.2: Not shown: 1709 closed ports PORT STATE SERVICE 22/tcp open ssh 79/tcp open finger 113/tcp open auth 139/tcp open netbios-ssn 445/tcp open microsoft-ds 9999/tcp open abyss Nmap done: 1 IP address (1 host up) scanned in 20.991 seconds |
$sudo ifconfig
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for user: user is not in the sudoers file. This incident will be reported. |
#ssh 192.168.107.2
ssh: connect to host 192.168.107.2 port 22: Connection timed out |
$sudo ls /etc
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for user: user is not in the sudoers file. This incident will be reported. |
$ls /etc
a2ps.cfg exim4 locale.gen purple a2ps-site.cfg ffserver.conf localtime python adduser.conf fonts logcheck python2.5 adduser.conf.dpkg-save fstab login.defs qemu-ifup adjtime fuse.conf logrotate.conf rarfiles.lst aliases gai.conf logrotate.d rc0.d alternatives gamin lsb-base rc1.d anacrontab gconf lvm rc2.d apache2 gdm magic rc3.d apm ggi magic.mime rc4.d ... dictionaries-common ld.so.cache pbuilder vga dm ld.so.conf pbuilderrc vim dpkg ld.so.conf.d perl vlc dput.cf libaudit.conf pm wgetrc emacs libnss-ldap.conf PolicyKit X11 email-addresses libnss-ldap.secret ppp xdg environment libpaper.d printcap xml esound lilalo profile ethers lintianrc protocols etter.conf locale.alias pulse |
$su
Пароль: |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bd:0e inet addr:192.168.107.2 Bcast:192.168.107.255 Mask:255.255.255.0 inet6 addr: fe80::21b:fcff:fe7d:bd0e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:863259 errors:0 dropped:0 overruns:0 frame:0 TX packets:823522 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:88364404 (84.2 MiB) TX bytes:80287021 (76.5 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:781 errors:0 dropped:0 overruns:0 frame:0 TX packets:781 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:71127 (69.4 KiB) TX bytes:71127 (69.4 KiB) |
#ls /etc | grep passwd
passwd passwd- |
#ls -l /etc | grep passwd
-rw-r--r-- 1 root root 10106 Май 30 14:54 passwd -rw------- 1 root root 10106 Май 30 14:54 passwd- |
#cat > if\
> nc |
#ssh 192.168.107.2 -p 113
ssh: connect to host 192.168.107.2 port 113: Connection timed out |
#exit
exit Connection to 10.0.35.100 closed. |
#nc 192.168.107.2 79
(UNKNOWN) [192.168.107.2] 79 (finger) : Connection timed out |
#passwd
Введите новый пароль UNIX: Повторите ввод нового пароля UNIX: passwd: пароль успешно обновлён |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bd:0e inet addr:192.168.107.2 Bcast:192.168.107.255 Mask:255.255.255.0 inet6 addr: fe80::21b:fcff:fe7d:bd0e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:889341 errors:0 dropped:0 overruns:0 frame:0 TX packets:849593 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:90937334 (86.7 MiB) TX bytes:82852468 (79.0 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:781 errors:0 dropped:0 overruns:0 frame:0 TX packets:781 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:71127 (69.4 KiB) TX bytes:71127 (69.4 KiB) |
#cat > /etc/passwd
^C |
#ls -l /etc | grep passwd
-rw-r--r-- 1 0 root 0 Июн 2 14:05 passwd -rw------- 1 0 root 10106 Май 30 14:54 passwd- |
#ÑÐiptables -A INPUT -i eth0 -p tcp --dport 22 j ACCEPT
Bad argument `j' Try `iptables -h' or 'iptables --help' for more information. |
#ssh root@10.0.35.100
root@10.0.35.100's password: Linux linux0 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Jun 2 14:33:58 2009 from linux11.unix.nt l3-agent is already running: pid=1765; pidfile=/root/.lilalo/l3-agent.pid |
$exit
exit Connection to 192.168.107.2 closed. |
#ssh user@192.168.107.2
ssh_exchange_identification: Connection closed by remote host |
$ssh гы192.168.107.2
^C |
$ssh 192.168.107.2
^C |
#ssh user@192.168.107.2
ssh_exchange_identification: Connection closed by remote host |
$ssh 192.168.107.2
ssh_exchange_identification: Connection closed by remote host |
#iptables -A INPUT -i eth0 -j REJECT
|
#nmap 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:28 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open ssh 9999/tcp open abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 19.069 seconds |
#nmap 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:29 EEST Interesting ports on 192.168.108.2: Not shown: 1711 closed ports PORT STATE SERVICE 22/tcp open ssh 79/tcp open finger 111/tcp open rpcbind 9999/tcp open abyss Nmap done: 1 IP address (1 host up) scanned in 13.109 seconds |
#nmap 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:30 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open ssh 9999/tcp open abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 17.745 seconds |
#nmap 192.168.107,2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:33 EEST Invalid target host specification: 192.168.107,2 QUITTING! |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:76:a1:f0:5d inet addr:192.168.108.2 Bcast:192.168.108.255 Mask:255.255.255.0 inet6 addr: fe80::204:76ff:fea1:f05d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:843655 errors:462 dropped:0 overruns:0 frame:462 TX packets:879095 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:86581162 (82.5 MiB) TX bytes:86238278 (82.2 MiB) Interrupt:20 Base address:0x2c00 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3442 errors:0 dropped:0 overruns:0 frame:0 TX packets:3442 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:144796 (141.4 KiB) TX bytes:144796 (141.4 KiB) |
#less /etc/inetd.conf
|
#шасщnmap 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:35 EEST Interesting ports on 192.168.108.2: Not shown: 1711 closed ports PORT STATE SERVICE 22/tcp open ssh 79/tcp open finger 111/tcp open rpcbind 9999/tcp open abyss Nmap done: 1 IP address (1 host up) scanned in 13.105 seconds |
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.108.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.108.1 0.0.0.0 UG 0 0 0 eth0 |
#netstat -pln
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:79 0.0.0.0:* LISTEN 3041/inetd tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 2751/apt-proxy tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2436/portmap tcp 0 0 0.0.0.0:36977 0.0.0.0:* LISTEN 2447/rpc.statd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2721/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3018/exim4 tcp6 0 0 :::22 :::* LISTEN 2721/sshd udp 0 0 0.0.0.0:45213 0.0.0.0:* 2447/rpc.statd ... unix 2 [ ACC ] STREAM LISTENING 64288 4888/pidgin /tmp/orbit-user/linc-1318-0-12f8bb1d19606 unix 2 [ ACC ] STREAM LISTENING 7750 3028/lpd /dev/printer unix 2 [ ACC ] STREAM LISTENING 8522 3233/X @/tmp/.X11-unix/X0 unix 2 [ ACC ] STREAM LISTENING 7795 3057/hald @/var/run/hald/dbus-c5qH9QXGR0 unix 2 [ ACC ] STREAM LISTENING 8406 3220/gdm /var/run/gdm_socket unix 2 [ ACC ] STREAM LISTENING 10115 3454/gam_server @/tmp/fam-user- unix 2 [ ACC ] STREAM LISTENING 10024 3444/dbus-daemon @/tmp/dbus-Ub2GS4AG7s unix 2 [ ACC ] STREAM LISTENING 7390 2710/dbus-daemon /var/run/dbus/system_bus_socket unix 2 [ ACC ] STREAM LISTENING 7358 2700/syslog-ng /dev/log unix 2 [ ACC ] STREAM LISTENING 10053 3333/x-session-mana @/tmp/.ICE-unix/3333 |
#pkill 1 inetd
Usage: pkill [-SIGNAL] [-fvx] [-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST] [-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] [PATTERN] |
#pkill -1 inetd
|
#netstat -pln
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:9999 0.0.0.0:* LISTEN 2751/apt-proxy tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2436/portmap tcp 0 0 0.0.0.0:36977 0.0.0.0:* LISTEN 2447/rpc.statd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2721/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3018/exim4 tcp6 0 0 :::22 :::* LISTEN 2721/sshd udp 0 0 0.0.0.0:45213 0.0.0.0:* 2447/rpc.statd udp 0 0 0.0.0.0:927 0.0.0.0:* 2447/rpc.statd ... unix 2 [ ACC ] STREAM LISTENING 64288 4888/pidgin /tmp/orbit-user/linc-1318-0-12f8bb1d19606 unix 2 [ ACC ] STREAM LISTENING 7750 3028/lpd /dev/printer unix 2 [ ACC ] STREAM LISTENING 8522 3233/X @/tmp/.X11-unix/X0 unix 2 [ ACC ] STREAM LISTENING 7795 3057/hald @/var/run/hald/dbus-c5qH9QXGR0 unix 2 [ ACC ] STREAM LISTENING 8406 3220/gdm /var/run/gdm_socket unix 2 [ ACC ] STREAM LISTENING 10115 3454/gam_server @/tmp/fam-user- unix 2 [ ACC ] STREAM LISTENING 10024 3444/dbus-daemon @/tmp/dbus-Ub2GS4AG7s unix 2 [ ACC ] STREAM LISTENING 7390 2710/dbus-daemon /var/run/dbus/system_bus_socket unix 2 [ ACC ] STREAM LISTENING 7358 2700/syslog-ng /dev/log unix 2 [ ACC ] STREAM LISTENING 10053 3333/x-session-mana @/tmp/.ICE-unix/3333 |
#nmap 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:36 EEST Interesting ports on 192.168.108.2: Not shown: 1712 closed ports PORT STATE SERVICE 22/tcp open ssh 111/tcp open rpcbind 9999/tcp open abyss Nmap done: 1 IP address (1 host up) scanned in 13.111 seconds |
#iptables\
> |
#iptables
iptables v1.4.3.2: no command specified Try `iptables -h' or 'iptables --help' for more information. |
#iptables -h
iptables v1.4.3.2 Usage: iptables -[AD] chain rule-specification [options] iptables -I chain [rulenum] rule-specification [options] iptables -R chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LS] [chain [rulenum]] [options] iptables -[FZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] ... [!] --out-interface -o output name[+] network interface name ([+] for wildcard) --table -t table table to manipulate (default: `filter') --verbose -v verbose mode --line-numbers print line numbers when listing --exact -x expand numbers (display exact values) [!] --fragment -f match second or further fragments only --modprobe=<command> try to insert modules using this command --set-counters PKTS BYTES set the counter during insert/append [!] --version -V print package version. |
#iptables -F INPUT
|
#шасщiptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
|
#nmap 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:42 EEST Interesting ports on 192.168.108.2: Not shown: 1712 closed ports PORT STATE SERVICE 22/tcp open ssh 111/tcp open rpcbind 9999/tcp open abyss Nmap done: 1 IP address (1 host up) scanned in 0.109 seconds |
#тьnmap -T4 -sF 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:53 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open|filtered ssh 9999/tcp filtered abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 6.214 seconds |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 14:55:59 2009 *filter :INPUT ACCEPT [18290:1110449] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [23148:1088630] -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 14:55:59 2009 |
#nmap -T4 -sF 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:57 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open|filtered ssh 9999/tcp open|filtered abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 5.640 seconds |
#nmap -T4 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:58 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open ssh 9999/tcp open abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 5.392 seconds |
#nmap -T4 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:58 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open ssh 9999/tcp open abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 4.398 seconds |
#nmap -T4 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 14:59 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open ssh 9999/tcp open abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 5.385 seconds |
#nmap -T4 -sF 192.168.108.1
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 15:01 EEST Interesting ports on 192.168.108.1: Not shown: 1713 closed ports PORT STATE SERVICE 22/tcp open|filtered ssh 9999/tcp open|filtered abyss MAC Address: 00:22:15:C8:4E:D2 (Asustek Computer) Nmap done: 1 IP address (1 host up) scanned in 5.566 seconds |
#iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
|
#iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
#iptables -A INPUT -i eth0 -j REJECT
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:15:53 2009 *filter :INPUT ACCEPT [27629:2027530] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [34196:1591371] -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -i eth0 -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 15:15:53 2009 |
#iptables -h
iptables v1.4.3.2 Usage: iptables -[AD] chain rule-specification [options] iptables -I chain [rulenum] rule-specification [options] iptables -R chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LS] [chain [rulenum]] [options] iptables -[FZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] ... [!] --out-interface -o output name[+] network interface name ([+] for wildcard) --table -t table table to manipulate (default: `filter') --verbose -v verbose mode --line-numbers print line numbers when listing --exact -x expand numbers (display exact values) [!] --fragment -f match second or further fragments only --modprobe=<command> try to insert modules using this command --set-counters PKTS BYTES set the counter during insert/append [!] --version -V print package version. |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:18:58 2009 *filter :INPUT ACCEPT [27629:2027530] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [34349:1600795] -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -i eth0 -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 15:18:58 2009 |
#iptables -D INPUT -i eth0 -j REJECT
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:19:23 2009 *filter :INPUT ACCEPT [27732:2031650] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [34475:1606415] -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT COMMIT # Completed on Tue Jun 2 15:19:23 2009 |
#iptables -A INPUT -i eth0 -p tcp --syn -j REJECT
|
#iptables -D INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j REJEC
iptables v1.4.3.2: Couldn't load target `REJEC':/lib/xtables/libipt_REJEC.so: cannot open shared object file: No such file or directory Try `iptables -h' or 'iptables --help' for more information. |
$ssh root@192.168.107.1
root@192.168.107.1's password: Linux linux13 2.6.29-2-686 #1 SMP Sun May 17 17:56:29 UTC 2009 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Jun 2 15:17:33 2009 from linux11.unix.nt l3-agent is already running: pid=3758; pidfile=/root/.lilalo/l3-agent.pid |
#ping 192.168.108.2
PING 192.168.108.2 (192.168.108.2) 56(84) bytes of data. 64 bytes from 192.168.108.2: icmp_seq=1 ttl=63 time=0.595 ms 64 bytes from 192.168.108.2: icmp_seq=2 ttl=63 time=0.352 ms ^C --- 192.168.108.2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.352/0.473/0.595/0.123 ms |
#nmap -Fs 192.168.108.2
nmap: option '-Fs' is ambiguous Nmap 4.68 ( http://nmap.org ) Usage: nmap [Scan Type(s)] [Options] {target specification} TARGET SPECIFICATION: Can pass hostnames, IP addresses, networks, etc. Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254 -iL <inputfilename>: Input from list of hosts/networks -iR <num hosts>: Choose random targets --exclude <host1[,host2][,host3],...>: Exclude hosts/networks --excludefile <exclude_file>: Exclude list from file ... --send-eth/--send-ip: Send using raw ethernet frames or IP packets --privileged: Assume that the user is fully privileged --unprivileged: Assume the user lacks raw socket privileges -V: Print version number -h: Print this help summary page. EXAMPLES: nmap -v -A scanme.nmap.org nmap -v -sP 192.168.0.0/16 10.0.0.0/8 nmap -v -iR 10000 -PN -p 80 SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES |
#nmap T4 -Fs 192.168.108.2
nmap: option '-Fs' is ambiguous Nmap 4.68 ( http://nmap.org ) Usage: nmap [Scan Type(s)] [Options] {target specification} TARGET SPECIFICATION: Can pass hostnames, IP addresses, networks, etc. Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254 -iL <inputfilename>: Input from list of hosts/networks -iR <num hosts>: Choose random targets --exclude <host1[,host2][,host3],...>: Exclude hosts/networks --excludefile <exclude_file>: Exclude list from file ... --send-eth/--send-ip: Send using raw ethernet frames or IP packets --privileged: Assume that the user is fully privileged --unprivileged: Assume the user lacks raw socket privileges -V: Print version number -h: Print this help summary page. EXAMPLES: nmap -v -A scanme.nmap.org nmap -v -sP 192.168.0.0/16 10.0.0.0/8 nmap -v -iR 10000 -PN -p 80 SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES |
#nmap T4 -sF 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 15:21 EEST Failed to resolve given hostname/IP: T4. Note that you can't use '/mask' AND '1-4,7,100-' style IP ranges Interesting ports on 192.168.108.2: Not shown: 1712 closed ports PORT STATE SERVICE 22/tcp open|filtered ssh 111/tcp open|filtered rpcbind 9999/tcp open|filtered abyss Nmap done: 1 IP address (1 host up) scanned in 12.111 seconds |
#man iptables
|
#iptables -D INPUT -i eth0 -p tcp --syn -j REJEC
iptables v1.4.3.2: Couldn't load target `REJEC':/lib/xtables/libipt_REJEC.so: cannot open shared object file: No such file or directory Try `iptables -h' or 'iptables --help' for more information. |
#iptables -D 3
iptables: Bad rule (does a matching rule exist in that chain?). |
#iptables -DF 3
iptables: No chain/target/match by that name. |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:23:15 2009 *filter :INPUT ACCEPT [33650:2269346] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [42031:1942035] -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 15:23:15 2009 |
#iptables -F
|
Время первой команды журнала | 13:48:16 2009- 6- 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:23:15 2009- 6- 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 29.70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.06 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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