MySQL Injection test

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
blaher
Forum Newbie
Posts: 3
Joined: Tue Oct 27, 2009 12:56 pm
Location: East Sparta, OH

MySQL Injection test

Post by blaher »

http://placeto.blahertech.net/admin/login.php - Live Sandbox Demo
http://placeto.svn.sourceforge.net/view ... iew=markup - line:78 current make safe function (both POST fields are sent through, before going in the a query)
http://placeto.svn.sourceforge.net/view ... unk/admin/ - The rest of the admin login system's source

I'm currently working on an admin for one of my projects. For now, I'm testing the security of the login.

Are there any tools out there I can run a pre-compiled list of php/mysql injection phrases? Or does anybody already see any faults that are in the login's security? I know you probably don't get this much, but I want someone to crack my login, so I can make sure there are no venerabilities.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: MySQL Injection test

Post by John Cartwright »

I've used http://sqlmap.sourceforge.net/ in the past with some success.
AlexC
Forum Commoner
Posts: 83
Joined: Mon May 22, 2006 10:03 am

Re: MySQL Injection test

Post by AlexC »

Why are you treating \r \t \n as unsafe chars? They are perfectly fine. Also, don't use htmlentities on your input like that; you do that when you want to output it, not store it. Same with strip tags, why did you let the user continue to submit this data if you ultimately don't want to allow it?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: MySQL Injection test

Post by John Cartwright »

How come your placeto_safe_html() method performs a mysql_real_escape_string(), whereas placeto_safe_sql() does not (which it should be reversed).

I also agree Alex's comments.
Post Reply