View Single Post
Old 30.06.2005, 19:27   #2
HongK
Архивный участник
 
Join Date: Jun 2005
Posts: 258
Default Re: SQL Hacked, GM's Made, Fixes?

Quote:
Originally Posted by Eanae
Our SQL got hacked somehow. We believe it was an injection using the reg pages. The people made themselves GM's, and causes chaos all over the server. I've heard this has happened before. I banend their accounts, and added their IP bans to authD using the blockips.txt method, and took reg down temporarily. Is there any hard fix to this to stop hackers from getting control over our server?

Look at the damage caused here: http://www.mmj.pl/~perceptio/hack/
Are you using the basic SQL registration page that came with projectc2beta3? That asp package? If so, that's your problem...You gotta rewrite that to provide protection against SQL injection because it's WIDE open...Suggestions would be to write your reg page in php instead of asp...Also include something like this to prevent injection:

[php:1:03d1f9c685]function check_inject()
{
$badchars = array(";", "'", "\"", "*", "DROP", "SELECT", "UPDATE", "DELETE", "-");

foreach($_POST as $value)
{
if(in_array($value, $badchars))
{
die("SQL Injection Detected\n
\nIP: ".$_SERVER['REMOTE_ADDR']);
**
else
{
$check = preg_split("//", $value, -1, PREG_SPLIT_OFFSET_CAPTURE);
foreach($check as $char)
{
if(in_array($char, $badchars))
{
die("SQL Injection Detected\n
\nIP: ".$_SERVER['REMOTE_ADDR']);
**
**
**
**
** [/php:1:03d1f9c685]
HongK is offline