SQL Injection attacks

The recent attack on the Royal Navy site using SQL Injection techniques is a timely reminder to anyone still leaving their database unprotected.

The good news is you can quite easily reduce the risk of an injection attack. They take place when a site allows data input fields on a form access to basic SQL commands. By adding extra words to the end of a form input field SQL statements can be run in addition to the original designed statement. These commands can be quite simple for example, firstly select a list of tables, then select the data in the tables. As this operates at the database layer a connection has already been made by the software to the database so login details aren’t required.

There are simple functions that use basic escape mechanisms to protect the data input. The most common  is escaping the data, which may not be the strongest security measure. The input string is read and if the function finds certain characters it will ‘escape’ or add a ‘\’ character in front of the relevant character. There are still ways around this so to be safe the query to the database should be ‘parameterized’ that is the input string is broken up and selected parts are passed to the SQL query. Basic functions exist in most programming languages to do this task.

 Better yet, and good practice anyway, is to use stored procedures as these are totally parameterized. It isn’t particularly complicated, but it is a bit of a pain to do … if in doubt ask your web designer!

How safe is your phone?

After years of hacking, phishing and other malware in PC’s, the criminal fraternity has moved onto mobiles in a big way.

Using the same tools as we use for our modem development software it is poosible to create an app that steals your data.

http://www.bbc.co.uk/news/technology-10912376

The main reason for this is that there is one key difference between PC and mobile hacking. With a PC the user needs to be enticed to a web site to download something onto the PC. It might be a key logger or phishing scam that offers a tax return/lottery win etc. However, on a mobile the connection to your finances is already made as everything you do on a mobile has a charge.

This is the reason why mobiles are so at risk; your mobile could download an app that uses your credit to dial premium rate numbers and you won’t find out until your next bill. The ‘money’ already exists to be taken.

Moral of the story – Don’t buy illegal apps. It is said that up to 90% of certain apps on mobiles are illegal downloads – that is one vulnerability. Code can be inserted into current popular apps and then offered for free, with the extra code and none of the protection of purchasing from the legal supplier.