找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1458|回复: 4

小米路由器C8809等免拆一键SSH

[复制链接]
发表于 2024-6-17 01:40:21 | 显示全部楼层 |阅读模式
本帖最后由 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
以下示例再 WSL 系统下进行先安装 python3 (sudo apt install pyhton3) 然后clone https://github.com/openwrt-xiaomi/xmir-patcher

! ~7 u, }; u- p; v0 N) a; U  P
最快只需要启动,选择`2` 然后 输入密码即可自动开启。
1. 启动程序 ./run.sh
" `' E3 f& k! {' B1 q8 h
首次会安装大量的python依赖比较慢,国内可能需要切换python源
  1. ./run.sh
    # n* S. x8 Z0 z# [! `
  2. ... 安装信息* a( M/ C5 \9 s! m
  3. ==========================================================# r8 R2 U! U- L( Q

  4. ! t# ?1 _! X' [, f
  5. Xiaomi MiR Patcher  6 _" I4 C" x# a, ~( N7 Z' q
  6. 9 c- I9 c' s! f3 Y  ?  R
  7. 1 - Set IP-address (current value: 192.168.2.1)! n' z5 M1 J9 E
  8. 2 - Connect to device (install exploit)+ u! I  P* I/ U$ F; k2 W! g
  9. 3 - Read full device info
    , Z- F6 ]+ {0 }
  10. 4 - Create full backup8 q" a8 F. A- S3 e( P# x& r* b1 J
  11. 5 - Install EN/RU languages7 X" b& R- R8 p& q% s5 w
  12. 6 - Install Breed bootloader- b; A0 S" Y) g- U- m( |2 @6 H+ N
  13. 7 - Install firmware (from directory "firmware")
    ! t4 |( }7 W8 m7 g3 A' ~
  14. 8 - {{{ Other functions }}}. a! w7 u3 P/ B; [  _
  15. 9 - [[ Reboot device ]]
    8 n: w5 T- f/ ^% X* N8 w$ {
  16. 0 - Exit- X2 u; Z4 P4 t0 W# j4 H/ l
  17. ( B7 t: t8 N0 I1 m2 l
  18. Select:
复制代码

4 ~2 x) W% l* I# e; n/ F
确认小米路由器IP 是 192.168.2.1 (可以打开网页登录界面). 如果不是就看改成正确的或者重置。
2. 然后选择 2 开启ssh
  W) w+ b% {! a; {7 L
列出路由器设备信息
  1. Select: 2
    6 s# G8 M' H0 I
  2. device_name = CR8809
    4 B, b! `3 f1 p: E" o
  3. rom_version = 6.2.182 release
    ( m; ]; _8 }* k7 g0 r
  4. mac address = 74:3a:f4:01:30:ec$ U+ E9 R; b. ^- C' k! L
  5. 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
  1. Enter device WEB password: GuanLiMiMa
    " ]" Z9 C) ^- K* |; c* Y+ i
  2. Enable smartcontroller scene executor ... # 检测 smartcontroller API2 T% E: R! d; m. q! g" c" N- T4 e
  3. Wait smartcontroller activation ... # 确认 smartcontroller 漏洞是否可用: ?) l6 R, {3 l( s+ G  c4 Y
  4. Unlock dropbear service ... # 解锁 dropbear (删除release标记)# M& n: F! H5 g* W: i% F
  5. Unlock SSH server ... # 修改 ssh 配置 (ssh_en=1)/ ~. T8 E% I, Q8 c0 R
  6. Set password "root" for root user ... # 修改root 密码为 root' }' n0 {, s: a- M' g# n' O, }
  7. Enabling dropbear service ... # 启动 dropbear (ssh 服务)* v' U% W+ M0 u0 c8 Y5 t0 ^# p
  8. Run SSH server on port 22 ... # 重启 ssh
    ) h$ D) p$ [5 ^0 }; \5 K. x
  9. Test SSH connection to port 22 ... # 测试
    1 f% c2 ]6 Z) `) I% p4 v3 Q$ l
  10. ( F& g" W2 h9 D
  11. #### 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
  1. 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 `

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
发表于 2024-6-17 09:17:19 | 显示全部楼层
+1,这才是好教程...
3 g7 i; T! X: m6 ]8 j$ F6 p. H0 {7 M3 w
----------------------------
发表于 2024-6-17 09:20:48 | 显示全部楼层
不错的帖子,谢谢分享
发表于 2024-6-17 14:29:12 | 显示全部楼层
好东西,正需要这个
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|宽带技术网 |网站地图 粤公网安备44152102000001号

GMT+8, 2025-5-1 23:10 , Processed in 0.023425 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表