読者です 読者をやめる 読者になる 読者になる

WZR-HP-AG300Hにログインして現状把握したときのメモ

表題の通り。シリアルコンソール経由で色々なコマンドを叩いてみたときの記録。

下記のように、シリアルコンソールを叩くと既にシェルが起動していた。

BusyBox v1.00 (2010.09.06-00:18+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

# pwd
/

ディレクトリ構成・ファイル構成

ルートディレクトリ以下は下記のような構成で、Linux的にも割と普通。

# ls -la
drwxr-xr-x   14 root     root          167 Sep  6  2010 .
drwxr-xr-x   14 root     root          167 Sep  6  2010 ..
drwxr-xr-x    2 root     root         1932 Sep  6  2010 bin
drwxr-xr-x    4 root     root            0 Jan  1  2000 dev
drwxrwxr-x    5 root     root           97 Sep  6  2010 dlna
drwxr-xr-x    5 root     root          575 Sep  6  2010 etc
drwxr-xr-x    8 root     root          948 Sep  6  2010 lib
drwxr-xr-x   19 root     root          197 Sep  6  2010 mnt
drwxrwxr-x    3 root     root           23 Sep  6  2010 modules
dr-xr-xr-x   67 root     root            0 Jan  1  2000 proc
lrwxrwxrwx    1 root     root            3 Sep  6  2010 sbin -> bin
drwxr-xr-x    9 root     root            0 Jan  1  2000 sys
drwxr-xr-x   13 root     root            0 Dec 31 15:26 tmp
drwxrwxr-x    2 root     root           36 Sep  6  2010 usr
lrwxrwxrwx    1 root     root            3 Sep  6  2010 var -> tmp
drwxr-xr-x    5 root     root           68 Sep  6  2010 www

以下のように/bin以下はファイル数は案外多いが、当然ながら/bin/busyboxへのシンボリックリンクが多い。

もう一つシンボリックリンクが多いのが/bin/rc。これはどうもバッファロー謹製のルーター向けツールのようで、busyboxのように多数のコマンドを1バイナリにマージする形式のようだ。大半の処理がCで書かれていると思われる。

また、下記のバイナリ群の中で異彩を放っているのが/bin/perlだろう。この頃のBuffaloルータの一部処理はPerlで書かれているようで、startup.plとかcron.plなどの文字列が/bin/rc中に見られる。

# ls -la /bin
drwxr-xr-x    2 root     root         1932 Sep  6  2010 .
drwxr-xr-x   14 root     root          167 Sep  6  2010 ..
lrwxrwxrwx    1 root     root            7 Sep  6  2010 [ -> busybox
-rwxr-xr-x    1 root     root       428624 Sep  6  2010 afpd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 alarm_notify -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 aoss -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ap_servd -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 arping -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 auto_detect -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 auto_detect_retry -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 basename -> busybox
lrwxrwxrwx    1 root     root            3 Sep  6  2010 bin -> bin
-rwxr-xr-x    1 root     root        42948 Sep  6  2010 brctl
-rwxr-xr-x    1 root     root        97928 Sep  6  2010 btcli
lrwxrwxrwx    1 root     root           10 Sep  6  2010 btcli-list -> /bin/btcli
lrwxrwxrwx    1 root     root           10 Sep  6  2010 btcli-stat -> /bin/btcli
-rwxr-xr-x    1 root     root        53868 Sep  6  2010 btinfo
-rwxr-xr-x    1 root     root       274100 Sep  6  2010 btpd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 btpdwatch -> /bin/rc
-rwxrwxrwx    1 root     root       560420 Sep  6  2010 busybox
-rwxr-xr-x    1 root     root         3642 Sep  6  2010 c_rehash
lrwxrwxrwx    1 root     root            7 Sep  6  2010 cat -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 chmod -> busybox
-rwxr-xr-x    1 root     root         1050 Sep  6  2010 client.cert
-rwxr-xr-x    1 root     root          887 Sep  6  2010 client.priv
lrwxrwxrwx    1 root     root            7 Sep  6  2010 cp -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 date -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 dd -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ddnsc -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ddnscd -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 df -> busybox
-rwxr-xr-x    1 root     root        86240 Sep  6  2010 dhcpcd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 dirname -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 dmesg -> busybox
-rwxr-xr-x    1 root     root        60308 Sep  6  2010 dnrd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 echo -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 egrep -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 env -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 factoryenv -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 false -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 fdisk -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 fletsroute -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 free -> busybox
-rwxr-xr-x    1 root     root        74332 Sep  6  2010 fsck.vfat
lrwxrwxrwx    1 root     root            7 Sep  6  2010 fwupdate -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 getty -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 grep -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 gunzip -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 gzip -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 host_check -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 host_check_ex -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 host_check_ifilter -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 host_check_syslogcached -> /bin/rc
-rwxr-xr-x    1 root     root       294588 Sep  6  2010 hostapd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 hostname -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 hotplug -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 httpd -> busybox
-rwxr-xr-x    1 root     root         9662 Sep  6  2010 icon.ico
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ifconfig -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ifilter -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 inetd -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 init -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 insmod -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 inspection_cmd -> /bin/rc
-rwxr-xr-x    1 root     root       163076 Sep  6  2010 iptables
-rwxr-xr-x    1 root     root        56700 Sep  6  2010 iwconfig
-rwxr-xr-x    1 root     root        44636 Sep  6  2010 iwevent
-rwxr-xr-x    1 root     root        44444 Sep  6  2010 iwpriv
lrwxrwxrwx    1 root     root            7 Sep  6  2010 kill -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 killall -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 klogd -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 lanctl -> /bin/rc
-rwxr-xr-x    1 root     root       392320 Sep  6  2010 lighttpd
-rwxr-xr-x    1 root     root       114636 Sep  6  2010 lld2d
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ln -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 logger -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 losetup -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ls -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 lsmod -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 makedevs -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 mkdir -> busybox
-rwxr-xr-x    1 root     root        39648 Sep  6  2010 mkfs.vfat
-rwxr-xr-x    1 root     root       670848 Sep  6  2010 mkfs.xfs
lrwxrwxrwx    1 root     root            7 Sep  6  2010 mknod -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 mkswap -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 mlc -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 mount -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 msh -> busybox
-rwxr-xr-x    1 root     root       309688 Sep  6  2010 mt-daapd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 mv -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 netwatchd -> /bin/rc
-rwxr-xr-x    1 root     root      1965984 Sep  6  2010 nmbd
-rwxr-xr-x    1 root     root        27148 Sep  6  2010 ntpclient
-rwxr-xr-x    1 root     root       505356 Sep  6  2010 openssl
-rwxr-xr-x    1 root     root      1476880 Sep  6  2010 perl
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ping -> busybox
-rwxr-xr-x    1 root     root       325672 Sep  6  2010 pppd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 pppdstate -> /bin/rc
-rwxr-xr-x    1 root     root       177860 Sep  6  2010 pppoecd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 pptpctl -> /bin/rc
-rwxr-xr-x    1 root     root        40420 Sep  6  2010 pptpctrl
-rwxr-xr-x    1 root     root        23128 Sep  6  2010 pptpd
-rwxr-xr-x    1 root     root          517 Sep  6  2010 pptpd-init.sh
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ps -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 pwd -> busybox
-rwxr-xr-x    1 root     root        47192 Sep  6  2010 radartool
-rwxr-xr-x    1 root     root      1898700 Sep  6  2010 rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 reboot -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 rm -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 rmdir -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 rmmod -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 route -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 routectl -> /bin/rc
-rwxr-xr-x    1 root     root       216448 Sep  6  2010 sdparm
lrwxrwxrwx    1 root     root            7 Sep  6  2010 sed -> busybox
-rwxr-xr-x    1 root     root         1050 Sep  6  2010 server_buf.cert
lrwxrwxrwx    1 root     root            7 Sep  6  2010 sh -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 sleep -> busybox
-rwxr-xr-x    1 root     root      6064432 Sep  6  2010 smbd
-rwxr-xr-x    1 root     root      3178864 Sep  6  2010 smbpasswd
-rwxr-xr-x    1 root     root        68948 Sep  6  2010 speedy
-rwxr-xr-x    1 root     root      1548308 Sep  6  2010 speedy_backend
lrwxrwxrwx    1 root     root            7 Sep  6  2010 stty -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 swapoff -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 swapon -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 sync -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 sysctl -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 syslogcached -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 syslogd -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 tar -> busybox
-rwxr-xr-x    1 root     root       115020 Sep  6  2010 tc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 telnetd -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 test -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 tftp -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 timerd -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 touch -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 true -> busybox
-rwxr-xr-x    1 root     root        14516 Sep  6  2010 tst_uuid
lrwxrwxrwx    1 root     root            7 Sep  6  2010 tty -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 ubootenv -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 udhcpd -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 umount -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 uname -> busybox
-rwxr-xr-x    1 root     root       267816 Sep  6  2010 upnpd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 uptime -> busybox
-rwxr-xr-x    1 root     root        40192 Sep  6  2010 usb_modeswitch
lrwxrwxrwx    1 root     root            7 Sep  6  2010 usleep -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 vconfig -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 wakeonlan -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 wanctl -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 wanstate_check -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 watchdaemon.sh -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 watchdogd -> /bin/rc
lrwxrwxrwx    1 root     root           19 Sep  6  2010 wd_btcli-list.sh -> /bin/watchdaemon.sh
lrwxrwxrwx    1 root     root           19 Sep  6  2010 wd_btcli-stat.sh -> /bin/watchdaemon.sh
lrwxrwxrwx    1 root     root           19 Sep  6  2010 wd_btpd.sh -> /bin/watchdaemon.sh
lrwxrwxrwx    1 root     root           19 Sep  6  2010 wd_ntpclient.sh -> /bin/watchdaemon.sh
lrwxrwxrwx    1 root     root            7 Sep  6  2010 wf -> /bin/rc
lrwxrwxrwx    1 root     root            7 Sep  6  2010 wget -> busybox
lrwxrwxrwx    1 root     root            7 Sep  6  2010 wiredlanctl -> /bin/rc
-rwxr-xr-x    1 root     root        56168 Sep  6  2010 wlanconfig
-rwxr-xr-x    1 root     root       756164 Sep  6  2010 wsccmd
lrwxrwxrwx    1 root     root            7 Sep  6  2010 wscconfig -> /bin/rc
-rwxr-xr-x    1 root     root      1061880 Sep  6  2010 xfs_repair
lrwxrwxrwx    1 root     root            7 Sep  6  2010 zcat -> busybox

/www以下も見てみる。

/www/cgi-bin/*.cgiの実体がすべて先ほども見た/bin/rcになっている。このバイナリ、なかなか仕事が多い。

# ls -la /www
drwxr-xr-x    5 root     root           68 Sep  6  2010 .
drwxr-xr-x   14 root     root          167 Sep  6  2010 ..
drwxr-xr-x    2 root     root          101 Sep  6  2010 cgi-bin
drwxr-xr-x    5 root     root         7825 Sep  6  2010 html
drwxr-xr-x    2 root     root          745 Sep  6  2010 images
-rw-r--r--    1 root     root          174 Sep  6  2010 index.html
# ls -la /www/cgi-bin
drwxr-xr-x    2 root     root          101 Sep  6  2010 .
drwxr-xr-x    5 root     root           68 Sep  6  2010 ..
lrwxrwxrwx    1 root     root           16 Sep  6  2010 apply.cgi -> /www/cgi-bin/cgi
lrwxrwxrwx    1 root     root            7 Sep  6  2010 cgi -> /bin/rc
-rw-r--r--    1 root     root          588 Sep  6  2010 http_unauth_EUC_JP.txt
lrwxrwxrwx    1 root     root           16 Sep  6  2010 index.cgi -> /www/cgi-bin/cgi
lrwxrwxrwx    1 root     root           16 Sep  6  2010 upfile.cgi -> /www/cgi-bin/cgi
lrwxrwxrwx    1 root     root           16 Sep  6  2010 upload -> /www/cgi-bin/cgi

ところで/lib/perl5/5.8.8なんていうディレクトリを見つけたぞ…。

# cd /lib/perl5/5.8.8
# ls -la
drwxr-xr-x   43 root     root         1837 Sep  6  2010 .
drwxr-xr-x    4 root     root           36 Sep  6  2010 ..
-rwxr-xr-x    1 root     root         2594 Sep  6  2010 AnyDBM_File.pm
drwxr-xr-x    2 root     root           28 Sep  6  2010 Attribute
-rwxr-xr-x    1 root     root        11093 Sep  6  2010 AutoLoader.pm
-rwxr-xr-x    1 root     root        15658 Sep  6  2010 AutoSplit.pm
drwxr-xr-x    2 root     root           82 Sep  6  2010 B
-rwxr-xr-x    1 root     root        27581 Sep  6  2010 Benchmark.pm
drwxr-xr-x    3 root     root          123 Sep  6  2010 CGI
-rwxr-xr-x    1 root     root       242248 Sep  6  2010 CGI.pm
drwxr-xr-x    2 root     root           72 Sep  6  2010 CPAN
-rwxr-xr-x    1 root     root       223755 Sep  6  2010 CPAN.pm
drwxr-xr-x    2 root     root           25 Sep  6  2010 Carp
-rwxr-xr-x    1 root     root         8840 Sep  6  2010 Carp.pm
drwxr-xr-x    2 root     root           37 Sep  6  2010 Class
-rwxr-xr-x    1 root     root        19229 Sep  6  2010 DB.pm
drwxr-xr-x    2 root     root           79 Sep  6  2010 DBM_Filter
-rwxr-xr-x    1 root     root        14415 Sep  6  2010 DBM_Filter.pm
drwxr-xr-x    2 root     root           31 Sep  6  2010 Devel
drwxr-xr-x    2 root     root           36 Sep  6  2010 Digest
-rwxr-xr-x    1 root     root         9207 Sep  6  2010 Digest.pm
-rwxr-xr-x    1 root     root         1758 Sep  6  2010 DirHandle.pm
-rwxr-xr-x    1 root     root        16897 Sep  6  2010 Dumpvalue.pm
drwxr-xr-x    7 root     root          197 Sep  6  2010 Encode
-rwxr-xr-x    1 root     root         4516 Sep  6  2010 English.pm
-rwxr-xr-x    1 root     root         5170 Sep  6  2010 Env.pm
drwxr-xr-x    2 root     root           25 Sep  6  2010 Exporter
-rwxr-xr-x    1 root     root        14419 Sep  6  2010 Exporter.pm
drwxr-xr-x    6 root     root          577 Sep  6  2010 ExtUtils
-rwxr-xr-x    1 root     root         4969 Sep  6  2010 Fatal.pm
drwxr-xr-x    3 root     root          156 Sep  6  2010 File
-rwxr-xr-x    1 root     root         5409 Sep  6  2010 FileCache.pm
-rwxr-xr-x    1 root     root         6771 Sep  6  2010 FileHandle.pm
drwxr-xr-x    2 root     root           26 Sep  6  2010 Filter
-rwxr-xr-x    1 root     root         5410 Sep  6  2010 FindBin.pm
drwxr-xr-x    2 root     root           35 Sep  6  2010 Getopt
drwxr-xr-x    2 root     root           24 Sep  6  2010 Hash
drwxr-xr-x    3 root     root           56 Sep  6  2010 I18N
drwxr-xr-x    3 root     root           23 Sep  6  2010 IO
drwxr-xr-x    2 root     root           38 Sep  6  2010 IPC
drwxr-xr-x    2 root     root           24 Sep  6  2010 List
drwxr-xr-x    3 root     root          219 Sep  6  2010 Locale
drwxr-xr-x    4 root     root          107 Sep  6  2010 Math
drwxr-xr-x    2 root     root          131 Sep  6  2010 Memoize
-rwxr-xr-x    1 root     root        35275 Sep  6  2010 Memoize.pm
-rwxr-xr-x    1 root     root        16122 Sep  6  2010 NEXT.pm
drwxr-xr-x    3 root     root          251 Sep  6  2010 Net
drwxr-xr-x    3 root     root           20 Sep  6  2010 PerlIO
-rwxr-xr-x    1 root     root        10925 Sep  6  2010 PerlIO.pm
drwxr-xr-x    4 root     root          277 Sep  6  2010 Pod
drwxr-xr-x    2 root     root           24 Sep  6  2010 Scalar
drwxr-xr-x    2 root     root           24 Sep  6  2010 Search
-rwxr-xr-x    1 root     root         1070 Sep  6  2010 SelectSaver.pm
-rwxr-xr-x    1 root     root        12634 Sep  6  2010 SelfLoader.pm
-rwxr-xr-x    1 root     root         6917 Sep  6  2010 Shell.pm
-rwxr-xr-x    1 root     root        27976 Sep  6  2010 Switch.pm
-rwxr-xr-x    1 root     root         4794 Sep  6  2010 Symbol.pm
drwxr-xr-x    2 root     root           72 Sep  6  2010 Term
drwxr-xr-x    4 root     root          109 Sep  6  2010 Test
-rwxr-xr-x    1 root     root        28863 Sep  6  2010 Test.pm
drwxr-xr-x    2 root     root           99 Sep  6  2010 Text
drwxr-xr-x    2 root     root           42 Sep  6  2010 Thread
-rwxr-xr-x    1 root     root        10152 Sep  6  2010 Thread.pm
drwxr-xr-x    2 root     root          125 Sep  6  2010 Tie
drwxr-xr-x    2 root     root           66 Sep  6  2010 Time
-rwxr-xr-x    1 root     root         4052 Sep  6  2010 UNIVERSAL.pm
drwxr-xr-x    3 root     root           50 Sep  6  2010 Unicode
drwxr-xr-x    2 root     root           38 Sep  6  2010 User
-rwxr-xr-x    1 root     root          838 Sep  6  2010 abbrev.pl
-rwxr-xr-x    1 root     root         1298 Sep  6  2010 assert.pl
-rwxr-xr-x    1 root     root        12796 Sep  6  2010 attributes.pm
drwxr-xr-x    3 root     root           22 Sep  6  2010 auto
-rwxr-xr-x    1 root     root         4183 Sep  6  2010 autouse.pm
-rwxr-xr-x    1 root     root         5488 Sep  6  2010 base.pm
-rwxr-xr-x    1 root     root         7368 Sep  6  2010 bigfloat.pl
-rwxr-xr-x    1 root     root         8959 Sep  6  2010 bigint.pl
-rwxr-xr-x    1 root     root        10691 Sep  6  2010 bigint.pm
-rwxr-xr-x    1 root     root        14138 Sep  6  2010 bignum.pm
-rwxr-xr-x    1 root     root         4476 Sep  6  2010 bigrat.pl
-rwxr-xr-x    1 root     root         9443 Sep  6  2010 bigrat.pm
-rwxr-xr-x    1 root     root         1675 Sep  6  2010 blib.pm
-rwxr-xr-x    1 root     root         2384 Sep  6  2010 bytes.pm
-rwxr-xr-x    1 root     root          758 Sep  6  2010 bytes_heavy.pl
-rwxr-xr-x    1 root     root         1122 Sep  6  2010 cacheout.pl
-rwxr-xr-x    1 root     root        15513 Sep  6  2010 charnames.pm
-rwxr-xr-x    1 root     root         3191 Sep  6  2010 complete.pl
-rwxr-xr-x    1 root     root        11279 Sep  6  2010 constant.pm
-rwxr-xr-x    1 root     root         1993 Sep  6  2010 ctime.pl
-rwxr-xr-x    1 root     root         1676 Sep  6  2010 dbm_filter_util.pl
-rwxr-xr-x    1 root     root        17294 Sep  6  2010 diagnostics.pm
-rwxr-xr-x    1 root     root         2175 Sep  6  2010 dotsh.pl
-rwxr-xr-x    1 root     root        14809 Sep  6  2010 dumpvar.pl
-rwxr-xr-x    1 root     root         1736 Sep  6  2010 exceptions.pl
-rwxr-xr-x    1 root     root         1019 Sep  6  2010 fastcwd.pl
-rwxr-xr-x    1 root     root         8807 Sep  6  2010 fields.pm
-rwxr-xr-x    1 root     root         2156 Sep  6  2010 filetest.pm
-rwxr-xr-x    1 root     root         1185 Sep  6  2010 find.pl
-rwxr-xr-x    1 root     root         1130 Sep  6  2010 finddepth.pl
-rwxr-xr-x    1 root     root          642 Sep  6  2010 flush.pl
-rwxr-xr-x    1 root     root         1427 Sep  6  2010 getcwd.pl
-rwxr-xr-x    1 root     root         1322 Sep  6  2010 getopt.pl
-rwxr-xr-x    1 root     root         1406 Sep  6  2010 getopts.pl
-rwxr-xr-x    1 root     root          727 Sep  6  2010 hostname.pl
-rwxr-xr-x    1 root     root         1166 Sep  6  2010 if.pm
-rwxr-xr-x    1 root     root          356 Sep  6  2010 importenv.pl
-rwxr-xr-x    1 root     root         3266 Sep  6  2010 integer.pm
-rwxr-xr-x    1 root     root          373 Sep  6  2010 less.pm
-rwxr-xr-x    1 root     root          820 Sep  6  2010 locale.pm
-rwxr-xr-x    1 root     root         1255 Sep  6  2010 look.pl
drwxr-xr-x   21 root     root          577 Sep  6  2010 mips-linux
-rwxr-xr-x    1 root     root         2216 Sep  6  2010 newgetopt.pl
-rwxr-xr-x    1 root     root         7971 Sep  6  2010 open.pm
-rwxr-xr-x    1 root     root          185 Sep  6  2010 open2.pl
-rwxr-xr-x    1 root     root          185 Sep  6  2010 open3.pl
-rwxr-xr-x    1 root     root        46026 Sep  6  2010 overload.pm
-rwxr-xr-x    1 root     root       313786 Sep  6  2010 perl5db.pl
drwxr-xr-x    2 root     root         2567 Sep  6  2010 pod
-rwxr-xr-x    1 root     root         1478 Sep  6  2010 pwd.pl
-rwxr-xr-x    1 root     root          276 Sep  6  2010 shellwords.pl
-rwxr-xr-x    1 root     root         7584 Sep  6  2010 sigtrap.pm
-rwxr-xr-x    1 root     root         6139 Sep  6  2010 sort.pm
-rwxr-xr-x    1 root     root          658 Sep  6  2010 stat.pl
-rwxr-xr-x    1 root     root         3292 Sep  6  2010 strict.pm
-rwxr-xr-x    1 root     root          842 Sep  6  2010 subs.pm
-rwxr-xr-x    1 root     root         4806 Sep  6  2010 syslog.pl
-rwxr-xr-x    1 root     root          164 Sep  6  2010 tainted.pl
-rwxr-xr-x    1 root     root         4114 Sep  6  2010 termcap.pl
-rwxr-xr-x    1 root     root          690 Sep  6  2010 timelocal.pl
drwxr-xr-x    2 root     root          500 Sep  6  2010 unicore
-rwxr-xr-x    1 root     root         7604 Sep  6  2010 utf8.pm
-rwxr-xr-x    1 root     root        10515 Sep  6  2010 utf8_heavy.pl
-rwxr-xr-x    1 root     root         3803 Sep  6  2010 validate.pl
-rwxr-xr-x    1 root     root         2358 Sep  6  2010 vars.pm
-rwxr-xr-x    1 root     root         4328 Sep  6  2010 vmsish.pm
drwxr-xr-x    2 root     root           28 Sep  6  2010 warnings
-rwxr-xr-x    1 root     root        15879 Sep  6  2010 warnings.pm

ストレージ容量カツカツのはずのルーター内にこれほど多数の*.pmファイルがあるとは誰が予想できるだろうか。これはかなり面白いと感じる。

その他情報

unameしてみる。2.6系カーネルMIPS Linuxのようだ。

# uname -a
Linux AP0024A5F1541A 2.6.15 #1 Mon Sep 6 09:15:51 JST 2010 mips unknown

ルートディレクトリ以下は組み込み系Linuxでは定番のSquashFS。リードオンリーなので自分好みのバイナリをインストールするなどのイタズラはできない。ぐぬぬ

# mount
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw,nodiratime)
udev on /dev type tmpfs (rw)
ramfs on /tmp type ramfs (rw)
none on /sys type sysfs (rw)

psの結果。それほど驚きはない。

Webサーバを実現している/bin/httpdの実体は/bin/busyboxlsの結果参照)。それとは別に/bin/lighttpdも存在するのだが、何か使い分けがあるのだろうか?

# ps
  PID  Uid     VmSize Stat Command
    1 root        408 S   init       
    2 root            SWN [ksoftirqd/0]
    3 root            SW< [events/0]
    4 root            SW< [khelper]
    5 root            SW< [kthread]
    9 root            SW< [kblockd/0]
   41 root            SW  [pdflush]
   42 root            SW  [pdflush]
   44 root            SW< [aio/0]
   43 root            SW  [kswapd0]
  636 root            SW  [mtdblockd]
  663 root       1396 S   /bin/rc 
  666 root        404 R   /bin/sh 
  670 root            SW< [khubd]
  681 root        552 S   watchdogd 
  869 root        688 S   /bin/syslogcached 
  872 root        292 S   /bin/syslogd -s 64 -b 2 
  875 root        252 S   /bin/klogd -c 5 -p WZR-HP-AG300H 
  902 root            SW< [xfslogd/0]
  903 root            SW< [xfsdatad/0]
  904 root            SW< [xfsbufd]
  917 root        480 S   timerd usb_oc 1 
  986 root        316 S   /bin/udhcpd /tmp/udhcpd.conf 
  991 root        156 S   /bin/httpd -h /www -c /tmp/etc/httpd.conf -p 80 -r Ai
 1038 root        276 S   iwevent 
 1249 root        432 S   hostapd /tmp/hostapd.conf_ath00 
 1252 root        428 S   hostapd /tmp/hostapd.conf_ath01 
 1256 root        516 S   /bin/ap_servd -i br0 
 1257 root        516 S   /bin/ap_servd -i br0 
 1273 root        380 S   dnrd -n --cache=off 
 1276 root        620 S   netwatchd 
 1315 root        268 S   lld2d br0 ath00 
 1322 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1335 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1336 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1342 root        512 S   wanstate_check 
 1343 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1344 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1345 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1356 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1357 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1358 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1359 root       1660 S   /bin/wsccmd -d -c /tmp/wsc_config.txt 
 1361 root        672 S   upnpd eth1 br0 
 1362 root        672 S   upnpd eth1 br0 
 1363 root        672 S   upnpd eth1 br0 
 1369 root        672 S   upnpd eth1 br0 
 1370 root        672 S   upnpd eth1 br0 
 1381 root        672 S   upnpd eth1 br0 
 1383 root        672 S   upnpd eth1 br0 
 1412 root        728 S   wd_ntpclient.sh ntpclient -s -c 0 -i 86400 -h ntp.jst
 1414 root        312 S   ntpclient -s -c 0 -i 86400 -h ntp.jst.mfeed.ad.jp 
 1574 root        672 S   upnpd eth1 br0 
 1651 root        848 S   auto_detect_retry 30 
 1653 root        348 R   ps 

カーネルモジュールの様子を確認。無難なものが多い印象。

mcsnoopだけ見慣れないような気がする。Buffalo内製のカーネルモジュールだろうか?

ath_*はAtherosのドライバだと思われる。

# lsmod
Module                  Size  Used by    Tainted: P  
ip_nat_pptp 5456 0 - Live 0xc0091000
ip_conntrack_pptp 9040 1 ip_nat_pptp, Live 0xc00c5000
mcsnoop 12496 0 - Live 0xc0035000
nls_utf8 1728 0 - Live 0xc0033000
nls_cp932 81120 0 - Live 0xc00d3000
vfat 12224 0 - Live 0xc002c000
fat 57616 1 vfat, Live 0xc0081000
nls_base 6336 4 nls_utf8,nls_cp932,vfat,fat, Live 0xc0030000
xfs 556192 0 - Live 0xc030a000
usb_storage 34992 0 - Live 0xc0077000
umac 625136 0 - Live 0xc0270000
ath_pktlog 18352 0 - Live 0xc0007000
ath_dev 199232 2 umac,ath_pktlog, Live 0xc0168000
ath_dfs 45280 1 ath_dev, Live 0xc006a000
ath_rate_atheros 39664 2 ath_pktlog,ath_dev, Live 0xc005f000
ath_hal 313104 4 umac,ath_pktlog,ath_dev,ath_dfs, Live 0xc011a000
asf 9872 4 umac,ath_dev,ath_dfs,ath_hal, Live 0xc0013000
adf 15360 3 umac,ath_dev,ath_hal, Live 0xc000e000
ag7100_mod 159984 0 - Live 0xc0094000
ehci_hcd 51024 0 [permanent], Live 0xc0019000
usbcore 144256 3 usb_storage,ehci_hcd, Live 0xc003a000

ifconfigの結果。OpenWrtベースだろうという思い込みがあったが、現行のOpenWrtとはインターフェースの命名ルールが違う印象。

# ifconfig
ath00     Link encap:Ethernet  HWaddr 00:24:A5:F1:54:1A  
          UP BROADCAST RUNNING MULTICAST  MTU:2290  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:481 errors:0 dropped:717 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ath01     Link encap:Ethernet  HWaddr 06:24:A5:F1:54:1A  
          UP BROADCAST RUNNING MULTICAST  MTU:2290  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:447 errors:0 dropped:717 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

br0       Link encap:Ethernet  HWaddr 00:24:A5:F1:54:1A  
          inet addr:192.168.11.1  Bcast:192.168.11.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:717 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:252848 (246.9 KiB)

eth0      Link encap:Ethernet  HWaddr 00:24:A5:F1:54:1A  
          inet addr:169.254.49.98  Bcast:1.1.1.255  Mask:255.255.0.0
          UP BROADCAST NOTRAILERS  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth1      Link encap:Ethernet  HWaddr 00:24:A5:F1:54:1A  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9850 (9.6 KiB)  TX bytes:9850 (9.6 KiB)

wifi0     Link encap:UNSPEC  HWaddr 00-24-A5-F1-54-1A-00-00-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:2685 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:511 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:48 Memory:b0000000-b0010000