Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya
You last visited: Today at 16:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



SQL Injection Fix (HELP)

Discussion on SQL Injection Fix (HELP) within the Shaiya forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2018
Posts: 123
Received Thanks: 15
SQL Injection Fix (HELP)

Anyone know a fix of SQL DDOS attack, where DB gets deleted without a trace in logs?
bmfuxia is offline  
Old 11/09/2018, 19:47   #2

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 849
Received Thanks: 407
Hi,
DDOS (Disturbed Denial Of Service) has nothing todo with deleted databases.
Maybe you are using PHP-Files with unescaped user input.
To find a fix you need to find out how to escape or post your files here.

Regards
{Skrillex} is offline  
Old 11/12/2018, 16:29   #3
 
nephren's Avatar
 
elite*gold: 92
Join Date: Aug 2009
Posts: 731
Received Thanks: 971
Exactly. DDoS as mentioned comes from more than 1 machine, who sending a lot of requests until your Server cannot handle it anymore.

A deleted Database comes from SQL Injection, where at least 1 vulnerable code allows a Attacker to bypass your credentials or leak them and connect or delete.


SQL = Malicious Code Snippets
DDoS = Attack trough requests with Network
nephren is offline  
Thanks
2 Users
Old 11/12/2018, 17:00   #4
 
elite*gold: 0
Join Date: Oct 2018
Posts: 123
Received Thanks: 15
thanks for clarrying guys
bmfuxia is offline  
Old 11/18/2018, 09:47   #5

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 849
Received Thanks: 407
Stop making ads for another forum.

Now i tell how to fix SQL-Injection

First of all you need to put the escape function into a PHP File which is includet into all of your scripts. Best way is the php file where your database connection is.

Escape Function:
Code:
function ms_escape($data) { 
	if(!isset($data) or empty($data)) return '';
	if(is_numeric($data)) return $data;
	$non_displayables = array(
		'/%0[0-8bcef]/',			// url encoded 00-08, 11, 12, 14, 15
		'/%1[0-9a-f]/',				// url encoded 16-31
		'/[\x00-\x08]/',			// 00-08
		'/\x0b/',					// 11
		'/\x0c/',					// 12
		'/[\x0e-\x1f]/'				// 14-31
	);
	foreach($non_displayables as $regex)
		$data = preg_replace($regex,'',$data);
		$data = str_replace("'","''",$data);
	return $data;
}
Know you are able to use escape functon.

Now an example.

Code:
"SELECT* FROM [PS_UserData].[dbo].[Users_Master] WHERE [UserID] = $_POST['userid'];"
With this query a "hacker" is able to inject some bad code.

The fixxed way should be like this:
Code:
$userid = ms_escape($_POST['userid']);
Code:
"SELECT* FROM [PS_UserData].[dbo].[Users_Master] WHERE [UserID] = $UserID;"
I know that the SQL-Querys which i postet have a syntax error. With a bit of PHP experience you should be able to fix it.

Regards
{Skrillex} is offline  
Thanks
1 User
Old 12/04/2018, 20:23   #6

 
elite*gold: 150
Join Date: Apr 2007
Posts: 2,372
Received Thanks: 6,628
Also be sure your PS Login has the Injection Exploit on Loginpacket fixed
wurstbrot123 is offline  
Reply


Similar Threads Similar Threads
[FIX][C++] SQL Injection in Messenger and Guild
09/04/2016 - Metin2 PServer Guides & Strategies - 82 Replies
Hello, today there were attacks to several servers all using the same exploits. I will not further explain the method used to attack these servers. To fix it go to messenger_manager.cpp:
[04.09.13] GigaByte v2.6 [FIX, FIX, FIX, FIX AND FIX]
09/11/2013 - WarRock Hacks, Bots, Cheats & Exploits - 79 Replies
http://www.elitepvpers.com/forum/warrock-hacks-bot s-cheats-exploits/2843300-11-09-gigabyte-public-v2 -7-a.html



All times are GMT +2. The time now is 16:13.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.