/l3/users/eb/2009/linux13/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 :29 :30 :31 :32 :33 :34 :35 :36 :37 :38 :39 :40 :41 :42 :43 :44 :45 :46 :47 :48 :49 :50 :51 :52 :53 :54 :55 :56 :57 :58 :59 :60 :61 :62 :63 :64 :65 :66 :67 :68 :69 :70 :71 :72 :73 :74 :75 :76 |
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:14:33 2009 *filter :INPUT ACCEPT [34919:1997959] :FORWARD ACCEPT [14770:991098] :OUTPUT ACCEPT [47108:2384698] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 15:14:33 2009 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:25:55 2009 *filter :INPUT ACCEPT [34919:1997959] :FORWARD ACCEPT [26487:1788069] :OUTPUT ACCEPT [60127:3027281] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 15:25:55 2009 |
#nmap -T5 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 15:20 EEST All 1715 scanned ports on 192.168.108.2 are filtered Nmap done: 1 IP address (1 host up) scanned in 19.639 seconds |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED REJECT all -- anywhere anywhere reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -S
-P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j REJECT --reject-with icmp-port-unreachable |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED REJECT all -- anywhere anywhere reject-with icmp-port-unreachable REJECT tcp -- anywhere anywhere reject-with tcp-reset Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#nmap -T5 -sF 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 15:20 EEST Warning: Giving up on port early because retransmission cap hit. 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 10.768 seconds |
#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
|
#j REJECT
--reject-with tcp-reset iptables: Invalid argument. Run `dmesg' for more information. |
#iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
|
#vim 1
--- /tmp/l3-saved-3790.17713.32522 2009-06-02 15:29:15.000000000 +0300 +++ 1 2009-06-02 15:30:11.000000000 +0300 @@ -5,7 +5,7 @@ :OUTPUT ACCEPT [60270:3036549] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -j REJECT --reject-with icmp-port-unreachable -A INPUT -p tcp -j REJECT --reject-with tcp-reset +-A INPUT -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 15:29:12 2009 |
#iptables-save < 1
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:30:15 2009 *filter :INPUT ACCEPT [34919:1997959] :FORWARD ACCEPT [30949:2022770] :OUTPUT ACCEPT [60369:3051369] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j REJECT --reject-with icmp-port-unreachable -A INPUT -p tcp -j REJECT --reject-with tcp-reset COMMIT # Completed on Tue Jun 2 15:30:15 2009 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:30:21 2009 *filter :INPUT ACCEPT [34919:1997959] :FORWARD ACCEPT [30959:2023170] :OUTPUT ACCEPT [60370:3051421] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j REJECT --reject-with icmp-port-unreachable -A INPUT -p tcp -j REJECT --reject-with tcp-reset COMMIT # Completed on Tue Jun 2 15:30:21 2009 |
#vim 1
|
#~
bash: 1: command not found |
#iptables-save < 1
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:30:51 2009 *filter :INPUT ACCEPT [34919:1997959] :FORWARD ACCEPT [31020:2025776] :OUTPUT ACCEPT [60410:3065609] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j REJECT --reject-with icmp-port-unreachable -A INPUT -p tcp -j REJECT --reject-with tcp-reset COMMIT # Completed on Tue Jun 2 15:30:51 2009 |
#iptables-restore < 1
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 15:31:09 2009 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [4:160] :OUTPUT ACCEPT [1:1364] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -j REJECT --reject-with tcp-reset -A INPUT -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Tue Jun 2 15:31:09 2009 |
#mdadm --zero-superblock /dev/md1
mdadm: Unrecognised md component device - /dev/md1 |
#nmap T4 -sF 192.168.108.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-02 15:34 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: 1714 closed ports PORT STATE SERVICE 22/tcp open|filtered ssh Nmap done: 1 IP address (1 host up) scanned in 24.875 seconds |
#mdadm --zero-superblock /dev/sdb3
mdadm: Couldn't open /dev/sdb3 for write - not zeroing |
#mdadm --zero-superblock /dev/sdb3
|
#cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md0 : active (auto-read-only) raid1 sda5[0] sdb5[1] 4891648 blocks [2/2] [UU] unused devices: <none> |
#openvt
|
#openvt
|
#openvt
|
#cat /proc/net/ip_conntrack
cat: /proc/net/ip_conntrack: No such file or directory |
#ssh 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 15:37:43 2009 from 192.168.107.2 l3-agent is already running: pid=1765; pidfile=/root/.lilalo/l3-agent.pid |
#finch
âЯÑикeus ак а Ñо...надо бÑаÑÑ ÑелеÑоâââââââââââ âЯÑик nda 519256ââââââââââââââââ ⯠xMorpheus за кÑаÑнÑй диплом еÑй мâââââââââââ - WorЯÑик kâââââиплом еÑй мâââââââââââ â- WorZek âо заÑиÑа 20-23 а ÑелеÑÐ¾Ð½Ñ Ð¾ÑÑалоÑÑ Ð¶Ð¸ÑÑ ââ â IvanÑÑÑка¹ ÐµÐ¼Ñ Ñже...он без заÑÑдки âââââââââââ âЯÑÐMiranda ¹ как малой ÑÑ Ð±Ñал пойдеÑ;âââââ â- Work ¹ ? малой? ââââââââââ â âIgor ка¹ µÐ¹ 687ââââââââââ â ⯠AlEX ÑÐ¾Ñ Ð¡Ð? 0ââââââââââââââââ ... âÐgitalScream аââââââââââââââ âÐgitalScream Ðâи 17682âââââââââââ - Uâ FreeRider âNickname: FreeRiderream а â - University µÐ Ñони еÑжика B â backslash Ñ Ð¿Ð¾Ð½Ñл да? -- ICQ) â backslash â___________________________âââââââââââââââââââ ⯠Balu ⯠Balu Diank@_каÑедÑа Diank@_каÑедÑа |
#ls /proc/sys/net/ipv4
conf tcp_fack icmp_echo_ignore_all tcp_fin_timeout icmp_echo_ignore_broadcasts tcp_frto icmp_errors_use_inbound_ifaddr tcp_frto_response icmp_ignore_bogus_error_responses tcp_keepalive_intvl icmp_ratelimit tcp_keepalive_probes icmp_ratemask tcp_keepalive_time igmp_max_memberships tcp_low_latency igmp_max_msf tcp_max_orphans inet_peer_gc_maxtime tcp_max_ssthresh ... tcp_abort_on_overflow tcp_timestamps tcp_adv_win_scale tcp_tso_win_divisor tcp_allowed_congestion_control tcp_tw_recycle tcp_app_win tcp_tw_reuse tcp_available_congestion_control tcp_window_scaling tcp_base_mss tcp_wmem tcp_congestion_control tcp_workaround_signed_windows tcp_dma_copybreak udp_mem tcp_dsack udp_rmem_min tcp_ecn udp_wmem_min |
#ls /proc/sys/net/ipv4|less
|
#cat /proc/net/ip_conntrack
cat: /proc/net/ip_conntrack: No such file or directory |
#cat /proc/net/
anycast6 ip6_mr_cache netstat rt_acct tcp6 arp ip6_mr_vif packet rt_cache tr_rif dev ip_mr_cache protocols snmp udp dev_mcast ip_mr_vif psched snmp6 udp6 dev_snmp6/ ipv6_route ptype sockstat udplite if_inet6 mcfilter raw sockstat6 udplite6 igmp mcfilter6 raw6 softnet_stat unix igmp6 netfilter/ route stat/ vlan/ ip6_flowlabel netlink rt6_stats tcp wireless |
#cat /proc/net/
anycast6 ip6_mr_cache netstat rt_acct tcp6 arp ip6_mr_vif packet rt_cache tr_rif dev ip_mr_cache protocols snmp udp dev_mcast ip_mr_vif psched snmp6 udp6 dev_snmp6/ ipv6_route ptype sockstat udplite if_inet6 mcfilter raw sockstat6 udplite6 igmp mcfilter6 raw6 softnet_stat unix igmp6 netfilter/ route stat/ vlan/ ip6_flowlabel netlink rt6_stats tcp wireless |
#echo 1 > /proc/sys/net/ipv4/ip_forward
|
#ssh 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 16:01:08 2009 from 192.168.107.2 l3-agent is already running: pid=22520; pidfile=/root/.lilalo/l3-agent.pid |
#cat /proc/net/
anycast6 ip_tables_targets rt_acct arp ipv6_route rt_cache dev mcfilter snmp dev_mcast mcfilter6 snmp6 dev_snmp6/ netfilter/ sockstat if_inet6 netlink sockstat6 igmp netstat softnet_stat igmp6 nf_conntrack stat/ ip6_flowlabel nf_conntrack_expect tcp ip6_mr_cache packet tcp6 ip6_mr_vif protocols tr_rif ip_conntrack psched udp ip_conntrack_expect ptype udp6 ip_mr_cache raw udplite ip_mr_vif raw6 udplite6 ip_tables_matches route unix ip_tables_names rt6_stats wireless |
#cat /proc/net/
anycast6 ip_tables_targets rt_acct arp ipv6_route rt_cache dev mcfilter snmp dev_mcast mcfilter6 snmp6 dev_snmp6/ netfilter/ sockstat if_inet6 netlink sockstat6 igmp netstat softnet_stat igmp6 nf_conntrack stat/ ip6_flowlabel nf_conntrack_expect tcp ip6_mr_cache packet tcp6 ip6_mr_vif protocols tr_rif ip_conntrack psched udp ip_conntrack_expect ptype udp6 ip_mr_cache raw udplite ip_mr_vif raw6 udplite6 ip_tables_matches route unix ip_tables_names rt6_stats wireless |
#apt-get install con
concalc console-cyrillic conch console-data conduit console-keymaps cone consolekit confget console-log configfile-doc console-setup config-package-dev console-setup-mini configure-debian console-terminus confluence console-tools conglomerate console-tools-cyrillic ... conquest context conquest-data context-doc-nonfree conquest-dicom-server contextfree conquest-gl context-nonfree conquest-libs contralign conquest-server controlaula cons convertall conserver-client convirt conserver-server convlit console-common convmv |
#apt-get install con
concalc console-cyrillic conch console-data conduit console-keymaps cone consolekit confget console-log configfile-doc console-setup config-package-dev console-setup-mini configure-debian console-terminus confluence console-tools conglomerate console-tools-cyrillic ... conquest context conquest-data context-doc-nonfree conquest-dicom-server contextfree conquest-gl context-nonfree conquest-libs contralign conquest-server controlaula cons convertall conserver-client convirt conserver-server convlit console-common convmv |
#apt-get install conntrack
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libicu40 portmap Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libnetfilter-conntrack1 libnfnetlink0 The following NEW packages will be installed: conntrack libnetfilter-conntrack1 libnfnetlink0 ... Setting up ed (1.3-3) ... update-alternatives: error: alternative path /bin/ed doesn't exist. dpkg: error processing ed (--configure): subprocess installed post-installation script returned error exit status 2 Setting up libnfnetlink0 (0.0.41-1) ... Setting up libnetfilter-conntrack1 (0.0.99-1) ... Setting up conntrack (1:0.9.12-1) ... Errors were encountered while processing: ed E: Sub-process /usr/bin/dpkg returned an error code (1) |
#cat /proc/net/
anycast6 ip6_mr_cache netstat rt_acct tcp6 arp ip6_mr_vif packet rt_cache tr_rif dev ip_mr_cache protocols snmp udp dev_mcast ip_mr_vif psched snmp6 udp6 dev_snmp6/ ipv6_route ptype sockstat udplite if_inet6 mcfilter raw sockstat6 udplite6 igmp mcfilter6 raw6 softnet_stat unix igmp6 netfilter/ route stat/ vlan/ ip6_flowlabel netlink rt6_stats tcp wireless |
#l3-agent
l3-agent is already running: pid=3739; pidfile=/root/.lilalo/l3-agent.pid |
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
#which iptables
/sbin/iptables |
#iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#cat /proc/net/ip_conn
cat: /proc/net/ip_conn: No such file or directory |
#cat /proc/net/ip_conntrack
tcp 6 431971 ESTABLISHED src=192.168.107.2 dst=192.168.101.1 sport=49606 dport=22 packets=33 bytes=3759 src=192.168.101.1 dst=192.168.107.2 sport=22 dport=49606 packets=29 bytes=4999 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431986 ESTABLISHED src=192.168.15.13 dst=205.188.7.124 sport=45824 dport=5190 packets=38 bytes=1909 src=205.188.7.124 dst=192.168.15.13 sport=5190 dport=45824 packets=38 bytes=6799 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431949 ESTABLISHED src=192.168.107.2 dst=213.254.12.146 sport=57873 dport=5222 packets=40 bytes=7779 src=213.254.12.146 dst=192.168.15.13 sport=5222 dport=57873 packets=45 bytes=19034 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431868 ESTABLISHED src=10.0.35.100 dst=192.168.107.2 sport=22 dport=34847 packets=5 bytes=772 src=192.168.107.2 dst=10.0.35.100 sport=34847 dport=22 packets=5 bytes=260 [ASSURED] mark=0 secmark=0 use=1 tcp 6 29 TIME_WAIT src=192.168.15.13 dst=194.150.93.78 sport=35129 dport=18030 packets=5 bytes=864 src=194.150.93.78 dst=192.168.15.13 sport=18030 dport=35129 packets=4 bytes=228 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431868 ESTABLISHED src=10.0.35.100 dst=192.168.15.13 sport=22 dport=54318 packets=5 bytes=772 src=192.168.15.13 dst=10.0.35.100 sport=54318 dport=22 packets=5 bytes=260 [ASSURED] mark=0 secmark=0 use=1 tcp 6 71 TIME_WAIT src=192.168.15.13 dst=194.150.93.78 sport=39358 dport=18030 packets=5 bytes=1151 src=194.150.93.78 dst=192.168.15.13 sport=18030 dport=39358 packets=4 bytes=228 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431970 ESTABLISHED src=205.188.211.202 dst=192.168.15.13 sport=5190 dport=51717 packets=2 bytes=80 src=192.168.15.13 dst=205.188.211.202 sport=51717 dport=5190 packets=2 bytes=80 [ASSURED] mark=0 secmark=0 use=1 |
#cat /proc/net/ip_conntrack
tcp 6 431990 ESTABLISHED src=192.168.15.13 dst=205.188.7.124 sport=45824 dport=5190 packets=88 bytes=4305 src=205.188.7.124 dst=192.168.15.13 sport=5190 dport=45824 packets=89 bytes=17457 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431959 ESTABLISHED src=192.168.107.2 dst=213.254.12.146 sport=57873 dport=5222 packets=49 bytes=8863 src=213.254.12.146 dst=192.168.15.13 sport=5222 dport=57873 packets=50 bytes=20768 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431885 ESTABLISHED src=192.168.107.2 dst=10.0.35.100 sport=32933 dport=22 packets=37 bytes=3967 src=10.0.35.100 dst=192.168.15.13 sport=22 dport=32933 packets=40 bytes=7507 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431629 ESTABLISHED src=10.0.35.100 dst=192.168.107.2 sport=22 dport=34847 packets=5 bytes=772 src=192.168.107.2 dst=10.0.35.100 sport=34847 dport=22 packets=5 bytes=260 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431629 ESTABLISHED src=10.0.35.100 dst=192.168.15.13 sport=22 dport=54318 packets=5 bytes=772 src=192.168.15.13 dst=10.0.35.100 sport=54318 dport=22 packets=5 bytes=260 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431731 ESTABLISHED src=205.188.211.202 dst=192.168.15.13 sport=5190 dport=51717 packets=2 bytes=80 src=192.168.15.13 dst=205.188.211.202 sport=51717 dport=5190 packets=2 bytes=80 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431937 ESTABLISHED src=192.168.107.2 dst=10.0.35.100 sport=32934 dport=22 packets=81 bytes=7263 src=10.0.35.100 dst=192.168.15.13 sport=22 dport=32934 packets=62 bytes=10043 [ASSURED] mark=0 secmark=0 use=1 |
#w
16:33:20 up 41 min, 2 users, load average: 0.01, 0.02, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 - 15:51 1:37 0.07s 0.02s script -f -c bash -q /root/.lilalo//12788174852070824314-1243947105.script root pts/5 linux15.unix.nt 16:33 0.00s 0.00s 0.00s script -f -c bash -q /root/.lilalo//1630914865731711484-1243949598.script |
#cat /proc/net/ip_conn
apt-get install apache Reading package lists... Done Building dependency tree Reading state information... Done Package apache is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package apache has no installation candidate |
#apt-get install apache2
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libicu40 portmap Use 'apt-get autoremove' to remove them. The following extra packages will be installed: apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-mysql libaprutil1-ldap libmysqlclient15off mysql-common openssl-blacklist ssl-cert ... Use `dselect' or `aptitude' for user-friendly package management; Type dpkg -Dhelp for a list of dpkg debug flag values; Type dpkg --force-help for a list of forcing options; Type dpkg-deb --help for help about manipulating *.deb files; Type dpkg --license for copyright license and lack of warranty (GNU GPL) [*]. Options marked [*] produce a lot of output - pipe it through `less' or `more' ! Setting up ssl-cert (1.0.23) ... Errors were encountered while processing: ed E: Sub-process /usr/bin/dpkg returned an error code (1) |
#apt-cache search ed
bcfg2 - Configuration management client bchunk - CD image format conversion from bin/cue to iso/cdr bcpp - C(++) beautifier bcrelay - Broadcast relay daemon bcron - Bruce's cron system (programs) bcron-run - Bruce's cron system bcrypt - Cross platform file encryption utility using blowfish bdf2psf - font converter to generate console fonts from BDF source fonts bdfresize - tool for resizing BDF format font beagle-dev - library for accessing beagle (C# development files) ... bluez-cups - Bluetooth printer driver for CUPS bluez-gstreamer - Bluetooth GStreamer support bluez-pcmcia-support - PCMCIA support files for BlueZ 2.0 Bluetooth tools bmagic - C++ template library for efficient platform independent bitsets bmconf - The installer and configurator of the Smart Boot Manager bmon - portable bandwidth monitor and rate estimator bmv - PostScript viewer for SVGAlib bnetd - Gaming server that emulates Battle.net(R) bnfc - Compiler front-end generator based on Labelled BNF boa - Lightweight and high performance web server |
#apt-cache search ed | grep -x ..
|
#man grep
|
#man NAT
|
#man iptables
|
#-save
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 17:12:35 2009 *nat :PREROUTING ACCEPT [159:12687] :POSTROUTING ACCEPT [49:2959] :OUTPUT ACCEPT [48:2781] -A PREROUTING -d 192.168.107.2/32 -i eth0 -p tcp -m tcp --sport 80 --dport 80 -j REDIRECT -A POSTROUTING -s 192.168.107.0/24 -o eth0 -j MASQUERADE COMMIT # Completed on Tue Jun 2 17:12:35 2009 |
#iptables-save > 1
|
#vi 1
--- /tmp/l3-saved-5726.31816.15143 2009-06-02 17:13:45.000000000 +0300 +++ 1 2009-06-02 17:15:01.000000000 +0300 @@ -10,7 +10,7 @@ :PREROUTING ACCEPT [162:13230] :POSTROUTING ACCEPT [54:3255] :OUTPUT ACCEPT [53:3077] --A PREROUTING -d 192.168.107.2/32 -i eth0 -p tcp -m tcp --sport 80 --dport 80 -j REDIRECT +-A PREROUTING -d 192.168.107.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-destination 192.168.107.2:80 -A POSTROUTING -s 192.168.107.0/24 -o eth0 -j MASQUERADE COMMIT # Completed on Tue Jun 2 17:13:40 2009 |
#iptables-restore<1
iptables-restore v1.4.3.2: unknown option `--to-destination' Error occurred at line: 13 Try `iptables-restore -h' or 'iptables-restore --help' for more information. |
#vi 1
--- /tmp/l3-saved-5726.2804.20972 2009-06-02 17:15:17.000000000 +0300 +++ 1 2009-06-02 17:15:33.000000000 +0300 @@ -10,7 +10,7 @@ :PREROUTING ACCEPT [162:13230] :POSTROUTING ACCEPT [54:3255] :OUTPUT ACCEPT [53:3077] --A PREROUTING -d 192.168.107.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-destination 192.168.107.2:80 +-A PREROUTING -d 192.168.107.1/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.107.2:80 -A POSTROUTING -s 192.168.107.0/24 -o eth0 -j MASQUERADE COMMIT # Completed on Tue Jun 2 17:13:40 2009 |
#iptables-restore<1
|
#vi 1
|
#apt-get remove ysm
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libicu40 portmap Use 'apt-get autoremove' to remove them. The following packages will be REMOVED: ysm 0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded. 1 not fully installed or removed. ... (Reading database ... 56964 files and directories currently installed.) Removing ysm ... Processing triggers for man-db ... Setting up ed (1.3-3) ... update-alternatives: error: alternative path /bin/ed doesn't exist. dpkg: error processing ed (--configure): subprocess installed post-installation script returned error exit status 2 Errors were encountered while processing: ed E: Sub-process /usr/bin/dpkg returned an error code (1) |
#~ +q436f+q6b75+q6b64+q6b72+q6b6c+q2332+q2334+q2569+q2a37+q6b31
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 17:13:40 2009 *filter :INPUT ACCEPT [73:7809] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [51:6739] COMMIT # Completed on Tue Jun 2 17:13:40 2009 # Generated by iptables-save v1.4.3.2 on Tue Jun 2 17:13:40 2009 *nat :PREROUTING ACCEPT [162:13230] :POSTROUTING ACCEPT [54:3255] :OUTPUT ACCEPT [53:3077] -A PREROUTING -d 192.168.107.1/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.107.2:80 -A POSTROUTING -s 192.168.107.0/24 -o eth0 -j MASQUERADE COMMIT # Completed on Tue Jun 2 17:13:40 2009 |
#ssh 192.168.108.1
ssh_exchange_identification: Connection closed by remote host |
#cat 1
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 17:13:40 2009 *filter :INPUT ACCEPT [73:7809] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [51:6739] COMMIT # Completed on Tue Jun 2 17:13:40 2009 # Generated by iptables-save v1.4.3.2 on Tue Jun 2 17:13:40 2009 *nat :PREROUTING ACCEPT [162:13230] :POSTROUTING ACCEPT [54:3255] :OUTPUT ACCEPT [53:3077] -A PREROUTING -d 192.168.107.1/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.107.2:80 -A POSTROUTING -s 192.168.107.0/24 -o eth0 -j MASQUERADE COMMIT # Completed on Tue Jun 2 17:13:40 2009 |
#apt-get autoremove
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libicu40 portmap The following packages will be REMOVED: libicu40 portmap 0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded. 1 not fully installed or removed. After this operation, 17.4MB disk space will be freed. ... Removing portmap ... Stopping portmap daemon.... Processing triggers for man-db ... Setting up ed (1.3-3) ... update-alternatives: error: alternative path /bin/ed doesn't exist. dpkg: error processing ed (--configure): subprocess installed post-installation script returned error exit status 2 Errors were encountered while processing: ed E: Sub-process /usr/bin/dpkg returned an error code (1) |
#dpkg -l
ii python-numpy 1:1.2.1-1 Numerical Python adds a fast array facility ii python-openssl 0.8-1 Python wrapper around the OpenSSL library ii python-support 1.0.3 automated rebuilding support for Python modu ii python2.5 2.5.4-1 An interactive high-level object-oriented la ii python2.5-mini 2.5.4-1 A minimal subset of the Python language (ver ii radeontool 1.5-5 utility to control ATI Radeon backlight func ii rar 1:3.8.0-2 Archiver for .rar files ii rarian-compat 0.8.1-2 Rarian is a documentation meta-data library ii readline-commo 5.2-4 GNU readline and history libraries, common f ii rsync 3.0.5-1 fast remote file copy program (like rcp) ... ii xserver-xorg-v 1:2.2.0-1 X.Org X server -- VESA display driver ii xserver-xorg-v 1:10.16.6-1 X.Org X server -- VMware display driver ii xserver-xorg-v 1:1.2.1-1 X.Org X server -- Voodoo display driver ii xterm 243-1 X terminal emulator ii xtightvncviewe 1.3.9-4 virtual network computing client software fo ii xulrunner-1.9 1.9.0.10-1 XUL + XPCOM application runner ii xzgv 0.9+svn40-1 Picture viewer for X with a thumbnail-based ii zenity 2.24.1-1 Display graphical dialog boxes from shell sc ii zim 0.28-1 graphical text editor based on wiki technolo ii zlib1g 1:1.2.3.3.dfsg compression library - runtime |
#scp 1 root@192.168.107.2/root/
cp: cannot create regular file `root@192.168.107.2/root/': No such file or directory |
#vim /etc/sysctl.conf
--- /tmp/l3-saved-3771.29143.9003 2009-06-02 17:25:30.000000000 +0300 +++ /etc/sysctl.conf 2009-06-02 17:26:30.000000000 +0300 @@ -25,8 +25,7 @@ #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 -#net.ipv4.ip_forward=1 -net.ipv4.forward=1 +net.ipv4.ip_forward=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.all.forwarding=1 |
#ssh quiz@10.0.35.100
---------------------------------------------------------------------- ТЕМЫ ТРЕТЬЕГО ДНЯ cron, syslog, отладка процессов Общее количество вопросов: 40 Вам будут заданы вопросы и показаны варианты ответа на них. После каждого вопроса вы должны вводить номер варианта ответа, который вы считаете наиболее правильным. После ввода номера нужно нажимать <ENTER>. Возвращаться назад и менять ответ, после того как вы нажали <ENTER>, нельзя. Прерывать сеанс нельзя (прерывать можно, но продолжить не получится). Программно время не ограничивается, но скорость ответа фиксируется. Поэтому долго раздумывать не стоит, но и спешить не надо тоже! Вопросы и ответы читайте внимательно. Вопросов "на внимательность" хотя и мало, но они есть. НАЧИНАЕМ! (ENTER) --------------------------------------------------------------------------- Connection to 10.0.35.100 closed. |
#ssh 192.168.108.1
The authenticity of host '192.168.108.1 (192.168.108.1)' 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.108.1' (RSA) to the list of known hosts. root@192.168.108.1's password: Linux linux16 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: Mon Jun 1 17:30:23 2009 l3-agent is already running: pid=14578; pidfile=/root/.lilalo/l3-agent.pid |
#man suslog
|
#man syslog
|
#man syslog-ng
|
#man at
|
#man anacron
|
#vim /etc/network/interfaces
--- /tmp/l3-saved-3771.25235.22500 2009-06-02 17:42:06.000000000 +0300 +++ /etc/network/interfaces 2009-06-02 17:42:27.000000000 +0300 @@ -2,8 +2,6 @@ # /usr/share/doc/ifupdown/examples for more information. auto lo eth0 -auto lo.107 eth0.107 - iface lo inet loopback iface eth0 inet static @@ -13,11 +11,3 @@ broadcast 192.168.15.255 gateway 192.168.15.254 -iface lo.107 inet loopback -iface eth0.107 inet static - address 192.168.107.1 - netmask 255.255.255.0 - network 192.168.107.0 - broadcast 192.168.107.255 - #gateway 192.168.15.254 - |
#ifdown eth0
|
#ifup eth0
|
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data. 64 bytes from 10.0.35.100: icmp_seq=1 ttl=62 time=0.240 ms 64 bytes from 10.0.35.100: icmp_seq=2 ttl=62 time=0.223 ms ^C --- 10.0.35.100 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.223/0.231/0.240/0.017 ms |
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data. 64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=0.588 ms 64 bytes from 192.168.15.254: icmp_seq=2 ttl=64 time=0.588 ms ^C --- 192.168.15.254 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.588/0.588/0.588/0.000 ms |
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md0 : active (auto-read-only) raid1 sda5[0] sdb5[1] 4891648 blocks [2/2] [UU] unused devices: <none>
anycast6 ip_tables_targets rt_acct arp ipv6_route rt_cache dev mcfilter snmp dev_mcast mcfilter6 snmp6 dev_snmp6/ netfilter/ sockstat if_inet6 netlink sockstat6 igmp netstat softnet_stat igmp6 nf_conntrack stat/ ip6_flowlabel nf_conntrack_expect tcp ip6_mr_cache packet tcp6 ip6_mr_vif protocols tr_rif ip_conntrack psched udp ip_conntrack_expect ptype udp6 ip_mr_cache raw udplite ip_mr_vif raw6 udplite6 ip_tables_matches route unix ip_tables_names rt6_stats wireless
tcp 6 431990 ESTABLISHED src=192.168.15.13 dst=205.188.7.124 sport=45824 dport=5190 packets=88 bytes=4305 src=205.188.7.124 dst=192.168.15.13 sport=5190 dport=45824 packets=89 bytes=17457 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431959 ESTABLISHED src=192.168.107.2 dst=213.254.12.146 sport=57873 dport=5222 packets=49 bytes=8863 src=213.254.12.146 dst=192.168.15.13 sport=5222 dport=57873 packets=50 bytes=20768 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431885 ESTABLISHED src=192.168.107.2 dst=10.0.35.100 sport=32933 dport=22 packets=37 bytes=3967 src=10.0.35.100 dst=192.168.15.13 sport=22 dport=32933 packets=40 bytes=7507 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431629 ESTABLISHED src=10.0.35.100 dst=192.168.107.2 sport=22 dport=34847 packets=5 bytes=772 src=192.168.107.2 dst=10.0.35.100 sport=34847 dport=22 packets=5 bytes=260 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431629 ESTABLISHED src=10.0.35.100 dst=192.168.15.13 sport=22 dport=54318 packets=5 bytes=772 src=192.168.15.13 dst=10.0.35.100 sport=54318 dport=22 packets=5 bytes=260 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431731 ESTABLISHED src=205.188.211.202 dst=192.168.15.13 sport=5190 dport=51717 packets=2 bytes=80 src=192.168.15.13 dst=205.188.211.202 sport=51717 dport=5190 packets=2 bytes=80 [ASSURED] mark=0 secmark=0 use=1 tcp 6 431937 ESTABLISHED src=192.168.107.2 dst=10.0.35.100 sport=32934 dport=22 packets=81 bytes=7263 src=10.0.35.100 dst=192.168.15.13 sport=22 dport=32934 packets=62 bytes=10043 [ASSURED] mark=0 secmark=0 use=1
# Generated by iptables-save v1.4.3.2 on Tue Jun 2 17:13:40 2009 *filter :INPUT ACCEPT [73:7809] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [51:6739] COMMIT # Completed on Tue Jun 2 17:13:40 2009 # Generated by iptables-save v1.4.3.2 on Tue Jun 2 17:13:40 2009 *nat :PREROUTING ACCEPT [162:13230] :POSTROUTING ACCEPT [54:3255] :OUTPUT ACCEPT [53:3077] -A PREROUTING -d 192.168.107.1/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.107.2:80 -A POSTROUTING -s 192.168.107.0/24 -o eth0 -j MASQUERADE COMMIT # Completed on Tue Jun 2 17:13:40 2009
Время первой команды журнала | 15:08:02 2009- 6- 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 17:44:01 2009- 6- 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 23.76 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.60 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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