Experiment 4
Experiment 4
Exp No: 4
Tools to be used:
1. SQLMAP
2. Acunetix
Attackers can use SQL Injections to find the credentials of other users in
the database. They can then impersonate these users. The impersonated
user may be a database administrator with all database privileges.
SQL lets you select and output data from the database. An SQL Injection
vulnerability could allow the attacker to gain complete access to all data
in a database server.
SQL also lets you alter data in a database and add new data. For example,
in a financial application, an attacker could use SQL Injection to alter
balances, void transactions, or transfer money to their account.
You can use SQL to delete records from a database, even drop tables.
Even if the administrator makes database backups, deletion of data could
affect application availability until the database is restored. Also, backups
may not cover the most recent data.
In some database servers, you can access the operating system using the
database server. This may be intentional or accidental. In such case, an
attacker could use an SQL Injection as the initial vector and then attack
the internal network behind a firewall.
Steps/Method/Coding:
In the given screenshot you can see we have got an error message which means
the running site is infected by SQL injection.
Maybe we can get some important data from the users table, so let’s penetrate
more inside. Again Use the concat function for table users for retrieving its
entire column names.
We successfully retrieve all eight column names from inside the table users.
Learning Outcomes:
After completing this exercise, you will be able to: Detect SQL Injection, You
completed the following exercises: - SQL Injection Techniques, Launch a SQL
Injection Attack Launch a SQL Injection Attack from command line(url).
In the above screenshot you can see we have got an error message which
means the running site is infected by SQL injection.
Now using ORDER BY keyword to sort the records in ascending or
descending order
Use the next query to fetch the name of the database
Next query will extract the version of the database system
Through the next query, we will try to fetch table name inside the
database
We successfully retrieve all eight column names from inside the table
users.
https://infosecwriteups.com/sql-injection-lab-tryhackme-writeup-fcf30f846e82
https://cybersecurityhoy.files.wordpress.com/2021/07/13-sql-injection.pdf