自宅サーバ(Debian/etch)をnmap(Windows XP)でポートスキャン

自宅サーバ(Debian/etch)のセキュリティ検査をするのに、Windows XPマシンからポートスキャンしてみた。

1. http://insecure.org/からnmap-4.85BETA7-setup.exeをダウンロード
2. nmap-4.85BETA7-setup.exeを実行してインストール
3. 以下を実行
C:\Program Files\Nmap>nmap -P0 -n -sS -T4 -p1-65535 192.168.1.132

Starting Nmap 4.85BETA7 ( http://nmap.org ) at 2009-04-19 11:43 東京 (標準時)
Interesting ports on 192.168.1.132:
Not shown: 65528 closed ports
PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
80/tcp  open  http
111/tcp open  rpcbind
113/tcp open  auth
443/tcp open  https
901/tcp open  samba-swat
MAC Address: xx:xx:xx:xx:xx:xx (Matsushita Electric IND. CO)

Nmap done: 1 IP address (1 host up) scanned in 81.48 seconds

C:\Program Files\Nmap>
4. rpcbind、auth、samba-swatは自宅サーバには必要ないので止めてみる。あと、ftpはscp(sftp)で代替するのでこれも止める。
<rpcbindを止める>
# /etc/init.d/portmap stop
Stopping portmap daemon....
# update-rc.d -f portmap remove
Removing any system startup links for /etc/init.d/portmap ...
   /etc/rc0.d/S32portmap
   /etc/rc1.d/K81portmap
   /etc/rc2.d/S18portmap
   /etc/rc3.d/S18portmap
   /etc/rc4.d/S18portmap
   /etc/rc5.d/S18portmap
   /etc/rc6.d/S32portmap
   /etc/rcS.d/S43portmap
#

<authを止める>
# vi /etc/inetd.conf
...
ident          stream  tcp     wait    identd  /usr/sbin/identd        identd
↓identとある行をコメントアウト
#ident          stream  tcp     wait    identd  /usr/sbin/identd        identd
...
# pkill -HUP inetd

<samba-swatを止める>
# vi /etc/inetd.conf
...
swat           stream  tcp     nowait.400      root    /usr/sbin/tcpd  /usr/sbin/swat
↓swatとある行をコメントアウト
#swat           stream  tcp     nowait.400      root    /usr/sbin/tcpd  /usr/sbin/swat
...
# pkill -HUP inetd

<ftpを止める>
# /etc/init.d/vsftpd stop
Stopping FTP server: vsftpd.
# update-rc.d -f vsftpd remove
Removing any system startup links for /etc/init.d/vsftpd ...
   /etc/rc0.d/K20vsftpd
   /etc/rc1.d/K20vsftpd
   /etc/rc2.d/S20vsftpd
   /etc/rc3.d/S20vsftpd
   /etc/rc4.d/S20vsftpd
   /etc/rc5.d/S20vsftpd
   /etc/rc6.d/K20vsftpd
5. 再度nmapを実行し、効果を確認
C:\Program Files\Nmap>nmap -P0 -n -sS -T4 -p1-65535 192.168.1.132

Starting Nmap 4.85BETA7 ( http://nmap.org ) at 2009-04-19 19:34 東京 (標準時)
Interesting ports on 192.168.1.132:
Not shown: 65532 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
443/tcp open  https
MAC Address: xx:xx:xx:xx:xx:xx (Matsushita Electric IND. CO)

Nmap done: 1 IP address (1 host up) scanned in 52.02 seconds

C:\Program Files\Nmap>

コメント