SQL Injection Flashcards

1
Q

Which of the following system table does MS SQL Server database use to store metadata? Hackers can use this system table to acquire database schema information to further compromise the database.

sysobjects
sysrows
sysdbs
syscells

A

sysobjects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is the most effective technique in identifying vulnerabilities or flaws in the web page code?

Traffic analysis
Code analysis
Data analysis
Packet analysis

A

Code analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Identify the reason why Web Applications are vulnerable to SQL injection attacks.

Tests the content of string variables and accepts only expected values.
Reject entries that contain binary data, escape sequences, and comment characters.
Error messages reveal important information
Avoid constructing dynamic SQL with concatenated input values.

A

Error messages reveal important information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In which of the following attacks does an attacker pose a true or false question to an database to determine whether an application is vulnerable to SQL injection?

Union SQL injection
Error-based SQL injection
Blind SQL injection
In-band SQL injection

A

Blind SQL Injection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a piggybacked query?

A

A piggybacked query is when an attacker injects an additional malicious query into an original query to make the DBMS execute multiple SQL queries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a tautology?

A

In a tautology-based SQL injection attack, an attacker uses a conditional OR clause such that the condition of the WHERE clause will always be true. Such an attack can be used to bypass user authentication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an illegal/logically incorrect query?

A

An illegal or logically incorrect query is one an attacker uses to glean information from the error message the server provides in response to the query.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a UNION SQL injection?

A

A union sql injection injects a union clause to a sql statement, along with a select null statement (starting with 1 null, and incrementing from there). This can be used to determine the table’s column count.

Alternatively, you can inject ORDER BY 1 to sort by the first column, 2 for the second, etc. to determine column count.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you delay for a given amount of time in MySQL?

A

sleep()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What’s the wildcard character in most SQL dialects?

A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What function do you use in MySQL to obscure characters instead of using a string literal?

A

CHAR(int)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the concatenation operator in SQLite?

A

||

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the concatenation operator in Oracle?

A

||

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the concatenation operator in Access?

A

&

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the concatenation operator in PostgreSQL

A

||

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the concatenation operator in MySQL?

A

concat(,)

17
Q

Which system table contains database objects in Access?

A

msysobjects

18
Q

Which function can be used by an attacker to link a target MSSQL server’s database to the attacker’s own machine and retrieve data from the target SQL server database?

A

An SQL Server can be linked back to an attacker’s DB via OPENROWSET

19
Q

Which DB2 query allows an attacker to perform column enumeration on a target database?

A

select * from syscat.columns where tabname=’tablename’;

20
Q

In MSSQL, how do you perform a column enumeration on a table?

A

SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name = ‘tablename’);