zappsan
Mon 2nd Oct '06, 5:13pm
Well, I've been working on a script which is almost finished.
The only thing bothering me now is security.
For example, I've got lines like this in my script:
$query = mysql_query('SELECT * FROM news WHERE ID="'.$_GET['newsid'].'"')
I am aware that this is an insecure method and people could perform MySQL injection attacks easily.
How can I prevent this from happening?
I've searched Google of course and found a good amount of articles on this, but what I need is a simple method which doesn't reuire me to change much.
Wikipedia suggests the use of mysql_real_escape_string (http://en.wikipedia.org/wiki/SQL_Injection#Securing_applications_against_SQL_in jection).
Would using this be enough protection?
Also, does anybody know any free software which scans your script for risks like this?
I already found an XXS scanner and a scanner for both XXS and SQL injection possibilieties (but I didn't get that to work).
I'd be glad if someone could help me :)
The only thing bothering me now is security.
For example, I've got lines like this in my script:
$query = mysql_query('SELECT * FROM news WHERE ID="'.$_GET['newsid'].'"')
I am aware that this is an insecure method and people could perform MySQL injection attacks easily.
How can I prevent this from happening?
I've searched Google of course and found a good amount of articles on this, but what I need is a simple method which doesn't reuire me to change much.
Wikipedia suggests the use of mysql_real_escape_string (http://en.wikipedia.org/wiki/SQL_Injection#Securing_applications_against_SQL_in jection).
Would using this be enough protection?
Also, does anybody know any free software which scans your script for risks like this?
I already found an XXS scanner and a scanner for both XXS and SQL injection possibilieties (but I didn't get that to work).
I'd be glad if someone could help me :)