Truncate

Keep it clean but fun.
jpoisson
Posts: 245
Joined: Sun Aug 02, 2009 5:12 pm

Truncate

Post by jpoisson »

Today was the first day in about a month I looked into one of my games DB's for the users. I noticed several times that a user tried to create a user account and tried to Truncate the users table. I almost laughed so hard because of all these different tries. I guess I did my job quite well. :P

Just thought i would share that with everyone. but it did show me one flaw that I will work on by adding specific characters to the blacklist of banned user names.
Laguages:
PHP, MYSQL, (X)HTML, HTML5, JQuery, CSS 3.0,
C, C#, C++, Python, Pascal, Perl, Ruby, Turing

Software:
Adobe MC CS4, Visual Studio 2008, Notepad++,
NetBeans IDE, WAMPSERVER

Browsers:
Internet Explorer, Firefox, Opera, Safari, Chrome
(Always have latest patches for browsers.)

Free time:
...
User avatar
MAruz
Posts: 117
Joined: Fri Nov 20, 2009 12:31 pm

Re: Truncate

Post by MAruz »

Hm, this is one issue I've not heard about. Could you share some more details on how to protect against it, how to recognize it etc?
PHP, Java, JavaScript, HTML, CSS, XML, MySQL / Oracle
Photoshop, Illustrator
www.cuddly-zombie.com
jpoisson
Posts: 245
Joined: Sun Aug 02, 2009 5:12 pm

Re: Truncate

Post by jpoisson »

The term is SQLinjection.
http://en.wikipedia.org/wiki/SQL_injection
http://unixwiz.net/techtips/sql-injection.html

Code: Select all

mysql_real_escape_string()

that is probably your biggest asset against sql-injection.

edit -
If you ever have all your databases delete randomly it is probably that you didn't use mysql_real_escape_string or didn't serialize your user inputted variables properly, which allowed them to access your database directly.
Last edited by jpoisson on Sat Feb 20, 2010 12:57 pm, edited 1 time in total.
User avatar
MAruz
Posts: 117
Joined: Fri Nov 20, 2009 12:31 pm

Re: Truncate

Post by MAruz »

Ah ok, then I know what you mean.
PHP, Java, JavaScript, HTML, CSS, XML, MySQL / Oracle
Photoshop, Illustrator
www.cuddly-zombie.com
jpoisson
Posts: 245
Joined: Sun Aug 02, 2009 5:12 pm

Re: Truncate

Post by jpoisson »

yea, I realized i was really descriptive in my original post, but in my defense I was tired and couldn't remember the term SQLInjection... *Looks at his feet in disappointment* :cry:
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Truncate

Post by hallsofvallhalla »

ah thanks for posting this. Yes little 12 year old dweebs start hacking this way. Its a poor excuse for hacking but they think they are kewl :)
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Truncate

Post by Jackolantern »

We often think of people trying to drop your tables, but there are much less noticeable problems that players can use SQL injection for. This page in the PHP manual outlines the problem near the bottom of the page in the examples. Basically, the user adds SQL code to skip the password check, so they can log in to anyone's account without it :shock:
The indelible lord of tl;dr
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Truncate

Post by OldRod »

So how could you tell he was doing this?

And how did your name change colors? :)
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Truncate

Post by hallsofvallhalla »

well i Have a wiki I setup ages ago for this site that I have done nothing with. Jp asked to work with it so I made him part of the wiki group. I need to change that color, its too bright :) but anyways he is going to work with the wiki for the site.
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Truncate

Post by OldRod »

Ah, cool - not sure it's too bright, but it is almost invisible sometimes... depending on the background :)
Post Reply

Return to “Off-Topic”