例) $ nslookup www.yahoo.co.jp Server: 10.20.141.6 Address: 10.20.141.6#53 Non-authoritative answer: www.yahoo.co.jp canonical name = www.g.yahoo.co.jp. Name: www.g.yahoo.co.jp Address: 124.83.179.227
$ nslookup www.自分で定義したドメイン 例) $ nslookup www.yakoshi.la.net Server: 10.20.141.6 Address: 10.20.141.6#53 www.yakoshi.la.net canonical name = h006.yakoshi.la.net. Name: h006.yakoshi.la.net Address: 10.20.141.6
$ dig 自分で定義したドメイン MX 例) $ dig yakoshi.la.net MX ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.1 <<>> yakoshi.la.net MX ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20210 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2 ;; QUESTION SECTION: ;yakoshi.la.net. IN MX ;; ANSWER SECTION: yakoshi.la.net. 86400 IN MX 10 smtp.yakoshi.la.net. ;; AUTHORITY SECTION: yakoshi.la.net. 86400 IN NS ns.yakoshi.la.net. ;; ADDITIONAL SECTION: smtp.yakoshi.la.net. 86400 IN A 10.20.141.6 ns.yakoshi.la.net. 86400 IN A 10.20.141.6 ;; Query time: 0 msec ;; SERVER: 10.20.141.6#53(10.20.141.6) ;; WHEN: Sun Jun 24 15:11:43 2012 ;; MSG SIZE rcvd: 102
http://www.yakoshi.la.net/
http://www.yakoshi.la.net/staff/ ( ユーザ名とパスワードが問われる)
http://www.yakoshi.la.net/cgi-bin/test.cgi
#! /bin/bash cat <<EOD </pre> Content-type: text/html <html> <head><title>Sample CGI</title></head> <body> <h2>Sample CGI</h2> Now : `date` <pre> `env` </pre> </body> </html> EOD |
http://www.yakoshi.la.net/~student ユーザ名は任意
$ ssh localhost The authenticity of host 'localhost (127.0.0.1)' can't be established. RSA key fingerprint is 94:34:07:47:02:d5:84:f0:2c:79:ca:3b:ff:6c:96:17. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'localhost' (RSA) to the list of known hosts. Enter passphrase for key '/home/student/.ssh/id_dsa': Last login: Sun Jun 24 13:11:50 2012 from 10.20.141.12
$ telnet smtp.yakoshi.la.net 25 Trying 10.20.141.6... Connected to smtp.yakoshi.la.net (10.20.141.6). Escape character is '^]'. 220 yakoshi.la.net ESMTP ehlo test 250-smtp.t14106.la.net 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:student 250 2.1.0 Ok rcpt to:ycos001@yahoo.co.jp 250 2.1.5 Ok data 354 End data with. mail from LA . 250 2.0.0 Ok: queued as 4C558220054 quit 221 2.0.0 Bye Connection closed by foreign host.
$ telnet smtp.yakoshi.la.net 25 Trying 10.20.141.6... Connected to smtp.yakoshi.la.net (10.20.141.6). Escape character is '^]'. 220 yakoshi.la.net ESMTP ehlo test 250-smtp.t14106.la.net 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:root 250 2.1.0 Ok rcpt to:student@yakoshi.la.net 250 2.1.5 Ok data 354 End data with. Domain mail . 250 2.0.0 Ok: queued as CFE9C220054 quit 221 2.0.0 Bye Connection closed by foreign host. $ cat /var/spool/mail/student From root@yakoshi.la.net Sun Jun 24 15:30:33 2012 Return-Path: X-Original-To: student@yakoshi.la.net Delivered-To: student@yakoshi.la.net Received: from test (h006.s141.la.net [10.20.141.6]) by smtp.t14106.la.net (Postfix) with ESMTP id CFE9C220054 for ; Sun, 24 Jun 2012 15:30:14 +0900 (JST) Message-Id: <20120624063028.CFE9C220054@smtp.t14106.la.net> Date: Sun, 24 Jun 2012 15:30:14 +0900 (JST) From: root@yakoshi.la.net To: undisclosed-recipients:; Domain mail (上記で入力した文面)
$ telnet 127.0.0.1 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 yakoshi.la.net ESMTP ehlo test 250-smtp.t14106.la.net 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:root 250 2.1.0 Ok rcpt to:ycos001@yahoo.co.jp 554 5.7.1 <ycos001@yahoo.co.jp> Relay access denied quit 221 2.0.0 Bye Connection closed by foreign host.
$ date | mail -s "Error test" error@uso800.net $ tail /var/mail/student To: error@uso800.net Subject: Error test Message-Id: <20120624063649.B2209220056@smtp.t14106.la.net> Date: Sun, 24 Jun 2012 15:36:49 +0900 (JST) From: student@yakoshi.la.net 2012年 6月 24日 日曜日 15:36:49 JST --B2209220056.1340519811/smtp.t14106.la.net--
$ telnet localhost 110 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. +OK Dovecot ready. user student +OK pass himitu +OK Logged in. quit +OK Logging out. Connection closed by foreign host.
$ netstat -antp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN - tcp 0 0 10.20.141.6:53 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN - tcp 0 0 10.20.141.6:33757 74.125.235.69:80 ESTABLISHED 3153/firefox tcp 0 0 127.0.0.1:22 127.0.0.1:44452 ESTABLISHED - tcp 0 0 10.20.141.6:45320 74.125.235.67:80 ESTABLISHED 3153/firefox tcp 0 0 127.0.0.1:44452 127.0.0.1:22 ESTABLISHED 10423/ssh tcp 0 0 :::110 :::* LISTEN - tcp 0 0 :::6000 :::* LISTEN - tcp 0 0 :::80 :::* LISTEN - tcp 0 0 :::22 :::* LISTEN - 110 が LISTEN で、143, 993, 995 はない
http://10.20.141.6:8080/ (アクセス不可) # /etc/init.d/iptables stop ファイアウォールルールを適用中: [ OK ] チェインポリシーを ACCEPT に設定中filter [ OK ] iptables モジュールを取り外し中 [ OK ] 一旦停止するとアクセスできる
# tail /var/log/messages Jun 24 16:01:10 h006 kernel: IN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=10.20.141.6 DST=10.20.141.6 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=56362 DF PROTO=TCP SPT=53788 DPT=8080 WINDOW=32792 RES=0x00 SYN URGP=0
# /etc/init.d/iptables start ファイアウォールルールを適用中: [ OK ] チェインポリシーを ACCEPT に設定中filter [ OK ] iptables モジュールを取り外し中 [ OK ] iptables ファイアウォールルールを適用中: [ OK ] iptables モジュールを読み込み中ip_conntrack_netbios_ns [ OK ] [root@h006 ~]# iptables -L Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere localhost.localdomain ACCEPT icmp -- anywhere h006.s141.la.net ACCEPT tcp -- anywhere h006.s141.la.net tcp dpt:ssh ACCEPT tcp -- anywhere h006.s141.la.net tcp dpt:smtp : 省略
# yum list httpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.yz.yamagata-u.ac.jp * extras: ftp.yz.yamagata-u.ac.jp * updates: ftp.yz.yamagata-u.ac.jp Installed Packages httpd.i386 2.2.3-65.el5.centos installed