Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 01:55

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

Advertisement



Hello guys I am asking for those expert this

Discussion on Hello guys I am asking for those expert this within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
marlyandedsel's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 343
Received Thanks: 21
Hello guys I am asking for those expert this

Can you do or check the following php script if this scrip is vulnerable of sql injection please, and can you recommend us the right way or some sample on how to to this, I am really suck at PHP scripting.

PHP Code:
<?php        

function madSafety($string) {
 
$string stripslashes($string);
 
$string strip_tags($string);
 
$string mysql_real_escape_string($string);
 return 
$string;
 }

# was there a reCAPTCHA response?

        

if(isset($_POST['submits'])) 
{
    
$conn mysql_connect("localhost""root""password");
    
$db mysql_select_db("database");
    
mysql_select_db($accdb);
    
$username=$_POST['name'];
    
$password=$_POST['pass'];
    
$email=$_POST["email"];
    
$ip $_SERVER['REMOTE_ADDR'];

    
$username madSafety($username);
    
$password madSafety($password);
    
$email madSafety($email);

    
$AllRight True;

    require_once(
'recaptchalib.php');

    
// Get a key from https://www.google.com/recaptcha/admin/create
    
$publickey "6Ld339MSAAAAAHNQMGcQ35VZW18fqm4iUk5fVIJe";
    
$privatekey "6Ld339MSAAAAAEjMoKlss8CJAO_sSURNPm97YZdj";

    
# the response from reCAPTCHA
    
$resp null;
    
# the error code from reCAPTCHA, if any
    
$error null;

    
$resp recaptcha_check_answer ($privatekey,
                                   
$_SERVER["REMOTE_ADDR"],
                                   
$_POST["recaptcha_challenge_field"],
                                   
$_POST["recaptcha_response_field"]);

    if (
$resp->is_valid
    {
        
$AllRight True;
    } 
    else 
    {
       
# set the error code so that we can display it
       
$error "<tr><FONT COLOR='#0000FF'><FONT SIZE='3'><center>".$resp->error."</center></FONT></FONT></p>";
       print 
"<center>You provided an invalid security code</center>";        
       
$AllRight False;
    }
    if(!
$username) { print("<center>Account ID Field Empty!</center>");  $AllRight False; }
    else 
        if(!
$pass]) { print("Password Field Empty!");   $AllRight False;}
        else 
            if(!
$pass2]) { print("Confirm Password Field Empty!");   $AllRight False;}
            else 
                if(!
$email]) { print("E-mail Address Field Empty!");   $AllRight False;}
                else 
                    if(!
ereg("^[0-9a-z]{4,12}$",$username)) { print("AccountID only letters from \"a\" to \"z\" and numbers, length of 4 to 12 characters");  $AllRight False; }
                    else 
                        if(!
ereg("^[0-9a-z]{4,14}$",$password)) { print("Password only letters from \"a\" to \"z\" and numbers, length of 4 to 14 characters");   $AllRight False;}
                        else
                            if(
$_POST["pass"]!=$_POST["pass2"]) { print("Passwords do not match!");  $AllRight False; }    
                            else 
                                
$check mysql_query("SELECT * FROM accounts WHERE Username = '".$username."'");
                                if(
mysql_num_rows($check) != '0'
                                {
                                    echo
"<center><FONT COLOR='white'>Username <i>'".$username."'</i> is already registered, please use another name.</FONT></center>";
                                }
                                else
                                {                     
                                    
mysql_query('INSERT INTO accounts(Username,Password,Email) VALUES ("'.$username.'","'.$password.'","'.$email.'")') or die(mysql_error());                         
                                    echo 
"<center><FONT COLOR='white'>Registered Successfully</FONT></center>";
                                }
                    
mysql_close($conn);
}
?>
Thank You in advance
marlyandedsel is offline  
Old 09/11/2012, 07:08   #2
 
JohnHeatz's Avatar
 
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,981
Would've been good to post this as a follow-up on your already existing thread:



I am not a "pro" when it comes to security, yet I don't see (after checking the code briefly) any vulnerabilities, yet I might be mistaken as it is sort of late for me right now, so just wait for some more people to check on it
JohnHeatz is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
AD Expert
01/17/2012 - Metin2 - 9 Replies
Hallo Leute, ich hatte die Idee, dass ich AD Expert farmen gehen möchte. Aber ist das sinvoll? Droppt man da viele PMs? Mit DD farmen? Und ab welchem Level kann ich dort leveln? Ich bin momentan 34 und habe folgendes EQ: Eisenhelm +7 VMS +9 36DSS Todesstoß +3 Durchbruch +3 Schlachti +7 SAB +6 Ebis +5 Lederschuhe +2 2k TP
Ad-Expert
01/03/2012 - Metin2 - 10 Replies
Ad-Expert? Moin Jungs & Mädchen, Ich möchte im Ad-Expert farmen & wollte fragen ob ihr denkt ob Meine Skills, Buffs und das Eq dazu ausreichen. ( lv 54 ) Equipment: Dpp+9 1,5k tp, 5TP-abso, 2 Reflektieren ( :D ) ( Hast & Schutz+3 ) Schuhe 1,5k tp, 2 krit, 3 verlangsamung Kette 1k tp, 10 db, 10 Pfeildeff Ebis+7
Regarding GC Expert
06/25/2011 - Grand Chase - 2 Replies
Im using Grand Chase Philippines Client to patch the Gc Expert and when i finish patching i got an error from GameGuard.. can anyone help me in this problem?
Need expert help
08/20/2008 - Cabal Online - 0 Replies
any body here a good hacker in region of Baguio or La Union just pm me need your help thanks



All times are GMT +1. The time now is 02:01.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.