Preview

Lab10 SQL Injection Attack Lab

Satisfactory Essays
Open Document
Open Document
655 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Lab10 SQL Injection Attack Lab
Lab10 SQL Injection Attack Lab
Yukui Ye
SUID: 439644268

Task1: SQL Injection Attack on SELECT Statements

Setup: Turn off build-in SQL injection protection
Set magic_quotes_gpc value to ‘off’ in file /etc/php5/apache2/php.ini in order to turn it off.

Then restart it:

Task1.1: Log into another person’s account without knowing the password
Check the login part code to see how it login works.

Following is the PHP codes run at server side.

From the above code, we can tell how server send query to Database. But we can still guess to login without knowing the user’s passward by typing “bob’);-- “( space after the comment’--’ )

By doing above thing, we successfully log into user’s account.

Task1.2: Find a way to modify the database.
We can use semicolon to finish a SQL statement and then append update/insert/delete statement right after semicolon in order to modify the database by SQL injection. Therefore the database will receive two statements at the same time. I tried the following sentence in the log in window.

peter’);update user set company=’SQLinjection’ where id=4;--

It all turned out to be failed as the screenshot showed below.

REASON: First check the PHP codes again:

By checking the code, we can see that it uses mysql_query to send statement to database. But mysql_query can only send one query to database at one time to run. Multiple queries are not supported. Therefore, it not allow to select and update in the same time when using mysql_query.

Task2: SQL Injection on UPDATE Statements
Step1:The main idea is the same as task1, which is to achieve the goal by using‘ -- ’to comment statement, and add our own where condition. First, we login as peter(peter’s original profile is nothing), change the user name to bob, and add “ SU’where ID=3;-- “at the field of company, AND email information as well as phone number.
After we click send buttom, go to peter’s profile, still nothing just as original one.

Then we login as bob to check bob profile, we

You May Also Find These Documents Helpful

  • Good Essays

    When a client connects to the MySQL server, the server uses the username provided by the client and the client host to select the appropriate account row from the mysql.user table. It then uses this row to authenticate the client. Before MySQL 5.5.7, the server authenticates the password provided by the client against the Password column of the account row.…

    • 406 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Database administrators should monitor their SQL databases for unauthorized or abnormal SQL injections and write scripts for alarming as well as Simple Network Management Protocol (SNMP) alerts. Additional safeguards can be placed that include encrypting the data elements that reside in long-term storage of the SQL…

    • 575 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    M1 Unit 4 Assignment

    • 438 Words
    • 2 Pages

    3. Use a cursor FOR loop to retrieve the blog id, blog url and blog description if the blog id is less than 4 and place it in a cursor variable.…

    • 438 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    - Any action that a database takes, creating objects, adding rows, changing data in rows, removing rows, and so on.…

    • 327 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    pt2520 unit 8

    • 287 Words
    • 1 Page

    When a client connects to the MySQL server, the server uses the username provided by the client and the client host to select the appropriate account row from the mysql.user table. It then uses this row to authenticate the client. Before MySQL 5.5.7, the server authenticates the password provided by the client against the Password column of the account row. As of MySQL 5.5.7, the server authenticates clients using plugins. Selection of the proper account row from the mysql.user table is based on the user name and client host, as before, but the server authenticates the client credentials as follows: The server determines from the account row which authentication plugin applies for the client. If the account row specifies no plugin name, the server uses native authentication; that is, authentication against the password stored in the Password column of the account row. This is the same authentication method provided by MySQL servers older than 5.5.7, before pluggable authentication was implemented, but now is implemented using two plugins that are built in and cannot be disabled. If the account row specifies a plugin, the server invokes it to authenticate the user. If the server cannot find the plugin, an error occurs. The plugin returns a status to the server indicating whether the user is permitted to connect.…

    • 287 Words
    • 1 Page
    Good Essays
  • Good Essays

    7. Type the email address of the person to whom it’s to in the “To” box…

    • 1030 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Nt1330 Unit 1 Assignment

    • 711 Words
    • 3 Pages

    Is a process of identifying a user and about verifying whether someone is who they claim to be. Typically, authentication is achieved by the user sharing credentials that somehow verify the user's identity. It usually involves a…

    • 711 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Nt1310 Unit 1

    • 4209 Words
    • 17 Pages

    It parses and also executes the statement Displays the execution plan for the select statement automatically…

    • 4209 Words
    • 17 Pages
    Powerful Essays
  • Satisfactory Essays

    Nt1310 Unit 1 Assignment

    • 533 Words
    • 3 Pages

    Art.1. The Database Management allows you to update the database password and quota, monitor the storage usage of your database, backup and restore your databases, and provides an example of a connection string name.…

    • 533 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    IS3445 Unit 4 Lab

    • 556 Words
    • 2 Pages

    A successful SQL injection exploit can read sensitive data from the database, modify database data (Insert/Update/Delete), execute administration operations on the database, and recover the content of a given file present on the DBMS file system and in some cases issue commands to the operating system.…

    • 556 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    The SQL command that lets you insert data into a table, one row at a time, is…

    • 1917 Words
    • 8 Pages
    Powerful Essays
  • Powerful Essays

    cheat sheet

    • 1430 Words
    • 6 Pages

    3. Find all employees who live in the same city and street as their manager (3 pts)…

    • 1430 Words
    • 6 Pages
    Powerful Essays
  • Better Essays

    Instructions HW1

    • 1434 Words
    • 7 Pages

    Write the following queries in SQL. Each of your answers must be a single SQL query. Your SQL queries…

    • 1434 Words
    • 7 Pages
    Better Essays
  • Satisfactory Essays

    Linux Security Lab 2

    • 304 Words
    • 2 Pages

    By creating groups you can get people access to the information that they need to get to. When a user is created and added to a group that user then has the access permissions of the group that has been made.…

    • 304 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Employment and Salary

    • 839 Words
    • 4 Pages

    10. The HR department wants to run reports based on a manager. Create a query that prompts the user for a manager ID and generates the employee ID, last name, salary, and department for that manager’s employees. The HR department wants the ability to sort the report on a selected column.…

    • 839 Words
    • 4 Pages
    Good Essays

Related Topics