1. Home
  2. Explore
  3. Computer Science
  4. SQL Injection Dangers

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

SQL Injection Dangers

  • 28Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: SQL Injection Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What serious consequences can result from a successful SQL injection attack?

Tap to flipClick to flipspace

Loss of usernames and passwords, bad public relations, and legal repercussions under data protection acts.

Or swipe the card

28 cards

  1. What serious consequences can result from a successful SQL injection attack?

    Loss of usernames and passwords, bad public relations, and legal repercussions under data protection acts.

  2. What happens to a hacker if they are caught performing an illegal SQL injection?

    They will likely go to jail.

  3. Why is performing SQL injection on your own website, with permission, considered acceptable for demonstration purposes?

    Because you have given yourself permission, making it legal for personal testing and demonstration.

  4. In the context of the demonstration, what programming language is the vulnerable website using?

    PHP

  5. What critical security measure did the vulnerable PHP website fail to implement?

    It did not escape strings, leading to SQL injection vulnerability.

  6. What type of HTTP request is sent when a user types 'hammer' into the search box and clicks submit?

    A POST request.

  7. How does a special SQL command character in a text box lead to a vulnerability?

    It causes the SQL string formed by PHP to be malformed, either breaking the query or creating multiple queries.

  8. What is the first step to determine if a text box is vulnerable to SQL injection?

    Input a single quote (').

  9. What kind of server response indicates a potential SQL injection vulnerability when a single quote is entered?

    A 'server error' message, rather than a message indicating no product was found or treating the quote as a character.

  10. What is the hypothesized SQL query structure for the product search function?

    SELECT FROM WHERE LIKE '%<search_term>%'

  11. Why is it important to determine the specific database management system (DBMS) running on the server?

    Different DBMS (e.g., MySQL, PostgreSQL, SQL Server) have slightly different SQL syntax, which allows for targeted attacks.

  12. How can an attacker comment out the rest of a malformed SQL query to make it valid?

    By appending a semicolon (;) followed by a comment symbol (e.g., '--' for MySQL/PostgreSQL or '/*' for multi-line comments).

  13. What is the purpose of injecting 'sleep(X)' into an SQL query for a blind SQL injection?

    To test for the database type and vulnerability based on the server's response time.

  14. How did the demonstration confirm that MySQL was the DBMS using a sleep function?

    By observing that the server took four seconds to respond when 'sleep(2)' was injected into a query that would hit two rows.

  15. What is a 'blind SQL injection'?

    An SQL injection where an attacker does not receive direct output but infers information based on the time it takes for the server to respond or other side effects.

  16. What SQL keyword is used to combine the results of two or more SELECT statements?

    UNION

  17. What is 'DUAL' in MySQL, and how is it used in SQL injection?

    DUAL is a placeholder table name used in SELECT statements when you don't need to select from an actual table, primarily for testing purposes.

  18. How was the number of columns in the original query determined during the UNION attack?

    By trying to UNION with 'SELECT 1, 2, 3 FROM DUAL' and observing if the '1, 2, 3' appeared, indicating three columns.

  19. What is the 'information_schema' database in MySQL?

    It is a metadata database that contains information about all other databases, tables, columns, and access privileges on the server.

  20. Which specific table within the 'information_schema' database can reveal the names of all tables in the database?

    The 'information_schema.tables' table.

  21. What was the name of the table identified as containing sensitive user data in the demonstration?

    users

  22. Which specific table within the 'information_schema' database can reveal the column names for a given table?

    The 'information_schema.columns' table.

  23. What were the three column names identified in the 'users' table during the demonstration?

    user_ID, user_login, user_hash, and user_type.

  24. What is a 'hashed password' and why is it preferred over an 'unencrypted password'?

    A hashed password is a one-way cryptographic function of a password. It is preferred because it prevents direct access to the actual password even if the database is compromised.

  25. Why is it still a risk even if passwords are 'hashed' in the database?

    Many databases do not hash passwords securely, making them vulnerable to cracking techniques like brute-force or dictionary attacks.

  26. What are the two primary methods to prevent SQL injection attacks?

    Parameterized queries and sanitizing input (escaping strings).

  27. What is a 'second-order SQL injection'?

    An SQL injection where malicious input is stored in the database and then later retrieved and executed as part of another query.

  28. How quickly can automated scripts perform the type of SQL injection demonstrated?

    As quickly as three commands to obtain and dump data to a file.

Card 1 of 28
Card 1 of 28

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent