Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Dekaron > Dekaron Private Server
You last visited: Today at 19:03

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

Advertisement



Database (help) :(

Discussion on Database (help) :( within the Dekaron Private Server forum part of the Dekaron category.

Reply
 
Old   #1
 
Nosferatu.'s Avatar
 
elite*gold: 22
Join Date: Jan 2008
Posts: 743
Received Thanks: 450
Database (help) :(

Hello Dudes

I got a Problem , my Character database was Droped by a SQL Injection (i think) and i dont want open anymore cuz it is not command there to stop such attacks.


i was looking for a comand like

mysql_escape_string()
mysql_real_escape_string()

for MSSQL but i didnt found it.

Can some one give me a Tip to handle it?

BTW: My MSSQL Port is Closed for Public
Nosferatu. is offline  
Old 01/26/2010, 07:11   #2
 
elite*gold: 0
Join Date: Feb 2009
Posts: 11
Received Thanks: 0
Hello Darnus i see your post and i try to finde something to help you idk i finde something good and work to you ....i give you a link i hope will be good :P
luck94jc is offline  
Old 01/26/2010, 07:17   #3
 
janvier123's Avatar
 
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
This is a real simple one. Was on IRC the other day and someone was trying to use mysql_escape_string() when trying to submit to a mssql database. So I wrote up this quick function so he could use it. although it's probably just easier to do this without a function, it's easier for some people to have it work just like mysql_escape_string().

PHP Code:
<?php
function mssql_escape_string($string_to_escape) {
$replaced_string str_replace("'","''",$string_to_escape);
return 
$replaced_string;
}
?>
janvier123 is offline  
Thanks
2 Users
Old 01/26/2010, 07:17   #4
 
elite*gold: 0
Join Date: Feb 2009
Posts: 11
Received Thanks: 0
.... SQL injection - Wikipedia, the free encyclopedia i never see a error like your...
luck94jc is offline  
Old 01/26/2010, 07:30   #5
 
Nosferatu.'s Avatar
 
elite*gold: 22
Join Date: Jan 2008
Posts: 743
Received Thanks: 450
Quote:
Originally Posted by luck94jc View Post
.... SQL injection - Wikipedia, the free encyclopedia i never see a error like your...
Yours is mysql i cant use mysql with mssql for my page i use alrddy this function

$questions = "SELECT * FROM _userdb WHERE username LIKE '".mysql_real_escape_string(addslashes($username)) ."' LIMIT 1";

But i need this function like janvier's

Janvier, i have to need add more ways like this?

$replaced_string = str_replace("'","''",$string_to_escape);
$replaced_string = str_replace(";","",$string_to_escape);

Edit: ok, i searched again in google and found it :

PHP Code:

// Begin
/*
    The muonline xweb base injection filter script
        Mssql Injection Filter, Includes arrays
-----------------------------------------------------------------
           Changelog: mu.vachev.net?mod=xweb
*/

function xw_sanitycheck($str){
    if(
strpos(str_replace("''","",$str"),"'")!=false)
        return 
str_replace("'""''"$str);
    else
        return 
$str;
}

function 
secure($str){
    
// Case of an array
    
if (is_array($str)) {
        foreach(
$str AS $id => $value) {
            
$str[$id] = secure($value);
        }
    }
    else
        
$str xw_sanitycheck($str);

    return 
$str;
}

// Get Filter
$xweb_AI    array_keys($_GET);
$i=0;
while(
$i<count($xweb_AI)) {
    
$_GET[$xweb_AI[$i]]=secure($_GET[$xweb_AI[$i]]);
    
$i++;
}
unset(
$xweb_AI);

// Request Filter
$xweb_AI    array_keys($_REQUEST);
$i=0;
while(
$i<count($xweb_AI)) {
    
$_REQUEST[$xweb_AI[$i]]=secure($_REQUEST[$xweb_AI[$i]]);
    
$i++;
}
unset(
$xweb_AI);

// Post Filter
$xweb_AI    array_keys($_POST);
$i=0;
while(
$i<count($xweb_AI)) {
    
$_POST[$xweb_AI[$i]]=secure($_POST[$xweb_AI[$i]]);
    
$i++;
}

// Cookie Filter (do we have a login system?)
$xweb_AI    array_keys($_COOKIE);
$i=0;
while(
$i<count($xweb_AI)) {
    
$_COOKIE[$xweb_AI[$i]]=secure($_COOKIE[$xweb_AI[$i]]);
    
$i++;
}
// End 
10000 thanks to janvier !!!
Nosferatu. is offline  
Old 01/26/2010, 08:59   #6
 
janvier123's Avatar
 
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
easypeezy

PHP Code:
            $ready_msg preg_replace("{ACCOUNTNAME}",$row1[1],"The Account ACCOUNTNAME were successfully COINSGIVE added and COINSTAKE deducted.<br>This is the new stand Coins COINSTOTAL.</center>");
            
$ready_msg preg_replace("{COINSGIVE}",$_POST['coins_p'],$ready_msg);
            
$ready_msg preg_replace("{COINSTAKE}",$_POST['coins_m'],$ready_msg);
            
$ready_msg preg_replace("{COINSTOTAL}",$new_coins,$ready_msg); 
janvier123 is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Database
01/06/2010 - Metin2 Private Server - 12 Replies
Hey liebe Com!!! kann mir eienr nen link schicken für die metin2 database wäre echt nett :handsdown::handsdown:
DataBase
10/16/2009 - Metin2 Private Server - 11 Replies
Hallo Leuts Ich habe ein Problem, ich suche schon seite einem Tag und finde die DB nicht. Und meine frage ist : hat einer einen LInk um die db downzuloaden?? Sorry das ich jetzt ein neues Thema erstellt habe , aber ich kamm wirklich nicht weiter.
new database
10/16/2009 - Metin2 Private Server - 7 Replies
N'abend also ich habe da mal eine frage. Es war ja mal so dass die clubmt2 datenbank mal "gehackt" worden ist und zum download bereit stand. ich hätte sie gerne doch ich finde nichts ordentliches mit der sufu und google. wenn sie jemand noch hat pls pn me. mfg greivel
Help me with database.
07/13/2009 - CO2 Private Server - 5 Replies
:handsdown:I can't register my friends on my server because> database doesn't work?To say simple i can't create a new account. Someone please help me with this problem.TY:)
Database..
05/11/2008 - EO PServer Hosting - 2 Replies
Im having a problem with my database, it doesnt "update". I mean that when someone hatches a new eud, I'll go to find it in the database and it wont be there. Sometimes it'll turn up after an hour, sometimes a day and sometimes not at all. This doesnt just happen with eudemon, it happens with items too. Say I want to edit an item, Ill go to cq_itemtype, search for the item and it wont find it or sometimes it will find only half of them items, like boots, bracelet, neckalce, armor and weapon...



All times are GMT +2. The time now is 19:03.


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.