You need to find which table holds the key. Blindly guess common names like keys, secrets, hash. Using a Boolean condition:
5' AND (SELECT COUNT(*) FROM keys) > 0 AND '1'='1
If "Valid" appears, the table keys exists.
Similarly, find the column:
5' AND (SELECT COUNT(secret) FROM keys) > 0 AND '1'='1
If valid -> column secret exists in table keys.
(Note: In many versions of Challenge 5, the table is ch5 and column is hash or key.)
Now that we have the table name (e.g., challenge5), we need to know the column names to select the password or key.
Payload:
' UNION SELECT 1, column_name, 3 FROM information_schema.columns WHERE table_name = 'challenge5'--
Result Analysis:
The screen should list the columns in that table. Common names are username, password, pin, or answer.
Let's assume the output reveals columns: username and password.
Not all Security Shepherd deployments are identical. Some variations of Challenge 5 include: