Clear the leaked password
A web-app config under /var/www contains a database password in plain text — and it has been reused elsewhere.
Find the leaked password, then remove it from the config file.
How it works: the terminal below is a real Linux machine running in your browser. Click it and
type. Tasks tick themselves off as you complete them; questions are answered in the box under each task.
Press Reset any time for a fresh machine. Your password on this machine (for
sudo) is student.
Hints
`cat /var/www/app/config.php` shows the DB_PASS line in plain text.
`sudo sed -i '/DB_PASS/d' /var/www/app/config.php` deletes that line.
Solution explanation
The config held a database password in plain text that an attacker could read and — because passwords get reused — try against the root account. You removed the secret from the file with sed. In production you would go further: rotate the exposed password, store the new one in a secrets manager or an environment variable, and make sure it is not reused anywhere else.
Show solution
cd /home/student
cat /var/www/app/config.php
sudo sed -i '/DB_PASS/d' /var/www/app/config.php
cat /var/www/app/config.php