Chapter 9 - Database Security_up
Chapter 9 - Database Security_up
15/10/2024 2
1
15/10/2024
15/10/2024 3
2
15/10/2024
15/10/2024 5
15/10/2024 6
3
15/10/2024
15/10/2024 8
4
15/10/2024
15/10/2024 9
Insider Threats
Human Error
Database Vulnerabilities
SQL/NoSQL Injection Attacks
Buffer Overflow Attacks
Denial of Service (DoS/DDoS) Attacks
Malware
An Evolving IT Environment: trends can lead to new types of
attacks on databases
o Growing data volumes: must be highly scalable to address future reqs
o Distributed infrastructure: ex cloud => security solutions more difficult
o Increasingly tight regulatory requirements: become more challenging
o Cybersecurity skills shortage: more difficult to defend critical DB
15/10/2024 10
5
15/10/2024
Lock, Camera
15/10/2024 12
6
15/10/2024
15/10/2024 13
Authentication: DB, OS
Authorization
Access control
Auditing
15/10/2024 14
7
15/10/2024
Slide 30- 15
Slide 30- 16
8
15/10/2024
15/10/2024 17
Slide 30- 18
9
15/10/2024
10
15/10/2024
15/10/2024 21
Slide 30- 22
11
15/10/2024
Auditing
o track database activities and helps maintain compliance with
security standards by recording database events to an audit log.
o allow monitor ongoing database activities
o analyze and investigate historical activity to identify potential
threats or suspected abuse and security violations.
Threat detection:
o uncovers anomalous database activities that indicate a potential
security threat to the database
o can show information about suspicious events directly to the
administrator.
15/10/2024 24
12
15/10/2024
Data encryption
o it enhances security by limiting data loss when access controls
are bypassed.
Database backup data and recovery
o involves making backup copies of the database and log files on
a regular basis and storing the copies in a secure location.
o They are available to restore the database in the event of a
security breach or failure.
Security for web server applications and websites:
o Any application or web server that connects to the database
could be a target and should be subjected to periodic security
testing and best practices management.
Physical security
o limits access to the physical server and hardware components.
15/10/2024 25
15/10/2024 26
13
15/10/2024
Slide 30- 27
Slide 30- 28
14
15/10/2024
Slide 30- 29
● SQL Injection
● Inference attacks
15
15/10/2024
16
15/10/2024
17
15/10/2024
15/10/2024 36
18
15/10/2024
15/10/2024 37
19
15/10/2024
In cases where the results of an SQL query are returned within the
application's responses, an attacker can leverage an SQL injection
vulnerability to retrieve data from other tables within the database.
This is done using the UNION keyword, which lets you execute an
additional SELECT query and append the results to the original
query.
For example, if an application executes the following query
containing the user input "Gifts":
o SELECT name, description FROM products WHERE category = 'Gifts'
then an attacker can submit the input:
o ' UNION SELECT username, password FROM users--
This will cause the application to return all usernames and passwords
along with the names and descriptions of products.
15/10/2024 40
20
15/10/2024
15/10/2024 41
15/10/2024 42
21
15/10/2024
15/10/2024 43
22
15/10/2024
Detection
• Manual defensive • Check queries at
coding practices runtime to see if
• Signature based
• Parameterized they conform to a
query insertion • Anomaly based model of expected
• SQL DOM • Code analysis queries
Defensive Run-time
coding prevention
15/10/2024 45
23
15/10/2024
● Inference attacks:
● relates to database security
● is the process of performing authorized queries
and deducing unauthorized information from the
legitimate responses received.
● Problem:
● the combination of a number of data items is more
sensitive than the individual items,
● the combination of data items can be used to infer
data of a higher sensitivity
24
15/10/2024
Types of attack
o direct attack: aggregate computed over a small
sample so individual data items leaked
o indirect attack: combines several aggregates;
o tracker attack: type of indirect attack (very effective)
o linear system vulnerability: takes tracker attacks
further, using algebraic relations between query sets
to construct equations yielding desired information
25
15/10/2024
Direct Attack
o determine values of sensitive fields by seeking them directly with
queries that yield few records
o request LIST which is a union of 3 sets
LIST NAME where (SEX =M DRUGS = 1)
(SEX M SEX F) (DORM = Ayres)
• No dorm named Ayres , Sex either M or F
o “n items over k percent” rule helps prevent attack
26
15/10/2024
M 1 3 1 5
F 2 1 3 6
Total 3 4 4 11
2 inference techniques:
- analyzing functional
dependencies between
attributes within a table
or across tables,
27
15/10/2024
28
15/10/2024
Yes No
29
15/10/2024
15/10/2024 59
15/10/2024 60
30
15/10/2024
15/10/2024 61
frontend that transforms user queries an organization that receives the encrypted
into queries on the encrypted data data from a data owner and makes them
stored on the server available for distribution to clients
31
15/10/2024
1. DVWA
o Get important information in DVWA database such as: tables,
user/pass with different level: Low, Medium, High
2. Sqlmap:
o Get important information in DVWA database: tables, user/pass
with different level: Low, Medium, High
o Database from other website, ex:
• http://testphp.vulnweb.com
3. Other Tools:
o Hackbar (built-in web browser) -> vulnerable website.
15/10/2024 64
32