小米路由器3A(R3A) 利用版本ssh漏洞刷breed和openwrt固件
本文最后更新于 127 天前,其中的信息可能已经有所发展或是发生改变。
  1. 打开路由器连接wifi也好 网线也好 调成中继模式(有报告称在AP模式下路由器存在兼容性问题。如果您无法在AP模式下成功,请尝试切换到其他模式(如WiFi中继或网关模式)) 固件版本升级到2.18.40小米固件网址:https://mirom.ezbox.idv.tw/miwifi/
  2. 创建一个Linux虚拟机 没有的自己想办法 虚拟机下载安装python(略)

导入OpenWRTInvasion包(git或者下载再上传) 到虚拟机 并运行命令

请注意,该脚本必须从登录路由器时使用的相同 IP 地址运行。(虚拟机为桥接 路由器为中继)

openwrt网址: https://github.com/acecilia/OpenWRTInvasion

 ​
 Cd OpenWRTInvasion
 pip3 install -r requirements.txt # Install requirements
 <font color="#8b0000">注意:在执行下一步之前,务必确保MiR3A&MiR3C处于全局可访问外网环境(要有跨栏运动环境)否则即使显示破解成功,telnet也无法登陆。</font>
 python3 remote_command_execution_vulnerability.py # Run the script

您将被要求输入路由器IP地址和stok。您可以从登录管理界面后的路由器URL中获取stok: 请注意,脚本必须从用于登录路由器的相同IP地址运行。

一下代码是失败案例 原因是虚拟机和路由器不在一个网段

 └─$ python3 remote_command_execution_vulnerability.py
 Router IP address [press enter for using the default 'miwifi.com']: 192.168.31.1
 Enter router admin password: 88888888
 There two options to provide the files needed for invasion:
    1. Use a local TCP file server runing on random port to provide files in local directory `script_tools`.
    2. Download needed files from remote github repository. (choose this option only if github is accessable inside router device.)
 Which option do you prefer? (default: 1)
 ****************
 router_ip_address: 192.168.31.1
 stok: 7ef25dd426fb1de311bcf64c571eb2ab
 file provider: local file server
 ****************
 start uploading config file...
 start exec command...
 local file server is runing on 0.0.0.0:58317. root='script_tools'
 Warning: the process has finished, but seems like ssh connection to the router is not working as expected.
 * Maybe your firmware version is not supported, please have a look at https://github.com/acecilia/OpenWRTInvasion/blob/master/README.md#unsupported-routers-and-firmware-versions
 * Anyway you can try it with: telnet 192.168.31.1

这是成功案例

  1. 之后,一个telnet服务器将启动并运行。通过运行以下命令连接到它
 telnet <路由器IP地址>
 用户: root
 密码: root

接下来Breed 的刷入和固件刷入流程基本一致:

  • 获取原厂固件的 SSH 登录权限(可能是通过原厂固件漏洞等方式)
  • 在原厂固件上利用 cat /proc/mtd 获取 ROM 分区的布局
  • [可选] 备份原有的所有 ROM 分区数据,主要目的是为了恢复原厂固件
  • 利用 mtd 等命令直接对 Bootloader 所在的 ROM 区域进行写入镜像
  • 重启设备
  1. 备份分区数据: 刷固件之前最后先将官方固件做一个备份(可选)。 cat /proc/mtd
     dd if=/dev/mtd0 of=/tmp/all.bin
     dd if=/dev/mtd1 of=/tmp/Bootloader.bin
     dd if=/dev/mtd3 of=/tmp/eeprom.bin
  1. 下载breed:https://breed.hackpascal.net/ 用winscp 传进去 选择ftp 也可以本地搭建http 用wget拉取

导入后执行命令 我导入的tmp文件下

 cd /tmp
 mtd -r write breed-mt7621-pbr-m1.bin Bootloader
 ​

稍等片刻 访问本地192.168.1.1

下载openwrt https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/

找到你所需要的版本

设置环境变量 后重启

注意,下面的镜像都有 initramfs-kernel 和 squashfs-sysupgrade 两种;需要使用的是 squashfs-sysupgrade;如果刷入 initramfs-kernel,在重启后配置会丢失,这是因为 initramfs-kernel 将配置保存在内存中,而不是磁盘

上传sysupgrade包

失败第一次 因为initramfs不会保存 上面说过了

失败第n次 怀疑是闪存 分区 固件等原因 因为openwrt的官网现在就没有这个垃圾路由器的型号

然后我又找了好久…….. 搜尽搜索引擎没有一篇专门写关于3a的 视频懒得看 不是要你加群就是收费 关注公众号 对于这种行为我很反感

现在的办法就是 要么找到正确的版本进行安装因为他之前是由3a的镜像的

要么去自己编译一个全新的openwrt镜像文件 自己编译或者云编译都可以 反正openwrt是开源的

在参考了恩山 博客园 小渔等一众大佬的博客下 我的建议是

20块浪费我一天时间 md

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇