ude:~# tail -f /var/log/messages : : Nov 3 20:48:11 ude kernel: usb 2-1: new high speed USB device using ehci_platform and address 2 Nov 3 20:48:11 ude kernel: usb 2-1: configuration #1 chosen from 1 choice Nov 3 20:48:11 ude kernel: scsi2 : SCSI emulation for USB Mass Storage devices Nov 3 20:48:16 ude kernel: Vendor: WDC WD32 Model: WD-WCAMR1683855 Rev: 5J08 Nov 3 20:48:16 ude kernel: Type: Direct-Access ANSI SCSI revision: 02 Nov 3 20:48:16 ude kernel: SCSI device sdb: 625142448 512-byte hdwr sectors (320073 MB) Nov 3 20:48:16 ude kernel: sdb: Write Protect is off Nov 3 20:48:16 ude kernel: SCSI device sdb: 625142448 512-byte hdwr sectors (320073 MB) Nov 3 20:48:16 ude kernel: sdb: Write Protect is off Nov 3 20:48:16 ude kernel: sdb: sdb1 sdb2 sdb4 < sdb5 sdb6 > Nov 3 20:48:16 ude kernel: sd 2:0:0:0: Attached scsi disk sdb Nov 3 20:48:16 ude kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
ude:~# mkdir /tmp/root ude:~# mount /dev/sdb2 /tmp/root ude:~# ls /tmp/root bin boot dev etc home initrd lib libexec mnt modules proc root sbin sys tmp usr var www ude:~#なんで、LS-GL だと、すんなりマウントできるんだろう。。
ude:~# ls -l /tmp/root/usr/sbin/telnetd lrwxrwxrwx 1 root root 17 Nov 1 2007 /tmp/root/usr/sbin/telnetd -> ../../bin/busybox ude:~#
ude:~# cd /tmp/root/etc/init.d/ ude:/tmp/root/etc/init.d# mv rcS rcS.orig ude:/tmp/root/etc/init.d# cp rcS.orig rcS ude:/tmp/root/etc/init.d# ls -l rcS -rwxr-xr-x 1 root root 2062 Nov 3 20:50 rcS ude:/tmp/root/etc/init.d# ls -l rcS* -rwxr-xr-x 1 root root 2062 Nov 3 20:50 rcS -rwxr-xr-x 1 root root 2062 Jul 15 14:50 rcS.orig ude:/tmp/root/etc/init.d# vi rcS : : ude:/tmp/root/etc/init.d# diff -c rcS.orig rcS *** rcS.orig Tue Jul 15 14:50:18 2008 --- rcS Mon Nov 3 20:52:02 2008 *************** *** 109,111 **** --- 109,112 ---- done /usr/local/bin/share_delete.sh & + /usr/sbin/telnetd ude:/tmp/root/etc/init.d#
ude:/tmp/root/etc/init.d# cd /tmp/root/etc/ ude:/tmp/root/etc# mv shadow shadow.orig ude:/tmp/root/etc# cp shadow.orig shadow ude:/tmp/root/etc# ls -l shadow* -r-------- 1 root root 370 Nov 3 20:54 shadow -r-------- 1 root root 370 Jul 15 14:50 shadow.orig ude:/tmp/root/etc# vi shadow : :vi は :w! で強制上書き、:q で終了。
ude:/tmp/root/etc# diff -c shadow.orig shadow *** shadow.orig Tue Jul 15 14:50:20 2008 --- shadow Mon Nov 3 20:55:26 2008 *************** *** 1,4 **** ! root:(暗号化されたパスワード):11009:0:99999:7::: bin:*:11009:0:99999:7::: daemon:*:11009:0:99999:7::: halt:*:11009:0:99999:7::: --- 1,4 ---- ! root::11009:0:99999:7::: bin:*:11009:0:99999:7::: daemon:*:11009:0:99999:7::: halt:*:11009:0:99999:7::: ude:/tmp/root/etc#
ude:/tmp/root/etc# cd / ude:/# umount /tmp/root ude:/#
BUFFALO INC. LinkStation series LS-WSGL678 login:
BUFFALO INC. LinkStation series LS-WSGL678 login: root root@LS-WSGL678:~#
root@LS-WSGL678:~# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/md1 4993920 272768 4721152 5% / /dev/ram1 15360 104 15256 1% /mnt/ram /dev/md0 988064 109644 878420 11% /boot /dev/disk1_6 305425152 304 305424848 0% /mnt/disk1 /dev/usbdisk1_1 988064 109652 878412 11% /mnt/usbdisk1 root@LS-WSGL678:~# mount rootfs on / type rootfs (rw) /dev/root on / type xfs (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw) /dev/ram1 on /mnt/ram type tmpfs (rw) /dev/md0 on /boot type ext2 (rw,nogrpid) usbfs on /proc/bus/usb type usbfs (rw) /dev/disk1_6 on /mnt/disk1 type xfs (rw,noatime) /dev/usbdisk1_1 on /mnt/usbdisk1 type ext2 (rw,noatime,nogrpid) root@LS-WSGL678:~# umount /mnt/usbdisk1 root@LS-WSGL678:~#
root@LS-WSGL678:~# cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 sda2[1] 5004160 blocks [2/1] [_U] md10 : active raid1 sda5[1] 1003904 blocks [2/1] [_U] md0 : active raid1 sda1[1] 1003904 blocks [2/1] [_U] unused devices: <none> root@LS-WSGL678:~#sda1, sda2, sda5 だけで構成されている。
root@LS-WSGL678:~# mdadm -a /dev/md0 /dev/sdb1 mdadm: re-added /dev/sdb1 root@LS-WSGL678:~# mdadm -a /dev/md1 /dev/sdb2 mdadm: re-added /dev/sdb2 root@LS-WSGL678:~# mdadm -a /dev/md10 /dev/sdb5 mdadm: re-added /dev/sdb5 root@LS-WSGL678:~# cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 sdb2[2] sda2[1] 5004160 blocks [2/1] [_U] resync=DELAYED md10 : active raid1 sdb5[0] sda5[1] 1003904 blocks [2/1] [_U] resync=DELAYED md0 : active raid1 sdb1[0] sda1[1] 1003904 blocks [2/1] [_U] [=============>.......] recovery = 67.7% (681792/1003904) finish=0.2min speed=19657K/sec unused devices: <none> root@LS-WSGL678:~#時々 cat /proc/mdstat を実行して、リカバリが完了するまで待つ。
root@LS-WSGL678:~# cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 sdb2[0] sda2[1] 5004160 blocks [2/2] [UU] md10 : active raid1 sdb5[0] sda5[1] 1003904 blocks [2/2] [UU] md0 : active raid1 sdb1[0] sda1[1] 1003904 blocks [2/2] [UU] unused devices:root@LS-WSGL678:~#
BUFFALO INC. LinkStation series LS-WSGL678 login:
BUFFALO INC. LinkStation series LS-WSGL678 login: root root@LS-WSGL678:~#
root@LS-WSGL678:~# cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 sdb2[0] sda2[1] 5004160 blocks [2/2] [UU] md10 : active raid1 sdb5[0] sda5[1] 1003904 blocks [2/2] [UU] md0 : active raid1 sdb1[0] sda1[1] 1003904 blocks [2/2] [UU] unused devices:root@LS-WSGL678:~#
root@LS-WSGL678:~# ls -l /mnt/disk1/hackkit -rwxrw-rw- 1 nobody nogroup 1061 Oct 30 2008 LS-WSGL_hackkit_step1_0.02.sh -rwxrw-rw- 1 nobody nogroup 6948 Oct 30 2008 LS-WSGL_hackkit_step2_0.10.sh -rwxrw-rw- 1 nobody nogroup 70511788 Mar 17 2008 hackkit_080317.tar.gz -rwxrw-rw- 1 nobody nogroup 15920 Oct 26 2008 mkimage root@LS-WSGL678:~#mkimage には実行ビットを立てておく。
root@LS-WSGL678:~# chmod +x /mnt/disk1/hackkit/mkimage root@LS-WSGL678:~# ls -l /mnt/disk1/hackkit -rwxrw-rw- 1 nobody nogroup 1061 Oct 30 2008 LS-WSGL_hackkit_step1_0.02.sh -rwxrw-rw- 1 nobody nogroup 6948 Oct 30 2008 LS-WSGL_hackkit_step2_0.10.sh -rwxrw-rw- 1 nobody nogroup 70511788 Mar 17 2008 hackkit_080317.tar.gz -rwxrwxrwx 1 nobody nogroup 15920 Oct 26 2008 mkimage root@LS-WSGL678:~#
root@LS-WSGL678:~# sh /mnt/disk1/hackkit/LS-WSGL_hackkit_step1_0.02.sh Extracting initrd... 87853+1 records in 87853+1 records out mounting initrd... editing linuxrc... clearing root's password... rebuilding initrd.buffalo... gziping initrd ... wait 5 minutes Image Name: initrd Created: Thu Nov 1 01:15:33 2007 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 5598379 Bytes = 5467.17 kB = 5.34 MB Load Address: 0x00000000 Entry Point: 0x00000000 root@LS-WSGL678:~#
root@LS-WSGL678:~# shutdown -r now root@LS-WSGL678:~# exit
BUFFALO INC. LinkStation series LS-WSGL-EM678 login:
BUFFALO INC. LinkStation series LS-WSGL-EM678 login: root BusyBox v1.1.1 (2008.07.15-06:14+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. #
# mkdir /mnt/disk1 mkdir: Cannot create directory `/mnt/disk1': File exists # mount /dev/sda6 /mnt/disk1 # ls /mnt/disk1/ hackkit spool #
# sh /mnt/disk1/hackkit/LS-WSGL_hackkit_step2_0.10.sh : :時間がかかるので、腕立て伏せと腹筋(笑)
umount: /boot: device is busy umount: /boot: device is busy #/boot がアンマウントできないのだが、、、。
# shutdown -r now # exit
Debian GNU/Linux 4.0 hackkit login:エクセレント!
|
← RamRoot でファームウェアのアップデート |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ ポチッ |