Jump to content

SQL Injection?


phpmady

Recommended Posts

Hi Guys,

 

I have a website, where in the comment page, someone posting the unwanted messages in my comment box continiously.

 

i got nearly 400 rows of data, same kind of data,

how to stop that..in my comment for i have

 

Comment_Name

Comment_Email

Comment_Message

 

thanks,

 

 

 

 

 

 

Link to comment
Share on other sites

Thank you guys,

 

I am using mysql_real_escape_string as you peoples suggested, but how they peoples writing these kind of stuffs.

 

Actually comment_name, mailId is diffrent but comments contains the same data, that with link posted in that.

 

Thanks,

 

 

 

Link to comment
Share on other sites

A simple cURL script can post data to forms. It is actually absurdly easy. The reCaptcha solution is what you want to look into. This should stop most bots from spamming, but humans will still be able to spam at will.

 

As cyberRobot said, this is just spam, not injection.

Link to comment
Share on other sites

It's quite possible that the spammers screen scraped your form and are just sending junk via their own script. One way to prevent this (most of the time it works) is to put a hidden field in your form with a name that spammers would pick up on, something like "url" (if you're not using a name like that now) and leave the value blank. The spammers, not knowing that the value is supposed to be blank, with fill it with something, your processing script should then reject any post that has that field filled in.

 

Ken

Link to comment
Share on other sites

thanks kenrbnsn and presto, its really nice to  get inputs from you regarding the forms security, i mean captcha code, mysql_real_escape_string, and making the dummy variable to check.

 

vow everything is worthy i belive so

 

In my case, i believe spam is made, and not injection as you guys are said.

 

Thank you very much

Link to comment
Share on other sites

Hi,

 

Today once again in trouble, even after i user mysql_real_escape_string in my comment system,

 

I have attached the screenshot of my table content and comments posted in my site.

 

 

Thanks,

 

[attachment deleted by admin]

Link to comment
Share on other sites

Using mysql_real_escape_string will not prevent spam, it will only keep the nefarious people from harming your database. Using a captcha and/or dummy variables will help. Checking the referer to see if the posted data is coming from your form will also help. Also, since you are allowing people to post URLs, you probably want to implement an approval system where no comment is shown until you have approved it.

 

Ken

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.