Tonight when googling for some "ready to use" RegEx expressions that would help fight sql injections, i found 3 very interesting articles about this topic:
1. Detection of SQL Injection and Cross-site Scripting Attacks
2. SQL Injection Walkthrough
3. SQL Injection Attacks by Example
Hope others will find this links useful too.

Categories
Recent Comments
- Query of Queries weirdness
Ed said: Ben, yes, it was brought to my attention when this was happening with a DB. I mean that getTMP was a... [More] - Query of Queries weirdness
Ben Nadel said: Ed, funky stuff. Query of queries can be very strange sometimes. I am curious, does the same thing h... [More] - Query of Queries weirdness
KC said: I have had a similar problem for a while, and I think it has something to do with the hyphen (-) bec... [More] - Query of Queries weirdness
Ed said: yes, QueryNew was used ONLY for problem illustration. At real there was a database table with varcha... [More] - Query of Queries weirdness
Brian Swartzfager said: Hi, Ed, I'm not sure if you used QueryNew simply to illustrate a problem you were having with a q... [More]
Calendar
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 |
Tags Cloud
1ssblog about adobe ajax another better: blogcfc caching cfemmys cffirewall cfhssf cfsqlmaster cfwatcher coldfusion community eurovision flex fun indexes knowing list moldova mssql my projects other over ria server sites sql
Adobe Feeds
- Flash Tutorial - Advanced full flash site - Part 1
- Create a Flash game like PixelField - part 2
- ColdFusion 8.01 Installation Minefield
- Position at Adobe : Work on the ConnectNow / Cocomo SDK Team
- ActionScript Hero.org invited to Flash On Tap 2008!
- Adobe MAX 2008 Plans Finalized
- Presentation: Filthy Rich [Flex] Clients
1ssBlog was created by Ed Tabara and is running version 1.1.



























In researching the Web for a solution for the problem, and a way to immunize our CF application against further attacks, we came across the CFQUERYPARAM solution, but our application has over 5000 files, each with one or more Queries and Stored Procedure calls. Implementing such a solution in such an extensive amount of files was impossible in a timely fashion, so I looked for another solution and came across a ColdFusion written function (isSqlInjection) that showed some promise but some shortcomings as well.
I wanted something that we could deploy fast and that would immunize the entire application in one single swoop.
As far as I understand, SQL injections can come from either FORM fields or from URL passed variables. Therefore we developed a function that was placed in our application.cfm and therefore used by all our CFM files. The function used a custom developed Regular Expression to check all URL and FORM fields for possible SQL Injections.
We were able to develop this in one day and implement it immediately. That same night we were able to catch and prevent 2 more SQL Injection attempts.
We have since improved the script and it now does the following:
? Checks all FORM and URL input for SQL injection code
? Interfaces (CFHTTP) with ARIN WHOIS Database Search (http://ws.arin.net/whois/) to get ISP information for the offender?s IP.
? Automatically sends an abuse report to the ISP concerning the attack.
? Displays a message informing the hacker that the attack was logged, that his/her ISP was contacted and that he/she is breaking the law
? Sends us an email with the SQL Injection string, IP address and other information.
? Stores the hacker?s IP address in an APPLICATION array (Black List).
o Each time a page in our application is requested, the IP address (CGI.REMOTE_ADDR) is compared with those in the Black List and if it is present, page execution is halted right at the application.cfm level returning a blank page to the browser
o Black List entries that are older than one hour are cleared by a scheduled task on an hourly basis.
We are making this code available to other CF developers for free. Please request a copy by email. luism@grouptraveltech.com.
If after receiving it you have suggestions or improvements, please send them my way as well.