28.10.2014 Views

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

370 Chapter 8 • Code-Level <strong>Defense</strong>s<br />

Table 8.8 Password in Different Languages<br />

Word for Password<br />

password, pwd, passw<br />

passwort, kennwort<br />

Motdepasse, mdp<br />

wachtwoord<br />

senha<br />

haslo<br />

Language<br />

English<br />

German<br />

French<br />

Dutch<br />

Portuguese<br />

Polish<br />

To make the attack more difficult, it could be a good idea to use an unobvious table<br />

<strong>and</strong> column name for saving password information. Although this technique will not stop<br />

an attacker from finding <strong>and</strong> accessing the data, it will ensure that the attacker will not be<br />

able to identify this information immediately.<br />

Setting Up Database Honeypots<br />

To become alerted if someone tries to read the passwords from the database, you could<br />

set up an additional honeypot table with a password column that contains fake data. If this<br />

fake data were selected, the administrator of the application would receive an e-mail. In<br />

Oracle, you could implement such a solution by using a virtual private database (VPD),<br />

as in the following example:<br />

-- create the honeypot table<br />

Create table app_user.tblusers (id number, name varchar2(30), password<br />

varchar2(30));<br />

-- create the policy function sending an e-mail to the administrator<br />

-- this function must be created in a different schema, e.g., secuser<br />

create or replace secuser.function get_cust_id<br />

(<br />

p_schema in varchar2,<br />

p_table in varchar2<br />

)<br />

return varchar2<br />

as<br />

v_connection UTL_SMTP.CONNECTION;<br />

begin<br />

v_connection := UTL_SMTP.OPEN_CONNECTION('mailhost.victim.com',25);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!