The affected devices that we've used in the following proofs of concept are:
- BMX P34 CPU B
- STB NIP 2311
REMOTE FILE INCLUSION
The web applications of the aforementioned devices allow the inclusion and exploitation of malicious code hosted on remote servers.
These are exploited by modifying the URL so it includes remote files with malicious code.
Paths vulnerable: http://<ip-PLC>/html/english/home/index.htm?<RFI>
We created a website with JS:
In the following PoC, we managed to embed a game into the site.
LOCAL FILE INCLUSION
The web applications of these devices facilitate the obtention of files hosted on the server. These are exploited by modifying the URL, so that it targets existing internal files.
If we load any text file (*.css,*.html,*.conf,*.ini,*.js, etc) to the vulnerable path, it will be displayed on the screen. For instance, we can create a call to a JS file:
The same cannot be applied to the binaries (*.bin,*.gzip,*.fw,etc). These will simply be downloaded to our computer. By abusing this condition, we are able to restart the path of the different JARs identified and download them for further analysis.
Replace the URL with the relevant resource:
Download the "SAComm.jar":
The *.JAR resources provide logic to the PLC web application; the same resources that we had previously downloaded. After decompiling these files, we are able to see the credentials that give us access to the FTP and VxWork services.
We use the collected credentials to authenticate ourselves to the FTP service; where, among others, we are able to find the file "password.rdt", which stores the password in clear text allowing access to the web admin of the device.