Bash
Variable Comparison Vulnerability
The vulnerability here lies in the issue of variable comparison.
The correct way would be this: "$var"
Instead of this: $var
Exploit Vulnerability:
This vulnerability allows us to discover the password through brute force.
In this case, cred.txt contains the password k4l1L1nUx.
The program will interpret [[ $DB_PASS == k4l1L1nUx ]] the same as [[ $DB_PASS == k* ]].
So through testing, we would discover the password. To automate it, we will use a Python script.
Python Script
The result upon executing the script:
Last updated