本帖最后由 newfuture 于 2024-6-17 01:45 编辑
W$ ^; a+ l( Z$ V( s) ]: y( S) Y$ u5 h; N' B( u0 }1 M4 ^5 u
除了早期的小米路由器提供root功能外,新的系统都屏蔽了默认的远程访问。 目前常用的做法就是利用已经发现的漏洞注入shell开启telnet 或 ssh. Xmir patcher 收集了重要的公开漏洞(维护期内的最新版都已经修复),并利用这些漏洞注入脚本。
4 g/ x% ~! ~" f: ~8 L" r比如 CR8809等型号,使用的是一个比较通用的注入漏洞,smartcontroller API 参数注入(payload 需要转码),实现执行任意命令,对于最新版可以直接使用。 环境要求 - python 3.8
- 稳定的网络环境可以访问python源
5 V) Z9 u4 B' b3 m7 `1 i1 j2 w 4 y8 x& g3 ~3 F, {# b P
! ~7 u, }; u- p; v0 N) a; U P
最快只需要启动,选择`2` 然后 输入密码即可自动开启。 1. 启动程序 ./run.sh
" `' E3 f& k! {' B1 q8 h首次会安装大量的python依赖比较慢,国内可能需要切换python源 - ./run.sh
# n* S. x8 Z0 z# [! ` - ... 安装信息* a( M/ C5 \9 s! m
- ==========================================================# r8 R2 U! U- L( Q
! t# ?1 _! X' [, f- Xiaomi MiR Patcher 6 _" I4 C" x# a, ~( N7 Z' q
- 9 c- I9 c' s! f3 Y ? R
- 1 - Set IP-address (current value: 192.168.2.1)! n' z5 M1 J9 E
- 2 - Connect to device (install exploit)+ u! I P* I/ U$ F; k2 W! g
- 3 - Read full device info
, Z- F6 ]+ {0 } - 4 - Create full backup8 q" a8 F. A- S3 e( P# x& r* b1 J
- 5 - Install EN/RU languages7 X" b& R- R8 p& q% s5 w
- 6 - Install Breed bootloader- b; A0 S" Y) g- U- m( |2 @6 H+ N
- 7 - Install firmware (from directory "firmware")
! t4 |( }7 W8 m7 g3 A' ~ - 8 - {{{ Other functions }}}. a! w7 u3 P/ B; [ _
- 9 - [[ Reboot device ]]
8 n: w5 T- f/ ^% X* N8 w$ { - 0 - Exit- X2 u; Z4 P4 t0 W# j4 H/ l
- ( B7 t: t8 N0 I1 m2 l
- Select:
复制代码
4 ~2 x) W% l* I# e; n/ F确认小米路由器IP 是 192.168.2.1 (可以打开网页登录界面). 如果不是就看改成正确的或者重置。 2. 然后选择 2 开启ssh
W) w+ b% {! a; {7 L列出路由器设备信息 - Select: 2
6 s# G8 M' H0 I - device_name = CR8809
4 B, b! `3 f1 p: E" o - rom_version = 6.2.182 release
( m; ]; _8 }* k7 g0 r - mac address = 74:3a:f4:01:30:ec$ U+ E9 R; b. ^- C' k! L
- CountryCode = CN
复制代码 8 v h! J: W$ T% K4 ?7 _* i
- ~. i1 p& E" |% k9 [3. 输入管理密码等待开启
) S- U2 T; M6 \慢慢等待需要2分钟左右
* Z1 ]1 E2 T! ?. h' T- Enter device WEB password: GuanLiMiMa
" ]" Z9 C) ^- K* |; c* Y+ i - Enable smartcontroller scene executor ... # 检测 smartcontroller API2 T% E: R! d; m. q! g" c" N- T4 e
- Wait smartcontroller activation ... # 确认 smartcontroller 漏洞是否可用: ?) l6 R, {3 l( s+ G c4 Y
- Unlock dropbear service ... # 解锁 dropbear (删除release标记)# M& n: F! H5 g* W: i% F
- Unlock SSH server ... # 修改 ssh 配置 (ssh_en=1)/ ~. T8 E% I, Q8 c0 R
- Set password "root" for root user ... # 修改root 密码为 root' }' n0 {, s: a- M' g# n' O, }
- Enabling dropbear service ... # 启动 dropbear (ssh 服务)* v' U% W+ M0 u0 c8 Y5 t0 ^# p
- Run SSH server on port 22 ... # 重启 ssh
) h$ D) p$ [5 ^0 }; \5 K. x - Test SSH connection to port 22 ... # 测试
1 f% c2 ]6 Z) `) I% p4 v3 Q$ l - ( F& g" W2 h9 D
- #### SSH server are activated! ####
复制代码
% j7 _( C( K& v& R3 b' R1 I' v
% e& @7 S" y& w9 p
( z4 j% c6 B/ L4. 重启测速
# j, K. w# S' W+ X重连WiFI - ssh [email]root@192.168.2.1[/email] #密码root
复制代码 8 [ B4 e2 g- U3 j& `9 @& S
Tips:4 L5 j; U! _# j t$ g, J' ~
* V4 @5 ]7 t/ d* J' G" N% u a3 A' |7 j
# @6 Z7 a5 i1 C6 ` |