ファームウェアアップデートをしている最中に
シリアルコンソールなどから LinkStation にログインして
ps を実行すると unzip コマンドの引数に渡されている
パスワードが見える。
マルチユーザのOSでコマンドラインオプションで
パスワードを渡したらそりゃ見えるわな。
まあ、中にログインされることを想定していない事になっている
標準ファームだとなんでもありか。
というわけで、unzip する。
ude:/mnt/linkstation/firmware/LS-XHL/1.02# unzip initrd.img bash: unzip: command not found ude:/mnt/linkstation/firmware/LS-XHL/1.02#その前に、unzip のインストールが必要(藁)。
ude:/mnt/linkstation/firmware/LS-XHL/1.02# apt-get install unzip Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: zip The following NEW packages will be installed: unzip 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 163kB of archives. After this operation, 340kB of additional disk space will be used. Get:1 http://ftp.jp.debian.org lenny/main unzip 5.52-12 [163kB] Fetched 163kB in 2s (59.3kB/s) Selecting previously deselected package unzip. (Reading database ... 10057 files and directories currently installed.) Unpacking unzip (from .../unzip_5.52-12_armel.deb) ... Processing triggers for man-db ... Setting up unzip (5.52-12) ... ude:/mnt/linkstation/firmware/LS-XHL/1.02#もう一回。
ude:/mnt/linkstation/firmware/LS-XHL/1.02# unzip initrd.img Archive: initrd.img [initrd.img] initrd.buffalo password: password incorrect--reenter: password incorrect--reenter: inflating: initrd.buffalo ude:/mnt/linkstation/firmware/LS-XHL/1.02# ls -l total 135568 -rw-r--r-- 1 root root 8509792 Dec 26 14:21 initrd.buffalo -rw-rw---- 1 yasunari yamasita 8465190 Dec 26 15:39 initrd.img -rw-rw---- 1 yasunari yamasita 119751513 Dec 29 10:09 lsxhl-102.exe -rw-rw---- 1 yasunari yamasita 2087876 Dec 26 15:39 uImage.buffalo ude:/mnt/linkstation/firmware/LS-XHL/1.02#できた。
ude:/mnt/linkstation/firmware/LS-XHL/1.02# apt-cache search mkimage jigit - tools for working with jigdo files uboot-mkimage - generate kernel image for U-Boot ude:/mnt/linkstation/firmware/LS-XHL/1.02#uboot-mkimage をインストールする。
ude:/mnt/linkstation/firmware/LS-XHL/1.02# apt-get install uboot-mkimage Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: uboot-mkimage 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 11.4kB of archives. After this operation, 57.3kB of additional disk space will be used. Get:1 http://ftp.jp.debian.org lenny/main uboot-mkimage 0.4 [11.4kB] Fetched 11.4kB in 0s (11.6kB/s) Selecting previously deselected package uboot-mkimage. (Reading database ... 10076 files and directories currently installed.) Unpacking uboot-mkimage (from .../uboot-mkimage_0.4_armel.deb) ... Setting up uboot-mkimage (0.4) ... ude:/mnt/linkstation/firmware/LS-XHL/1.02#それぞれのファイルを見てみる。
ude:/mnt/linkstation/firmware/LS-XHL/1.02# mkimage -l initrd.buffalo Image Name: initrd Created: Fri Dec 26 14:21:01 2008 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 8509728 Bytes = 8310.28 kB = 8.12 MB Load Address: 0x00000000 Entry Point: 0x00000000 ude:/mnt/linkstation/firmware/LS-XHL/1.02# mkimage -l uImage.buffalo Image Name: Linux-2.6.22.18 Created: Fri Dec 26 14:20:02 2008 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2087812 Bytes = 2038.88 kB = 1.99 MB Load Address: 0x00008000 Entry Point: 0x00008000 ude:/mnt/linkstation/firmware/LS-XHL/1.02#取り出しには成功していそう。
ude:/mnt/linkstation/firmware/LS-XHL/1.02# ln -s `pwd`/initrd.buffalo /srv/tftp/ ude:/mnt/linkstation/firmware/LS-XHL/1.02# ln -s `pwd`/initrd.buffalo /srv/tftp/ ude:/mnt/linkstation/firmware/LS-XHL/1.02# ^initrd^uImage ln -s `pwd`/uImage.buffalo /srv/tftp/ ude:/mnt/linkstation/firmware/LS-XHL/1.02# ls -l /srv/tftp/ total 0 drwxr-xr-x 2 root root 48 Jan 24 09:31 LS-CL+HackKit lrwxrwxrwx 1 root root 52 Jan 24 17:18 initrd.buffalo -> /mnt/linkstation/firmware/LS-XHL/1.02/initrd.buffalo lrwxrwxrwx 1 root root 52 Jan 24 17:19 uImage.buffalo -> /mnt/linkstation/firmware/LS-XHL/1.02/uImage.buffalo ude:/mnt/linkstation/firmware/LS-XHL/1.02#
Jan 24 17:34:05 ude in.tftpd[814]: connect from 192.168.11.150 (192.168.11.150) Jan 24 17:34:05 ude tftpd[815]: tftpd: trying to get file: uImage.buffalo Jan 24 17:34:05 ude tftpd[815]: tftpd: serving file from /srv/tftp Jan 24 17:34:15 ude in.tftpd[816]: connect from 192.168.11.150 (192.168.11.150) Jan 24 17:34:15 ude tftpd[817]: tftpd: trying to get file: uImage.buffalo Jan 24 17:34:15 ude tftpd[817]: tftpd: serving file from /srv/tftp Jan 24 17:34:25 ude in.tftpd[818]: connect from 192.168.11.150 (192.168.11.150) Jan 24 17:34:25 ude tftpd[819]: tftpd: trying to get file: uImage.buffalo Jan 24 17:34:25 ude tftpd[819]: tftpd: serving file from /srv/tftpなんか、リトライしている。AC アダプタを抜く
置き直す。
ude:~# cd /srv/tftp/ ude:/srv/tftp# ls -al total 0 drwxr-xr-x 3 root root 68 Jan 24 17:19 . drwxr-xr-x 3 root root 17 Jan 24 09:07 .. drwxr-xr-x 2 root root 48 Jan 24 09:31 LS-CL+HackKit lrwxrwxrwx 1 root root 52 Jan 24 17:18 initrd.buffalo -> /mnt/linkstation/firmware/LS-XHL/1.02/initrd.buffalo lrwxrwxrwx 1 root root 52 Jan 24 17:19 uImage.buffalo -> /mnt/linkstation/firmware/LS-XHL/1.02/uImage.buffalo ude:/srv/tftp# rm initrd.buffalo uImage.buffalo ude:/srv/tftp# (cd /mnt/linkstation/firmware/LS-XHL/1.02/; tar cf - !*)|tar xvf - (cd /mnt/linkstation/firmware/LS-XHL/1.02/; tar cf - initrd.buffalo uImage.buffalo)|tar xvf - initrd.buffalo uImage.buffalo ude:/srv/tftp#こういうときに !* は便利。
ude:/srv/tftp# ls -al total 10352 drwxr-xr-x 3 root root 68 Jan 24 17:39 . drwxr-xr-x 3 root root 17 Jan 24 09:07 .. drwxr-xr-x 2 root root 48 Jan 24 09:31 LS-CL+HackKit -rw-r--r-- 1 root root 8509792 Dec 26 14:21 initrd.buffalo -rw-rw---- 1 yasunari yamasita 2087876 Dec 26 15:39 uImage.buffalo ude:/srv/tftp# chown root.root uImage.buffalo ude:/srv/tftp# chmod 644 uImage.buffalo ude:/srv/tftp#
ude:/srv/tftp# !tail tail -f /var/log/daemon.log Jan 24 17:46:44 ude in.tftpd[877]: connect from 192.168.11.150 (192.168.11.150) Jan 24 17:46:44 ude tftpd[878]: tftpd: trying to get file: uImage.buffalo Jan 24 17:46:44 ude tftpd[878]: tftpd: serving file from /srv/tftp Jan 24 17:46:45 ude in.tftpd[879]: connect from 192.168.11.150 (192.168.11.150) Jan 24 17:46:45 ude tftpd[880]: tftpd: trying to get file: initrd.buffalo Jan 24 17:46:45 ude tftpd[880]: tftpd: serving file from /srv/tftp来た来たぁ!
また違う MAC アドレスだ。
ude:/srv/tftp# mkdir LS-XHL_1.02 ude:/srv/tftp# mv initrd.buffalo uImage.buffalo !$ mv initrd.buffalo uImage.buffalo LS-XHL_1.02 ude:/srv/tftp# ls -l total 0 drwxr-xr-x 2 root root 48 Jan 24 09:31 LS-CL+HackKit drwxr-xr-x 2 root root 48 Jan 24 18:00 LS-XHL_1.02 ude:/srv/tftp#コレクション(?)その2
さぁ、次はいよいよお楽しみ
|
|
← 重畳 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ initrd に telnet |