ファームウェア 1.21 に telnetd(2)

LS-CHL

ファームウェア 1.20 以降 telnetd がなくなっている。
debian の telnetd を置いたのだが、
yasunari@sil:~$ telnet chl
Trying 192.168.2.52...
Connected to chl.
Escape character is '^]'.
/usr/sbin/telnetd: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
Connection closed by foreign host.
yasunari@sil:~$
といわれて telnet できない。

libncurses.so.5 の確認

ハックキットで起動、標準ファームの HDD を USB で接続し、 /tmp/root にマウント。

libncurses.so.5 を見る

chl:~# cd /tmp/root/lib
chl:/tmp/root/lib# ls
ld-2.5.so               libnsl.so.1            libpam_misc.so.0
ld-linux.so.3           libnss_compat-2.5.so   libpam_misc.so.0.81.3
libBrokenLocale-2.5.so  libnss_compat.so.2     libpamc.so
libBrokenLocale.so.1    libnss_dns-2.5.so      libpamc.so.0
libSegFault.so          libnss_dns.so.2        libpamc.so.0.81.0
libanl-2.5.so           libnss_files-2.5.so    libpcprofile.so
libanl.so.1             libnss_files.so.2      libpthread-2.5.so
libc-2.5.so             libnss_hesiod-2.5.so   libpthread.so.0
libc.so.6               libnss_hesiod.so.2     libresolv-2.5.so
libcidn-2.5.so          libnss_nis-2.5.so      libresolv.so.2
libcidn.so.1            libnss_nis.so.2        librt-2.5.so
libcrypt-2.5.so         libnss_nisplus-2.5.so  librt.so.1
libcrypt.so.1           libnss_nisplus.so.2    libshadow.so
libdevmapper.so         libnss_winbind.so      libshadow.so.0
libdevmapper.so.1.02    libnss_winbind.so.2    libshadow.so.0.0.0
libdl-2.5.so            libnss_wins.so         libthread_db-1.0.so
libdl.so.2              libnss_wins.so.2       libthread_db.so.1
libm-2.5.so             libpam.so              libutil-2.5.so
libm.so.6               libpam.so.0            libutil.so.1
libmemusage.so          libpam.so.0.81.9       modules
libnsl-2.5.so           libpam_misc.so         security
chl:/tmp/root/lib#
/lib にはない。/usr/lib は?
chl:/tmp/root/lib# cd ../usr/lib
chl:/tmp/root/usr/lib# ls
apt               liblber-2.3.so.0.1.6    libldap_r.so         libz.so
dpkg              liblber.so              libsgutils.so        libz.so.1
e2initrd_helper   libldap-2.3.so.0        libsgutils.so.1      libz.so.1.2.3
gconv             libldap-2.3.so.0.1.6    libsgutils.so.1.0.0  perl5
libgcc_s.so       libldap.so              libstdc++.so         uams
libgcc_s.so.1     libldap_r-2.3.so.0      libstdc++.so.6
liblber-2.3.so.0  libldap_r-2.3.so.0.1.6  libstdc++.so.6.0.9
chl:/tmp/root/usr/lib#
こちらにもない。

debian から

またまた debian のパッケージを使わせていただくことにする。

今度は apt-get でパッケージを入手

chl:/tmp/root/usr/lib# apt-get -d --reinstall install libncurses5
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 328kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org lenny/main libncurses5 5.7+20081213-1 [328kB]
Fetched 328kB in 4s (81.9kB/s)
Download complete and in download only mode
chl:/tmp/root/usr/lib# cd /var/cache/apt/
chl:/var/cache/apt# ls
archives  pkgcache.bin  srcpkgcache.bin
chl:/var/cache/apt# cd archives/
chl:/var/cache/apt/archives# ls
binutils_2.18.1~cvs20080103-7_armel.deb  lock
libncurses5_5.7+20081213-1_armel.deb     partial
chl:/var/cache/apt/archives# 
展開する。
chl:/var/cache/apt/archives# mv libncurses5_5.7+20081213-1_armel.deb /tmp
chl:/var/cache/apt/archives# cd /tmp
chl:/tmp# ls
libncurses5_5.7+20081213-1_armel.deb  root
chl:/tmp# ar xv libncurses5_5.7+20081213-1_armel.deb
x - debian-binary
x - control.tar.gz
x - data.tar.gz
chl:/tmp# tar zxvf control.tar.gz
./
./postinst
./control
./md5sums
./shlibs
./postrm
chl:/tmp#
さて、どう置けばいいのやら
#!/bin/sh
set -e
# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
        ldconfig
fi
# End automatically added section
chl:/tmp# tar zxvf data.tar.gz
./
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/libncurses5/
./usr/share/doc/libncurses5/changelog.Debian.gz
./usr/share/doc/libncurses5/FAQ
./usr/share/doc/libncurses5/README.Debian
./usr/share/doc/libncurses5/changelog.gz
./usr/share/doc/libncurses5/copyright
./usr/share/doc/libncurses5/TODO.Debian
./usr/lib/
./usr/lib/libmenu.so.5.7
./usr/lib/libform.so.5.7
./usr/lib/libpanel.so.5.7
./lib/
./lib/libncurses.so.5.7
./lib/libtic.so.5.7
./usr/lib/libmenu.so.5
./usr/lib/libpanel.so.5
./usr/lib/libform.so.5
./lib/libncurses.so.5
./lib/libtic.so.5
chl:/tmp# ls -l lib
total 260
lrwxrwxrwx 1 root root     17 Sep 22 18:32 libncurses.so.5 -> libncurses.so.5.7
-rw-r--r-- 1 root root 194280 Dec 15  2008 libncurses.so.5.7
lrwxrwxrwx 1 root root     13 Sep 22 18:32 libtic.so.5 -> libtic.so.5.7
-rw-r--r-- 1 root root  69252 Dec 15  2008 libtic.so.5.7
chl:/tmp#
どれが要るのやら。

とりあえず、 /lib/libncurses.so.5 だけを置いて ldconfig してみる

chl:/tmp# mv lib/libncurses.so.5* /tmp/root/lib/
chl:/tmp# chroot /tmp/root
chl:/# ldconfig
chl:/# exit
exit
chl:/tmp#

標準ファームで再起動

標準ファームに telnet

yasunari@sil:~$ telnet chl
Trying 192.168.2.52...
Connected to chl.
Escape character is '^]'.
/usr/sbin/telnetd: error while loading shared libraries: libshishi.so.0: cannot open shared object file: No such file or directory
Connection closed by foreign host.
yasunari@sil:~$
libshishi って何だ???何かのイタズラ?

たのし。

ハックキットで起動

libshishi0 のインストール

chl:~# apt-cache search libshishi
libshishi-dev - Development files for the Shishi Kerberos v5 library
libshishi0 - Library for the Shishi Kerberos v5 implementation
shishi - Command line client for the Shishi Kerberos v5 implementation
chl:~#
あるやん。
ダウンロード。
chl:~# apt-get -d --reinstall install libshishi0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libidn11 shishi-common
Suggested packages:
  shishi
The following NEW packages will be installed:
  libidn11 libshishi0 shishi-common
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 487kB of archives.
After this operation, 1143kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org lenny/main libidn11 1.8+20080606-1 [140kB]
Get:2 http://ftp.jp.debian.org lenny/main shishi-common 0.0.37-1 [126kB]
Get:3 http://ftp.jp.debian.org lenny/main libshishi0 0.0.37-1 [222kB]
Fetched 487kB in 3s (162kB/s)
Download complete and in download only mode
chl:~#
展開する
chl:~# cd /var/cache/apt/archives/
chl:/var/cache/apt/archives# ls
binutils_2.18.1~cvs20080103-7_armel.deb  lock
libidn11_1.8+20080606-1_armel.deb        partial
libshishi0_0.0.37-1_armel.deb            shishi-common_0.0.37-1_all.deb
chl:/var/cache/apt/archives# mv libshishi0_0.0.37-1_armel.deb /tmp
chl:/var/cache/apt/archives# cd /tmp
chl:/tmp# ar xv libshishi0_0.0.37-1_armel.deb
x - debian-binary
x - control.tar.gz
x - data.tar.gz
chl:/tmp# tar zxvf control.tar.gz
./
./shlibs
./postinst
./postrm
./md5sums
./control
chl:/tmp# cat shlibs
libshishi 0 libshishi0 (>= 0.0.37)
chl:/tmp# cat postinst
#!/bin/sh
set -e
# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
        ldconfig
fi
# End automatically added section
chl:/tmp# ls -l usr/lib/libshishi.so.0*
lrwxrwxrwx 1 root root     19 Sep 22 18:51 usr/lib/libshishi.so.0 -> libshishi.so.0.0.37
-rw-r--r-- 1 root root 287336 Jun 27  2008 usr/lib/libshishi.so.0.0.37
chl:/tmp#
コピーする
chl:/tmp# mv usr/lib/libshishi.so.0* /tmp/root/usr/lib
chl:/tmp# chroot /tmp/root
chl:/# ldconfig
chl:/# exit
exit
chl:/tmp#

標準ファームで再起動

標準ファームに telnet

三度目の正直なるか!?
yasunari@sil:~$ telnet chl
Trying 192.168.2.52...
Connected to chl.
Escape character is '^]'.
/usr/sbin/telnetd: error while loading shared libraries: libgnutls.so.26: cannot open shared object file: No such file or directory
Connection closed by foreign host.
yasunari@sil:~$
駄目。

ハックキットで起動

libgnutls.so.26 のインストール

chl:~# apt-cache search libgnutls
libgnutls-dev - the GNU TLS library - development files
libgnutls26 - the GNU TLS library - runtime library
libgnutls26-dbg - GNU TLS library - debugger symbols
python-gnutls - Python wrapper for the GNUTLS library
chl:~# apt-get -d --reinstall install libgnutls26
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 450kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://ftp.jp.debian.org lenny/main libgnutls26 2.4.2-6
  404 Not Found [IP: 202.229.186.27 80]
Failed to fetch http://ftp.jp.debian.org/debian/pool/main/g/gnutls26/libgnutls26_2.4.2-6_armel.deb  404 Not Found [IP: 202.229.186.27 80]
E: Some files failed to download
chl:~#
がー。
これは LS-CHL のハックキットで 最初の設定さえ済ませてないので、ファイルがないのではないかと。

出直し。



LS-CHL
バッファローダイレクト
楽天市場
Amazon


ファームウェア 1.21 に telnetd
ハックの記録
LinkStation/玄箱 をハックしよう

ファームウェア 1.21 に telnetd(3)

Copyright (C) 2003-2009 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市