Network-attached storage devices produced by LG Electronics are affected by a critical remote code execution vulnerability that could be exploited by criminals in order to gain full control of the devices.

Security researchers at the security firm VPN Mentor found a pre-auth remote command injection vulnerability that can affect the majority of LG NAS device models.

The researchers said the following:

“We found a way to hack into the system using a pre-authenticated remote command injection vulnerability, which can then allow us to do virtually everything including access the data and tamper with the user data and content.” states the blog post published by VPN Mentor.

“The vulnerability is a pre-auth remote command injection vulnerability found in the majority of LG NAS devices.”

LG-NAS

The flaw matches the improper validation of the “password” parameter of the user login page for remote management, this means that a remote cyber attacker can pass arbitrary system commands through this field.

“As we show in the video, you cannot simply log in with any random username and password. However, there lies a command injection vulnerability in the “password” parameter (you have to use an interceptor like the burp suite). We can simply trigger this bug by adding to it.” continues the analysis.

“To add a new user, we can simply write a persistent shell called c.php by using:

;echo “” > /tmp/x2;sudo mv /tmp/x2 /var/www/c.php

Entering it as a password exploits the vulnerability.

Then, by passing the following command, we can “dump” the users:

echo “.dump user” | sqlite3 /etc/nas/db/share.db"

 

The experts explained that is very simple to dump all database data and add a new user. Experts noticed that LG uses the MD5 hash algorithm to protect passwords, this means that they can be easily cracked (MD5 is an obsolete password representation today).

Below can be seen a video PoC of the hack that shows how to exploit the vulnerability to establish a shell on the vulnerable Network-attached storage device and use it to execute commands.

LG has not yet released a security update to address the flaw. For this reason, if you are using LG NAS devices do not expose them on the Internet and protect them with a  firewall that will allow only connection from authorized IPs.

Users are also recommended to periodically observed for any suspicious activity by checking all registered usernames and passwords on their devices. Be aware!

 


Deixe um comentário

O seu endereço de email não será publicado. Campos obrigatórios marcados com *