SQL Injection Flashcards

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/71

flashcard set

Earn XP

Description and Tags

SQL Injection Flashcards

72 Terms

1
New cards
What does SQL injection exploit?

Untrusted input incorporated into a database SQL statement.

2
New cards
What does SQL stand for?

Structured Query Language.

3
New cards
What system does SQL injection primarily target?

The database supporting the application.

4
New cards
Does the database have to be on the web server for SQL injection?

No. It can run on a separate server.

5
New cards
What can successful SQL injection allow?

Unauthorized data retrieval, changes, or deletion.

6
New cards
Which part of the sample SQL query contains user input?

The owner value in its WHERE clause.

7
New cards
What does SELECT do?

Retrieves data from a table.

8
New cards
What does UPDATE do?

Changes existing database records.

9
New cards
What does DELETE do?

Removes database rows.

10
New cards
What does FROM specify in a SELECT query?

The source table.

11
New cards
What does WHERE specify?

Conditions that restrict which rows are affected.

12
New cards
What does SET specify in an UPDATE query?

The columns and values to change.

13
New cards
What are the three general parts of a SQL statement in the book?

Verb, source, and refinement.

14
New cards
What does the verb in a SQL statement define?

The action to perform, such as SELECT, UPDATE, or DELETE.

15
New cards
What does the source part of a SQL statement identify?

The table or tables involved.

16
New cards
What is SQL refinement?

An optional condition limiting which data is affected.

17
New cards
What does SELECT * FROM dropbox retrieve?

All columns in the dropbox table.

18
New cards
Does SQL require keywords to be uppercase?

No. Uppercase is used for readability.

19
New cards
How do attackers initially test potential SQL injection inputs?

Enter malformed or special-character input and observe responses.

20
New cards
What is a common SQL injection test character?

A single quote (').

21
New cards
Why might a single quote reveal a SQL injection issue?

It may break SQL string syntax and produce a database error.

22
New cards
What does OR 'a'='a' demonstrate in a vulnerable query?

An always-true condition that can broaden returned rows.

23
New cards
What can an always-true SQL condition cause?

A query can return rows beyond the intended user filter.

24
New cards
What HTTP parameter is tested in the employee directory example?

search.

25
New cards
What input causes an error in the employee directory example?

Taylor followed by a single quote.

26
New cards
What database product is revealed by the error message?

MariaDB.

27
New cards
Why are detailed database errors valuable to attackers?

They can reveal SQL syntax and database product details.

28
New cards
What is Sqlmap?

A Python-based SQL injection detection and exploitation tool.

29
New cards
What does Sqlmap -u specify?

The target URL to test.

30
New cards
What URL parameter is flagged as vulnerable in the book?

The GET parameter search.

31
New cards
What does boolean-based blind SQL injection use?

True-versus-false response differences.

32
New cards
What is error-based SQL injection?

Using database error responses to infer information.

33
New cards
What does Sqlmap report after finding an injection point?

The parameter, injection type, and sample payload.

34
New cards
Name two commercial SQL injection testing tools in the book.

Burp Suite Professional and Acunetix.

35
New cards
What is the first important rule for Sqlmap URLs?

Start with a valid URL that does not produce an error.

36
New cards
Why must the starting URL be valid when using Sqlmap?

Sqlmap uses it as the normal baseline for testing.

37
New cards
What is the second important rule for Sqlmap URLs?

Surround the URL with quotes.

38
New cards
Why quote a URL containing & in a shell?

Otherwise the shell may interpret & instead of passing the full URL.

39
New cards
What does Sqlmap --dbs enumerate?

Available database names.

40
New cards
What does Sqlmap -D specify?

The database name to examine.

41
New cards
What does Sqlmap --tables display?

Tables in the selected database.

42
New cards
Which database in the example contains comments and users tables?

web_app.

43
New cards
What does Sqlmap -T specify?

The table name to examine.

44
New cards
What does Sqlmap --columns enumerate?

Column names and types in a selected table.

45
New cards
What does Sqlmap --dump do?

Retrieves and displays records from the selected table.

46
New cards
What does Sqlmap --sql-shell start?

An interactive SQL query interface for the target database.

47
New cards
Which options select a named database and table?

-D for database and -T for table.

48
New cards
What must be selected before enumerating columns?

The target database and table.

49
New cards
Does moving a SQL database to the cloud eliminate SQL injection?

No. Cloud databases can still be vulnerable.

50
New cards
What does ORM stand for?

Object Relational Mapping.

51
New cards
How can ORM frameworks help reduce SQL injection risk?

They abstract SQL query construction from application code.

52
New cards
Why can lightweight or serverless code reintroduce SQL injection?

Developers may build SQL strings directly rather than use safe abstractions.

53
New cards
Name two ORM frameworks mentioned in the book.

Hibernate and SQLAlchemy.

54
New cards
Why can SQL injection testing damage a system?

An injected statement may modify or delete production data.

55
New cards
What must be confirmed before a potentially destructive SQL injection test?

A tested and recoverable database backup.

56
New cards
What is dangerous about omitting WHERE from UPDATE?

The UPDATE may change every row in the table.

57
New cards
What does -- do in the SQL injection example?

Begins a comment that can suppress the remaining SQL text.

58
New cards
What makes a backup useful during SQL injection testing?

The team has verified it can restore the database.

59
New cards
What is the preferred coding defense against SQL injection?

Parameterized queries or prepared statements.

60
New cards
Why do parameterized queries stop SQL injection?

They keep input values separate from SQL statement structure.

61
New cards
What should developers avoid when constructing SQL queries?

String concatenation with untrusted input.

62
New cards
What is a WAF useful for in SQL injection defense?

Monitoring and partially blocking attack attempts.

63
New cards
Can a WAF alone reliably prevent SQL injection?

No. Secure application queries are still required.

64
New cards
What database privilege principle limits SQL injection impact?

Least privilege for the application database account.

65
New cards
What should database security logging watch for?

Failed SQL statements and SQL syntax errors.

66
New cards
Which two database platforms does the course identify as lacking some error logging?

MySQL and MariaDB.

67
New cards
Is filtering dangerous characters the preferred SQL injection defense?

No. Parameterized queries are preferred.

68
New cards
What does ? represent in the Java prepared-statement example?

A parameter placeholder bound to a value.

69
New cards
Which Java method prepares a parameterized SQL query?

prepareStatement().

70
New cards
Which Java method supplies the username parameter in the sample?

setString(1, customer).

71
New cards
What is the central lesson of the SQL injection visual summary?

Untrusted input must not control SQL query syntax.

72
New cards
What is the main cloud SQL security takeaway?

Cloud hosting does not replace safe query design.