Appointment
Initial Scan
Task 1
What does the acronym SQL stand for?
Answer: Structured Query Language
Task 2
What is one of the most common type of SQL vulnerabilities?
Answer: SQL Injection
Task 3
What does PII stand for?
Answer: Personally Identifiable Information
Task 4
What does the OWASP Top 10 list name the classification for this vulnerability?
Answer: A03:2021-Injection
Task 5
What service and version are running on port 80 of the target?
Found in initial scan
Answer: Apache httpd 2.4.38 ((Debian))
Task 6
What is the standard port used for the HTTPS protocol?
Found from general knowledge
Answer: 443
Task 7
What is one luck-based method of exploiting login pages?
Found from general knowledge
Answer: Brute-Forcing
Task 8
What is a folder called in web-application terminology?
Found from general knowledge
Answer: Directory
Task 9
What response code is given for "Not Found" errors?
Found from general knowledge
Answer: 404
Task 10
What switch do we use with Gobuster to specify we're looking to discover directories, and not subdomains?
Similar question in a previous room
Answer: dir
Task 11
What symbol do we use to comment out parts of the code?
Found from general knowledge
Answer: #
Task 12
Submit root flag
Gobuster didn't us much unfortunately.
Nor did trying default passwords
Now lets try SQL Injection
SQL authentication example vulnerable to SQL Injection attacks:
We can modify the query (the $sql variable) through the log-in form on the web page to make the query do something that is not supposed to do, bypass the authentication. We can specify the username and password through the log-in form on the web page, but it will be directly embedded in the $sql variable that performs the SQL query without input validation.
No regular expressions or functions stop us from inserting special characters, such as a single quote or pound sign. This is a dangerous practice due to those special characters can be used for modifying the queries. The pair of single quotes are used to specify the exact data that needs to be retrieved from the SQL Database, while the pound sign symbol is used to make comments. We could manipulate the query command with:
Close the query with that single quote, allowing the script to search for the admin username. Adding the pound sign, it comments out the rest of the query, which will make searching for a matching password for the specified username useless. Looking further down in the PHP authentication above, we will see that the code will only approve the login once there is one result of username AND password. Since we have skipped the password search part of our query, the script will now only search if any entry exists with the username admin. There is an account with the admin name, which will validate our SQL Injection and return the 1
value for the $count
variable, which will be put through the if statement, allowing us to log-in without knowing the password.
With this information, we can try logging in with admin'#
Answer: e3d0796d002a446c0e622226f42e9672
Last updated