誰にでもできる方法、、、debian の telnetd を使わせていただく。
chl:/tmp/root/bin# cd chl:~# apt-cache search telnetd francine - feature rich ansi console login engine heimdal-servers - Heimdal Kerberos - server programs inetutils-telnetd - telnet server krb5-telnetd - Secure telnet server supporting MIT Kerberos pawserv - CERNLIB data analysis suite - distributed PAW and file transfer servers telnet-ssl - The telnet client with SSL encryption support telnetd - The telnet server telnetd-ssl - The telnet server with SSL encryption support chl:~#inetutils-telnetd あたりかな。
chl:~# wget ftp://ftp.debian.org/debian/pool/main/i/inetutils/inetutils-telnetd_1.6-2_armel.deb --2009-09-22 12:49:59-- ftp://ftp.debian.org/debian/pool/main/i/inetutils/inetutils-telnetd_1.6-2_armel.deb => `inetutils-telnetd_1.6-2_armel.deb' Resolving ftp.debian.org... 130.89.149.226 Connecting to ftp.debian.org|130.89.149.226|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /debian/pool/main/i/inetutils ... done. ==> SIZE inetutils-telnetd_1.6-2_armel.deb ... 114674 ==> PASV ... done. ==> RETR inetutils-telnetd_1.6-2_armel.deb ... done. Length: 114674 (112K) 100%[======================================>] 114,674 75.5K/s in 1.5s 2009-09-22 12:50:05 (75.5 KB/s) - `inetutils-telnetd_1.6-2_armel.deb' saved [114674] chl:~#
chl:~# ar tv inetutils-telnetd_1.6-2_armel.deb -su: ar: command not found chl:~#あー。ar がない。インストールする。
chl:~# apt-get install binutils Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: binutils-doc The following NEW packages will be installed: binutils 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 2601kB of archives. After this operation, 7430kB of additional disk space will be used. Get:1 http://ftp.jp.debian.org lenny/main binutils 2.18.1~cvs20080103-7 [2601kB] Fetched 2601kB in 8s (321kB/s) Selecting previously deselected package binutils. (Reading database ... 8591 files and directories currently installed.) Unpacking binutils (from .../binutils_2.18.1~cvs20080103-7_armel.deb) ... Processing triggers for man-db ... Setting up binutils (2.18.1~cvs20080103-7) ... chl:~# which ar /usr/bin/ar chl:~#やり直し。
chl:~# ar tv inetutils-telnetd_1.6-2_armel.deb rw-r--r-- 0/0 4 Aug 18 14:04 2009 debian-binary rw-r--r-- 0/0 1032 Aug 18 14:04 2009 control.tar.gz rw-r--r-- 0/0 113450 Aug 18 14:04 2009 data.tar.gz chl:~#良くわかってないが、、、、展開
chl:~# ^t^x ar xv inetutils-telnetd_1.6-2_armel.deb x - debian-binary x - control.tar.gz x - data.tar.gz chl:~#どれに入っている?
chl:~# tar ztvf control.tar.gz drwxr-xr-x root/root 0 2009-08-18 14:04 ./ -rw-r--r-- root/root 579 2009-08-18 14:04 ./md5sums -rwxr-xr-x root/root 231 2009-08-18 14:00 ./postinst -rw-r--r-- root/root 596 2009-08-18 14:03 ./control -rwxr-xr-x root/root 172 2009-08-18 14:00 ./postrm chl:~# tar ztvf data.tar.gz drwxr-xr-x root/root 0 2009-08-18 13:59 ./ drwxr-xr-x root/root 0 2009-08-18 13:59 ./usr/ drwxr-xr-x root/root 0 2009-08-18 13:59 ./usr/sbin/ -rwxr-xr-x root/root 80644 2009-08-18 13:59 ./usr/sbin/telnetd drwxr-xr-x root/root 0 2009-08-18 13:59 ./usr/share/ drwxr-xr-x root/root 0 2009-08-18 13:59 ./usr/share/doc/ drwxr-xr-x root/root 0 2009-08-18 13:59 ./usr/share/doc/inetutils-telnetd/ -rw-r--r-- root/root 320 2007-06-05 02:16 ./usr/share/doc/inetutils-telnetd/AUTHORS -rw-r--r-- root/root 2428 2008-12-27 23:08 ./usr/share/doc/inetutils-telnetd/NEWS.gz -rw-r--r-- root/root 53935 2008-12-28 06:17 ./usr/share/doc/inetutils-telnetd/changelog.gz -rw-r--r-- root/root 1474 2007-03-11 07:40 ./usr/share/doc/inetutils-telnetd/THANKS -rw-r--r-- root/root 3043 2009-08-18 13:24 ./usr/share/doc/inetutils-telnetd/copyright -rw-r--r-- root/root 9555 2009-08-18 13:24 ./usr/share/doc/inetutils-telnetd/changelog.Debian.gz drwxr-xr-x root/root 0 2009-08-18 13:59 ./usr/share/man/ drwxr-xr-x root/root 0 2009-08-18 13:59 ./usr/share/man/man8/ -rw-r--r-- root/root 5291 2009-08-18 13:59 ./usr/share/man/man8/telnetd.8.gz chl:~# cat debian-binary 2.0 chl:~#
chl:~# tar zxvf control.tar.gz ./ ./postinst ./preinst ./prerm ./postrm ./md5sums ./control chl:~# cat postinst #!/bin/sh set -e if [ "$1" = "configure" ]; then if [ -x /usr/sbin/update-inetd ]; then update-inetd --group STANDARD \ --add "#単に inetd.conf に書けば良いようだ。# telnet\tstream\ttcp\tnowait\troot\t/usr/sbin/telnetd\ttelnetd" fi fi exit 0 chl:~#
chl:~# tar zxvf data.tar.gz ./usr/sbin/telnetd ./usr/sbin/telnetd chl:~# ls -l /tmp/root/usr/sbin/te* ls: cannot access /tmp/root/usr/sbin/te*: No such file or directory chl:~# mv usr/sbin/telnetd /tmp/root/sbin/ chl:~#
chl:~# cat /tmp/root/etc/inetd.conf # /etc/inetd.conf: see inetd(8) for further informations. # # Internet server configuration database # # #rsync stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/rsync --daemon #8873 stream tcp nowait nobody /usr/sbin/tcpd /usr/local/sbin/rsfwds rsync stream tcp nowait root /usr/local/bin/rsync /usr/local/bin/rsync --daemon 8873 stream tcp nowait nobody /usr/local/sbin/rsfwds /usr/local/sbin/rsfwds #telnet stream tcp nowait root /usr/sbin/telnetd /usr/sbin/telnetd chl:~#telnetd の行が、コメントアウトされている。
行頭のコメントを消す。
chl:~# vi !$ : : chl:~# cat !$ cat /tmp/root/etc/inetd.conf # /etc/inetd.conf: see inetd(8) for further informations. # # Internet server configuration database # # #rsync stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/rsync --daemon #8873 stream tcp nowait nobody /usr/sbin/tcpd /usr/local/sbin/rsfwds rsync stream tcp nowait root /usr/local/bin/rsync /usr/local/bin/rsync --daemon 8873 stream tcp nowait nobody /usr/local/sbin/rsfwds /usr/local/sbin/rsfwds telnet stream tcp nowait root /usr/sbin/telnetd /usr/sbin/telnetd chl:~#
chl:~# cat /tmp/root/etc/shadow root::11009:0:99999:7::: bin:*:11009:0:99999:7::: daemon:*:11009:0:99999:7::: halt:*:11009:0:99999:7::: ftp:*:11009:0:99999:7::: rpc:*:11009:0:99999:7::: rpcuser:*:11009:0:99999:7::: apache:*:11009:0:99999:7::: admin:$1$$I2o9Z7NcvQAKp7wyCTlia0:11009:0:99999:7::: sshd:!:13241:0:99999:7::: nobody:!:13148:0:99999:7::: guest:!:13148:0:99999:7::: chl:~#1.10 で消しているのが引き継がれている。
これで telnet できそう。
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:~$あかんかぁ。
|
← ファームウェア 1.21 の telnetd |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ ファームウェア 1.21 に telnetd(2) |