Re: HELP SQL INJECTION

From: Date: Fri, 10 Jul 2009 21:37:55 +0000
Subject: Re: HELP SQL INJECTION
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-295179@lists.php.net to get a copy of this message
Hi everyone, Hmmm i'm not sure it is an SQL Injection now, done a lot more checking and it is inserting code at the end of every index.htm index.html default.html and index.php pages on my site. Ooooh what fun :-) Chris On Fri, Jul 10, 2009 at 2:22 PM, Govinda<govinda.webdnatalk@gmail.com> wrote: > > On Jul 10, 2009, at 1:50 PM, Daniel Brown wrote: > >> On Fri, Jul 10, 2009 at 15:48, Chris Payne<chris_payne@danmangames.com> >> wrote: >>> >>> Hi everyone, >>> >>> My server appears to be the victim of a chinese hack-attack and I >>> believe they managed to change pages via SQL Injection, do any of you >>> have any ideas how to lock down my forms so MySQL cannot be used from >>> my forms? >> >>   First and foremost: >> >>       http://php.net/mysql_real_escape_string > > I am total newbie here, but I can say I would recommend getting a good PHP > book or at least reading some articles on preventing XSS attacks (if I said > that right)  and also SQL injection. > > for inserting data in to your db, use placeholders. > > for printing data coming from the db, use htmlentities() > > for retrieving data from your db via form/user input, use > mysql_real_escape_string and strtr() to escape SQL wildcards (%) and the _ > char. > > If I mis-guide the OP, please correct me! > > ------------ > Govinda > govinda.webdnatalk@gmail.com > >

« previous php.general (#295179) next »