The vulnerable binary, named "daemon", is a core component responsible for:
Each TCP request sent to port 6789 is processed by the daemon_parse_exec function.
Figure 1 : image
Within this function:
Then, the input (starting from the 6th byte of the payload) is concatenated with a base path to form the final script execution path.
Figure 2 : image
This concatenated path is executed with root privileges using
Figure 3 : image
To exploit this vulnerability, send the following payload via a raw TCP connection to port 6789:
Code12 12 ../../../usr/bin/cmd
No newline or carriage return is required. This payload instructs the daemon to execute the /usr/bin/cmd binary.
Figure 4 : image
After successful execution, the device opens port 999, which is indicative of the cmd process being launched.
Figure 5 : image
This vulnerability was discovered by Yassine Damiri. The research helps improve awareness around the security risks posed by weak input validation and serves as a basis for further security improvements.
This repository is intended for educational and ethical hacking purposes only. Unauthorized access to devices or systems is illegal. Always obtain proper authorization before conducting security testing.
Yassine Damiri