Skip to main content

Other ways to detect an SQL Injection attack ( Honey Data )

Fake Data (Honey Data)


By using honey data , it could help to identify attacks that are not triggered by error messages. 


Honey data is data (e.g. Passwords, Credit card numbers,…) in tables which is never used by the application (Fake Ones). If someone from anywhere is accessing this kind of data , alert will be raised.

Creation a table or tables containing unused data with juicy names (e.g. PASSWORD, CREDITCARD, SALARY).  
Such interesting data is often the target of attackers.   

During the attack, attackers are often accessing the view ALL_TAB_COLUMNS (Oracle) or INFORMATION_SCHEMA.COLUMNS (MySQL) to get the column names of interesting data.


Attackers are normally downloading the data of  interesting tables found via the column name in further attacks. 

You could monitor such an access and could react (send email, lock user, …).

Oracle can implement this monitoring via Virtual Private Database (VPD).

-- The script 

-- Create Honeytable 
create table app.userdata (username varchar2(30), password varchar2(30));
-- Fill Honey table with data 
insert into app.userdata values ('WEBUSER','WEBUSER01');
insert into app.userdata values ('WEBADM','ADMADM01');
insert into app.userdata values ('WEBREAD','READUSER01');
-- create predicate function 
create or replace function perfcheck (pv_schema in varchar2, pv_object in  varchar2)
return varchar2 as
 begin
dbms_output.put_line(‘Send email to the security team or lock the database user...');
-- return always true. Attacker will see all results 
    return '1=1';
end;
/
-- now we activate VPD for this table 
exec dbms_rls.add_policy(object_schema => ‘APP', object_name => ‘USERDATA',
policy_name => 'PERFCHECK', policy_function => 'PERFCHECK');

if Oracle solves it using VPD , 
how could it be implemented on MySQL ? A question needs to be answered.    

Comments

  1. It can be done using MySQL by :
    1- make a fake table like users_tb ,or permissions_tb with field (username , password , ....).
    2- when these tables are accessed , a trigger raised to put some data in another fake table (temp_tb).
    3- a small service reads from the temp_tb , if any data appears , it will alert the administrator, this means that there is an attempt to attack.

    ReplyDelete

Post a Comment

Popular posts from this blog

The Difference between DB and DB_EXTENDED

When doing Audit on any table on the the database , the default auditing is DB. SQL > show parameters audit_trail NAME                                 TYPE        VALUE ------------------------------------ ----------- ------------------------------ audit_trail                          string      DB in this case , when you do audit on some table. SQL> audit all on scott.emp by access; Audit succeeded SQL> update emp set sal=sal*0.95 where job='MANAGER'; 3 rows updated. if you want to know the statement made these changes, you will receive nothing on the sql_text field while you are selecting the audit_trial table.

Do you think , Google makes a mistake ?

It seems Google makes a new mistake by launching its new security key (2-step verification)  one of the steps is USB device .  The question  :how come can i plug USB into my mobile (I-Phone , I-Pad , Samsung Galaxy , ....) !  Do Google know the difficulties while you are holding a USB on your hand all the time .  so You can't access  your  account if it's not in your hands. or it's damaged ?  This solution is hopeless , I think it's designed for small audience. As someone says : Can you convince the Bank Manager while you are putting the USB Device into the bank PC, that you are securing your PC , not stealing the bank data, or not transferring amounts of money to other account . or what else .  You know , This way is not quietly good , If I have many accounts on Google and other websites ,I need many  USB devices to verify myself.  That's of course , not good at all.

Big lies makes you pay

It's about web security , but this article contains many lies that we are saying or thinking about  and never try to make sure that we are not going to fall in it. These lies about web security . 1- The Lock icon is lighting on , it's ok it's amazing that everyone looks for the lock int he browser bar to believe that this site so secure, it's a big lie . you are not safe .  the lock in the browser bar doesn't mean that you are fully secure , it's only the SSL , means that the data are transferred in secure way .  but the agent(Hacker) who get the info can use it easily. Note : some Hackers are very good at faking SSL certificate or buying one . 2- Website Reputation  It's not true that if you don't visit websites of ill repute , you are in all clear ,No No! Wrong answer.  more than 83% of malware hosting sites are trusted. 3- Don't underestimate the information in your computer . This is the most dangerous poin...