Section 18.172 SQL and XML Injections Flashcards

Objectives 2.2 Explain common threat vectors and attack strategies. Objectives 2.3 Explain various types of vulnerabilities Objectives 2.4 Given a scenario, you must be able to analyse indicators of malicious activity. Objectives 2.5 Explain the purpose of mitigation techniques used to secure the enterprise. Objectives 2.6 Given a scenario, you must be able to apply common security techniques to computing resources.

1
Q

Injection Attack

A

Involves sending malicious data to a system for unintended consequences

■ SQL injection and XML injection share the goal of inserting code into systems

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

SQL Data

A

Used to interact with databases

Four main SQL actions

Select: Used to read data from the database

Insert: Used to write data into the database

Delete: Used to remove data from the database

Update: Overwrite some data in the database

Example statement:
SELECT * FROM USERS WHERE userID = ‘Jason’ AND password = ‘pass123’;

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

Code Injection

A

The insertion of additional information or code through a data input form from a client to an application

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

SQL (Structured Query Language) Injection

SQL Injection

A

Involves inserting malicious SQL code into input fields

● Attackers use URL parameters, form fields, cookies, POST data, or HTTP
headers for SQL injection

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

SQL (Structured Query Language) Injection

Prevention

A

○ Input validation
○ Sanitise user data
○ Use a web application firewall

In the exam make sure you select Input Validation.

’ = (something) will always be an sql related aspect in the exam

anything to do with databases in the exam will be linked to SQL

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

SQL Injection Attempt

A

Involve statements like “ ‘ OR 1=1”

Original SQL statement: SELECT * FROM USERS WHERE userID = ‘Jason’ AND
password = ‘pass123’;

Injected SQL statement: SELECT * FROM Users WHERE userID = ‘Jason’ AND password = ‘’ OR 1=1;

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

XML (Extensible Markup Language) Injection

XML Data

A

Used by web applications for authentication, authorisation and other types of data exchange. XML data is submitted from the client to the server or from one server to another

● Should be sent within an encrypted tunnel, like TLS otherwise risk of snooping, spoofing, request forgery or injection of arbitrary code

● Input validation and sanitisation are crucial for server protection

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

XML data example

A

<?xml version=”1.0” encoding=”UTF-8”?>

<question>
<ID>SECURITY-002-0001</ID>
<title>Is this an XML vulnerability?</title> <choice1>Option 1</choice1> <choice2>Option 2</choice2>
</question>

If you go in to edit mode for this card you will see the xml data entry.

Just recognise that this is XML for the exam

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

XML Exploits

XML Bomb (Billion Laughs Attack)

A

Consumes memory exponentially, acting like a denial-of-service attack

XML code includes lol which can consume 3gb of memory

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

XML Exploits

XXE (XML External Entity) Attack

A

Attempts to read local resources, like password hashes in the shadow file

example:

<?xml version=”1.0” encoding=”UTF-8”?> <!DOCTYPE foo [
<!ELEMENT foo ANY>
<!ENTITY xxe SYSTEM “file:///etc/shadow”> ]>

<foo>Some data</foo>

see card in edit mode to see full example

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