/l3/users/clint/nt-lnet-2006-06-26/linux1.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 |
|
#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 -
Bad argument `-' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -P
iptables v1.2.11: Unknown arg `-P' Try `iptables -h' or 'iptables --help' for more information. |
#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 -h
iptables v1.2.11 Usage: iptables -[AD] chain rule-specification [options] iptables -[RI] chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LFZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] iptables -h (print this help information) Commands: ... --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. |
#vi /etc/host
|
#vi /etc/hosts.allow
14c14 < sshd : ALL --- > #sshd : ALL |
#netstat -lnp
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2545/exim4 tcp6 0 0 :::20000 :::* LISTEN 4645/sshd tcp6 0 0 :::20 :::* LISTEN 4561/sshd tcp6 0 0 :::22 :::* LISTEN 2562/sshd udp 0 0 0.0.0.0:111 0.0.0.0:* 2040/portmap udp 0 0 0.0.0.0:755 0.0.0.0:* 2699/rpc.statd udp 0 0 0.0.0.0:758 0.0.0.0:* 2699/rpc.statd Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 4677 2587/xfs /tmp/.font-unix/fs7100 unix 2 [ ACC ] STREAM LISTENING 4777 2689/Xprt /tmp/.X11-unix/X64 unix 2 [ ACC ] STREAM LISTENING 4547 2555/lpd /dev/printer |
#vi /etc/
|
#/etc/i
imlib init.d iproute2 |
#/etc/init.d/
bash: /etc/init.d/: is a directory |
#/etc/init.d/exim4
.bash_history .ICEauthority mbox .viminfo .bash_profile .kde .mcop .Xauthority .bashrc .kderc .qt .xsession-errors Desktop .l3rc .ssh .fonts.cache-1 .lilalo test |
#vi /etc/i
|
#vi /etc/init.d/exim4
|
#vi /etc/init.d/
|
#vi /etc/init.d/portmap
|
#telnet 127.0.0.1 25
Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. 220 linux1.unix.nt ESMTP Exim 4.34 Tue, 27 Jun 2006 12:28:06 +0300 ^] telnet> q Connection closed. |
#telnet 127.0.0.1 9
Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused |
#[root@linux1:user]# echo -?
-? |
#vi /etc/init.d
|
#vi /etc/init
|
#vi /etc/in
|
#vi /etc/inetd.conf
|
#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 -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 -P INPUT -i --d 7 DROP
iptables v1.2.11: -P requires a chain and a policy Try `iptables -h' or 'iptables --help' for more information. |
#vi /etc/inetd.conf
17c17 < #echo stream tcp nowait root internal --- > echo stream tcp nowait root internal |
#sudo /etc/init.d/inetd restart
Restarting internet superserver: inetd. |
#telnet 127.0.0.1 7
Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. ^] telnet> q Connection closed. |
#iptables -h
iptables v1.2.11 Usage: iptables -[AD] chain rule-specification [options] iptables -[RI] chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LFZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] iptables -h (print this help information) Commands: ... --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 -P tcp INPUT -i --d 7 DROP
Bad argument `7' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -P tcp INPUT -i --dport 7 DROP
Bad argument `7' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -P tcp INPUT -i --dport 7 -j DROP
Bad argument `7' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -P tcp INPUT --dport 7 -j DROP
iptables v1.2.11: Unknown arg `--dport' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A INPUT -p tcp --dport 7 -j DROP
Bad argument `INPUT' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A INPUT -p tcp --dport 7 -j DROP INPUT --dport 7
|
#iptables -A INPUT -p tcp --dport 7 -j DROP
|
#[root@linux1:user]# iptables -A INPUT -p tcp --dport 7 -j DROP
|
#iptables -A INPUT -p tcp --dport 7 -j DROP
|
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP tcp -- anywhere anywhere tcp dpt:echo DROP tcp -- anywhere anywhere tcp dpt:echo Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#[root@linux1:user]# ethereal
bash: ethereal: command not found |
#apt-get install ethereal
Reading Package Lists... Done Building Dependency Tree... Done The following extra packages will be installed: ethereal-common libadns1 Recommended packages: gksu libadns1-bin The following NEW packages will be installed: ethereal ethereal-common libadns1 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 0B/4732kB of archives. ... Selecting previously deselected package libadns1. (Reading database ... 62080 files and directories currently installed.) Unpacking libadns1 (from .../adns/libadns1_1.0-8.2_i386.deb) ... Selecting previously deselected package ethereal-common. Unpacking ethereal-common (from .../ethereal-common_0.10.9-1_i386.deb) ... Selecting previously deselected package ethereal. Unpacking ethereal (from .../ethereal_0.10.9-1_i386.deb) ... Setting up libadns1 (1.0-8.2) ... Setting up ethereal-common (0.10.9-1) ... Setting up ethereal (0.10.9-1) ... |
#ethereal
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes (ethereal:6517): Gtk-WARNING **: cannot open display: |
#tcpdump -n port 7
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 12:38:16.078893 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44938594 0,nop,wscale 6> 12:38:19.077275 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44939344 0,nop,wscale 6> 12:38:25.077182 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44940844 0,nop,wscale 6> 12:38:37.077834 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44943844 0,nop,wscale 6> 12:39:01.079088 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44949844 0,nop,wscale 6> 12:39:49.081638 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44961844 0,nop,wscale 6> 12:51:13.158425 IP 192.168.15.254.41591 > 192.168.15.1.7: S 4198090965:4198090965(0) win 5840 <mss 1460,sackOK,timestamp 45132854 0,nop,wscale 6> 7 packets captured 7 packets received by filter 0 packets dropped by kernel |
#[root@linux1:user]# ethereal
(ethereal:6532): Gtk-WARNING **: cannot open display: |
#apt-get install tethereal
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 12:38:16.078893 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44938594 0,nop,wscale 6> 12:38:19.077275 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44939344 0,nop,wscale 6> 12:38:25.077182 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44940844 0,nop,wscale 6> 12:38:37.077834 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44943844 0,nop,wscale 6> 12:39:01.079088 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44949844 0,nop,wscale 6> 12:39:49.081638 IP 192.168.15.254.59781 > 192.168.15.1.7: S 3384955189:3384955189(0) win 5840 <mss 1460,sackOK,timestamp 44961844 0,nop,wscale 6> Reading Package Lists... Done Building Dependency Tree... Done The following NEW packages will be installed: tethereal 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0B/86,5kB of archives. After unpacking 229kB of additional disk space will be used. Selecting previously deselected package tethereal. (Reading database ... 62190 files and directories currently installed.) Unpacking tethereal (from .../tethereal_0.10.9-1_i386.deb) ... Setting up tethereal (0.10.9-1) ... |
#tethereal
Capturing on eth0 0.000000 Cisco_11:e5:81 -> Cisco_11:e5:81 LOOP Reply 0.153223 192.168.15.2 -> 192.168.15.1 SSH Encrypted request packet len=48 0.156752 192.168.15.1 -> 192.168.15.2 SSH Encrypted response packet len=48 0.156934 192.168.15.2 -> 192.168.15.1 TCP 33044 > ssh [ACK] Seq=48 Ack=48 Win=15200 Len=0 TSV=12593831 TSER=6962454 1.720699 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 2.425448 192.168.15.254 -> 3Com_a0:a9:12 ARP Who has 192.168.15.1? Tell 192.168.15.254 2.425480 linux1.unix.nt -> 192.168.15.254 ARP 192.168.15.1 is at 00:04:76:a0:a9:12 2.425917 192.168.15.1 -> 192.168.15.254 DNS Standard query PTR 254.15.168.192.in-addr.arpa 2.426467 192.168.15.254 -> 192.168.15.1 DNS Standard query response PTR linux.nt ... 4.194757 192.168.15.1 -> 192.168.15.254 TCP 33163 > 18030 [FIN, ACK] Seq=1079 Ack=1 Win=5840 Len=0 TSV=6966492 TSER=44963536 4.204994 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33163 [FIN, ACK] Seq=1 Ack=1080 Win=8000 Len=0 TSV=44963538 TSER=6966492 4.205074 192.168.15.1 -> 192.168.15.254 TCP 33163 > 18030 [ACK] Seq=1080 Ack=2 Win=5840 Len=0 TSV=6966503 TSER=44963538 5.720786 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 7.726594 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 9.724860 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 10.000201 Cisco_11:e5:81 -> Cisco_11:e5:81 LOOP Reply 11.725064 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 13.724948 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 36 packets captured |
#apt-get reinstall kde
E: Invalid operation reinstall |
#apt-get install kde
Reading Package Lists... Done Building Dependency Tree... Done kde is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
#apt-get install gnom
Reading Package Lists... Done Building Dependency Tree... Done E: Couldn't find package gnom |
#[root@linux1:user]# statrx
bash: statrx: command not found |
#startx
xauth: creating new authority file /root/.Xauthority xauth: creating new authority file /root/.Xauthority Using authority file /root/.Xauthority Writing authority file /root/.Xauthority Using authority file /root/.Xauthority Writing authority file /root/.Xauthority X: warning; process set to priority -1 instead of requested priority 0 XFree86 Version 4.3.0.1 (Debian 4.3.0.dfsg.1-10 20041215174925 fabbione@fabbione.net) Release Date: 15 August 2003 X Protocol Version 11, Revision 0, Release 6.6 ... Warning: font renderer for ".snf.Z" already registered at priority 0 Warning: font renderer for ".snf.gz" already registered at priority 0 Warning: font renderer for ".bdf" already registered at priority 0 Warning: font renderer for ".bdf.Z" already registered at priority 0 Warning: font renderer for ".bdf.gz" already registered at priority 0 Warning: font renderer for ".pmf" already registered at priority 0 SetClientVersion: 0 8 ^[[A^[[B waiting for X server to shut down xinit: unexpected signal 2. |
#tethereal
Capturing on eth0 0.000000 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 ^[[A 2.000208 Cisco_11:e5:81 -> Spanning-tree-(for-bridges)_00 STP Conf. Root = 32769/00:12:01:11:e5:80 Cost = 0 Port = 0x8001 2.804595 192.168.15.1 -> 192.168.15.254 TCP 33173 > 18030 [SYN] Seq=0 Ack=0 Win=5840 Len=0 MSS=1460 TSV=7146866 TSER=0 WS=0 2.804869 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33173 [SYN, ACK] Seq=0 Ack=1 Win=5792 Len=0 MSS=1460 TSV=45008620 TSER=7146866 WS=6 2.807561 192.168.15.1 -> 192.168.15.254 TCP 33173 > 18030 [ACK] Seq=1 Ack=1 Win=5840 Len=0 TSV=7146869 TSER=45008620 2.808127 192.168.15.1 -> 192.168.15.254 TCP 33173 > 18030 [ACK] Seq=1 Ack=1 Win=5840 Len=1448 TSV=7146869 TSER=45008620 2.808783 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33173 [ACK] Seq=1 Ack=1449 Win=8704 Len=0 TSV=45008621 TSER=7146869 2.808840 192.168.15.1 -> 192.168.15.254 TCP 33173 > 18030 [ACK] Seq=1449 Ack=1 Win=5840 Len=1448 TSV=7146870 TSER=45008620 2.809435 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33173 [ACK] Seq=1 Ack=2897 Win=11584 Len=0 TSV=45008621 TSER=7146870 ... 3.289411 192.168.15.1 -> 192.168.15.254 TCP 33174 > 18030 [ACK] Seq=1 Ack=1 Win=5840 Len=1448 TSV=7147351 TSER=45008741 3.289975 192.168.15.1 -> 192.168.15.254 TCP 33174 > 18030 [ACK] Seq=1449 Ack=1 Win=5840 Len=1448 TSV=7147351 TSER=45008741 3.290053 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33174 [ACK] Seq=1 Ack=1449 Win=8704 Len=0 TSV=45008741 TSER=7147351 3.290562 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33174 [ACK] Seq=1 Ack=2897 Win=11584 Len=0 TSV=45008741 TSER=7147351 3.291386 192.168.15.1 -> 192.168.15.254 TCP 33174 > 18030 [PSH, ACK] Seq=2897 Ack=1 Win=5840 Len=565 TSV=7147353 TSER=45008741 3.291747 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33174 [ACK] Seq=1 Ack=3462 Win=14528 Len=0 TSV=45008742 TSER=7147353 3.292342 192.168.15.1 -> 192.168.15.254 TCP 33174 > 18030 [FIN, ACK] Seq=3462 Ack=1 Win=5840 Len=0 TSV=7147354 TSER=45008742 3.302299 192.168.15.254 -> 192.168.15.1 TCP 18030 > 33174 [FIN, ACK] Seq=1 Ack=3463 Win=14528 Len=0 TSV=45008744 TSER=7147354 3.302374 192.168.15.1 -> 192.168.15.254 TCP 33174 > 18030 [ACK] Seq=3463 Ack=2 Win=5840 Len=0 TSV=7147364 TSER=45008744 26 packets captured |
#[root@linux1:user]# tethereal eth0
tethereal: Unable to parse capture filter string (syntax error). |
#tethereal -h
This is GNU tethereal 0.10.9 (C) 1998-2004 Gerald Combs <gerald@ethereal.com> Compiled with GLib 2.6.1, with libpcap 0.8.3, with libz 1.2.2, with libpcre 4.5, without UCD-SNMP or Net-SNMP, with ADNS. Running with libpcap version 0.8.3 on Linux 2.6.8-2-686-smp. tethereal [ -vh ] [ -DlLnpqSVx ] [ -a <capture autostop condition> ] ... [ -b <number of ring buffer files>[:<duration>] ] [ -c <count> ] [ -d <layer_type>==<selector>,<decode_as_protocol> ] ... [ -f <capture filter> ] [ -F <output file type> ] [ -i <interface> ] [ -N <resolving> ] [ -o <preference setting> ] ... [ -r <infile> ] ... snoop - Sun snoop netmon1 - Microsoft Network Monitor 1.x netmon2 - Microsoft Network Monitor 2.x ngwsniffer_1_1 - Network Associates Sniffer (Windows-based) 1.1 ngwsniffer_2_0 - Network Associates Sniffer (Windows-based) 2.00x nettl - HP-UX nettl trace visual - Visual Networks traffic capture 5views - Accellent 5Views capture niobserverv9 - Network Instruments Observer version 9 default is libpcap |
#startx
Using authority file /root/.Xauthority Writing authority file /root/.Xauthority Using authority file /root/.Xauthority Writing authority file /root/.Xauthority X: warning; process set to priority -1 instead of requested priority 0 XFree86 Version 4.3.0.1 (Debian 4.3.0.dfsg.1-10 20041215174925 fabbione@fabbione.net) Release Date: 15 August 2003 X Protocol Version 11, Revision 0, Release 6.6 Build Operating System: Linux 2.4.26 i686 [ELF] Build Date: 15 December 2004 ... Warning: font renderer for ".pcf.gz" already registered at priority 0 Warning: font renderer for ".snf" already registered at priority 0 Warning: font renderer for ".snf.Z" already registered at priority 0 Warning: font renderer for ".snf.gz" already registered at priority 0 Warning: font renderer for ".bdf" already registered at priority 0 Warning: font renderer for ".bdf.Z" already registered at priority 0 Warning: font renderer for ".bdf.gz" already registered at priority 0 Warning: font renderer for ".pmf" already registered at priority 0 SetClientVersion: 0 8 waiting for X server to shut down |
#ethereal
|
#iptables -A INPUT -p tcp --dport 7 -j REJECT -reject with tcp restart
iptables v1.2.11: Unknown arg `REJECT' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP tcp -- anywhere anywhere tcp dpt:echo DROP tcp -- anywhere anywhere tcp dpt:echo Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -L --line-number
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP tcp -- anywhere anywhere tcp dpt:echo 2 DROP tcp -- anywhere anywhere tcp dpt:echo Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#iptables -D Nexit
iptables: Bad rule (does a matching rule exist in that chain?) |
#iptables -
Bad argument `-' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP tcp -- anywhere anywhere tcp dpt:echo DROP tcp -- anywhere anywhere tcp dpt:echo Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#[root@linux1:root]# iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP tcp -- anywhere anywhere tcp dpt:echo DROP tcp -- anywhere anywhere tcp dpt:echo Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#ssh 192.168.15.2
ssh: connect to host 192.168.15.2 port 22: No route to host |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP tcp -- anywhere anywhere tcp dpt:echo DROP tcp -- anywhere anywhere tcp dpt:echo Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -?
iptables v1.2.11: Unknown arg `-?' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -h
iptables v1.2.11 Usage: iptables -[AD] chain rule-specification [options] iptables -[RI] chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LFZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] iptables -h (print this help information) Commands: ... --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
|
#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 |
#ssh 192.168.15.2 1000
ssh: connect to host 192.168.15.2 port 22: No route to host |
#ssh 192.168.15.2:1000
|
#[root@linux1:root]# nmap
Nmap 3.75 Usage: nmap [Scan Type(s)] [Options] <host or net list> Some Common Scan Types ('*' options require root privileges) * -sS TCP SYN stealth port scan (default if privileged (root)) -sT TCP connect() port scan (default for unprivileged users) * -sU UDP port scan -sP ping scan (Find any reachable machines) * -sF,-sX,-sN Stealth FIN, Xmas, or Null scan (experts only) -sV Version scan probes open ports determining service & app names/versions -sR RPC scan (use with other scan types) Some Common Options (none are required, most can be combined): ... * -Ddecoy_host1,decoy2[,...] Hide scan using many decoys -6 scans via IPv6 rather than IPv4 -T <Paranoid|Sneaky|Polite|Normal|Aggressive|Insane> General timing policy -n/-R Never do DNS resolution/Always resolve [default: sometimes resolve] -oN/-oX/-oG <logfile> Output normal/XML/grepable scan logs to <logfile> -iL <inputfile> Get targets from file; Use '-' for stdin * -S <your_IP>/-e <devicename> Specify source address or network interface --interactive Go into interactive mode (then press h for help) Example: nmap -v -sS -O www.my.com 192.168.0.0/16 '192.88-90.*.*' SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES |
#nmap -h
Nmap 3.75 Usage: nmap [Scan Type(s)] [Options] <host or net list> Some Common Scan Types ('*' options require root privileges) * -sS TCP SYN stealth port scan (default if privileged (root)) -sT TCP connect() port scan (default for unprivileged users) * -sU UDP port scan -sP ping scan (Find any reachable machines) * -sF,-sX,-sN Stealth FIN, Xmas, or Null scan (experts only) -sV Version scan probes open ports determining service & app names/versions -sR RPC scan (use with other scan types) Some Common Options (none are required, most can be combined): ... * -Ddecoy_host1,decoy2[,...] Hide scan using many decoys -6 scans via IPv6 rather than IPv4 -T <Paranoid|Sneaky|Polite|Normal|Aggressive|Insane> General timing policy -n/-R Never do DNS resolution/Always resolve [default: sometimes resolve] -oN/-oX/-oG <logfile> Output normal/XML/grepable scan logs to <logfile> -iL <inputfile> Get targets from file; Use '-' for stdin * -S <your_IP>/-e <devicename> Specify source address or network interface --interactive Go into interactive mode (then press h for help) Example: nmap -v -sS -O www.my.com 192.168.0.0/16 '192.88-90.*.*' SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES |
#ping 192.168.15.2
PING 192.168.15.2 (192.168.15.2) 56(84) bytes of data. From 192.168.15.1 icmp_seq=1 Destination Host Unreachable From 192.168.15.1 icmp_seq=2 Destination Host Unreachable From 192.168.15.1 icmp_seq=3 Destination Host Unreachable From 192.168.15.1 icmp_seq=4 Destination Host Unreachable From 192.168.15.1 icmp_seq=5 Destination Host Unreachable From 192.168.15.1 icmp_seq=6 Destination Host Unreachable From 192.168.15.1 icmp_seq=7 Destination Host Unreachable From 192.168.15.1 icmp_seq=8 Destination Host Unreachable From 192.168.15.1 icmp_seq=9 Destination Host Unreachable --- 192.168.15.2 ping statistics --- 12 packets transmitted, 0 received, +9 errors, 100% packet loss, time 10998ms , pipe 4 |
#vi /etc/ho
|
#vi /etc/hosts.allow
14,15c14,15 < #sshd : ALL < #ALL : ALL --- > > |
#vi /etc/hosts.deny
20,21c20,21 < #ALL : ALL < #sshd : ALL --- > > |
#ping 192.168.15.2
PING 192.168.15.2 (192.168.15.2) 56(84) bytes of data. From 192.168.15.1 icmp_seq=1 Destination Host Unreachable From 192.168.15.1 icmp_seq=2 Destination Host Unreachable From 192.168.15.1 icmp_seq=3 Destination Host Unreachable --- 192.168.15.2 ping statistics --- 6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4998ms , pipe 3 |
#ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.092 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.087 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.090 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=4 ttl=64 time=0.087 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=5 ttl=64 time=0.089 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=6 ttl=64 time=0.087 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=7 ttl=64 time=0.089 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=8 ttl=64 time=0.087 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=9 ttl=64 time=0.089 ms --- localhost.localdomain ping statistics --- 9 packets transmitted, 9 received, 0% packet loss, time 8004ms rtt min/avg/max/mdev = 0.087/0.088/0.092/0.010 ms |
#ping -p localhost
ping: patterns must be specified as hex digits. |
#ping -f localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data. |
#ping localhost -s 12315
PING localhost.localdomain (127.0.0.1) 12315(12343) bytes of data. 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.134 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.115 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.116 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=4 ttl=64 time=0.118 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=5 ttl=64 time=0.116 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=6 ttl=64 time=0.115 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=7 ttl=64 time=0.117 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=8 ttl=64 time=0.118 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=9 ttl=64 time=0.122 ms 12323 bytes from localhost.localdomain (127.0.0.1): icmp_seq=10 ttl=64 time=0.128 ms --- localhost.localdomain ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9003ms rtt min/avg/max/mdev = 0.115/0.119/0.134/0.015 ms |
#ping -f localhost -s 12315
PING localhost.localdomain (127.0.0.1) 12315(12343) bytes of data. --- localhost.localdomain ping statistics --- 4683 packets transmitted, 4683 received, 0% packet loss, time 4824ms rtt min/avg/max/mdev = 0.102/0.115/0.429/0.023 ms, pipe 2, ipg/ewma 1.030/0.117 ms |
#ping -f 192.168.15.2 -s 12315
PING 192.168.15.2 (192.168.15.2) 12315(12343) bytes of data. ....................................................................................................................................................................................................................................................................................................... --- 192.168.15.2 ping statistics --- 2605 packets transmitted, 2310 received, 11% packet loss, time 11428ms rtt min/avg/max/mdev = 2.554/2.575/2.782/0.032 ms, ipg/ewma 4.388/2.588 ms |
#ssh 192.168.15.2:1000
^[[A^[[B |
#ssh 192.168.15.2
The authenticity of host '192.168.15.2 (192.168.15.2)' can't be established. RSA key fingerprint is 07:18:94:2c:0b:9b:a6:d6:e1:70:03:f4:b8:e5:91:31. Are you sure you want to continue connecting (yes/no)? |
#ssh 192.168.15.2 1000
The authenticity of host '192.168.15.2 (192.168.15.2)' can't be established. RSA key fingerprint is 07:18:94:2c:0b:9b:a6:d6:e1:70:03:f4:b8:e5:91:31. Are you sure you want to continue connecting (yes/no)? |
#ssh 192.168.15.2 1000
The authenticity of host '192.168.15.2 (192.168.15.2)' can't be established. RSA key fingerprint is 07:18:94:2c:0b:9b:a6:d6:e1:70:03:f4:b8:e5:91:31. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.15.2' (RSA) to the list of known hosts. |
Время первой команды журнала | 12:22:22 2006- 6-27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:05:35 2006- 6-27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 32.67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 0.69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 2.43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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