17 terms

sql injection Computerphile video

STUDY
PLAY

Terms in this set (...)

Purpose
Attacks websites
SQL
Language that talks to databases
Websites use databases
To send back personalised results to users
SELECT * FROM USERS
retrieves all information from the User database table
INSERT
Add new records
DELETE
Remove records
Tom"
An example of text that would produce a database error
SELECT * FROM USERS WHERE username = Tom
Finds records matching "Tom"
SELECT * FROM USERS WHERE username = Tom"
Creates an error in the database which can start an attack
DROP ALL DATABASES
Can be added into a attack to remove all databases
SELECT * FROM USERS WHERE username = Tom" ; DROP ALL DATABASES
Triggers an error, causing an attack and then deletes the databases
Escaping
Adding in / (slashes) to make the data form safe from SQL attack as the commands are not run
PHP
Used on websites to add in functionality eg web search forms
SQL injection attack
Allows maliciously coded search queries to trigger: editing, deleting, reading of data from an online SQL database
PHP security
It is easy to make mistakes in programming the search features of a website and therefore allow a malicious user to run a SQL injection attack
Prepared statements
The preferred way to protect a SQL database, it stops the input from running as code.
1 =1
would trigger an SQL injection attack on a vulnerable system as 1 = 1 true which would try to retrieve all records from a database