LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2008, 05:56 AM   #1
Malcome_thompson
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
Help. i use php/mysql, and someone is using mysql injections to hack my site


Hello,

I currently use php, and mysql. If there is anyone here with php and mysql knowledge, and can help, i would greatly appreciate it.

Basically, someone is hacking my site using mysql injections in form boxes, ie, places where they would input their email address, or password, they are putting in mysql injections instead. Can anyone help with this?

Tks
 
Old 08-16-2008, 10:09 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
have you looked here: http://ca.php.net/manual/en/security...-injection.php
 
Old 08-16-2008, 10:17 AM   #3
raconteur
Member
 
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 44
It is difficult to be specific with the given info, but here are general instructions about how to help prevent sql injection attacks:

http://www.codeproject.com/KB/databa...onAttacks.aspx

The article is not linux-specific, but sql is sql and the methods are sound.
 
Old 08-16-2008, 07:43 PM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Read this thread:
http://www.linuxquestions.org/questi...curity-521792/

Basically, you need to validate ALL input on your forms. The email field should contain ONLY data that matches the email format, and you should automatically kick out anything that looks like html or doesn't fit the email profile.

All other fields in your form should be checked for SQL syntax, or for HTML tags, or anything else that doesn't need to be there.

Your fields' string lengths should be limited to something adequate and sensible, but not long enough to permit injection.

You might want to run stripslashes to get rid of backslashes used to escape codes being entered.

It isn't that hard to secure against sql injection, but you need to validate every single field on your form.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
php-mysql dependancy problem after nitemare mysql upgrade. RHEL4 andrewc Red Hat 1 01-03-2006 04:16 PM
php4 mysql, installation, php-pages with mysql info stay empty dnla Linux - Software 2 03-14-2004 02:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration