create account form menu

User Tag List

Results 1 to 12 of 12
  1. #1
    truekush's Avatar Corporal
    Reputation
    7
    Join Date
    Dec 2009
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    create account form

    i found this form in none working position and i edited it to make all errors go away and i also updated it so it would work for wotlk....
    this form is better then respora for people who create there own sites because it is easier to integrate it into the site.
    Code:
     <?php
    
    
    $realmd = array(
    'db_host'=> 'localhost', //ip of db realm
    'db_username' => 'user',//realm user
    'db_password' => '',//realm password
    'db_name'=> 'realmd',//realm db name
    );
    
    
    
    function check_for_symbols($string){
    $len=strlen($string);
    $alowed_chars="abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ";
    for($i=0;$i<$len;$i++)if(!strstr($alowed_chars,$string[$i]))return TRUE;
    return FALSE;
    
    }
    
    function sha_password($user,$pass){
    $user = strtoupper($user);
    $pass = strtoupper($pass);
    
    return SHA1($user.':'.$pass);
    }
    
    if (isset($_POST['registration'])){
    
    $realmd_bc_new_connect = mysql_connect($realmd['db_host'],$realmd['db_username'],$realmd['db_password']);
    $selectdb = mysql_select_db($realmd['db_name'],$realmd_bc_new_connect);
    if (!$realmd_bc_new_connect || !$selectdb){
    echo "Could NOT connect to db, please check the config part of the file!";
    die;
    }
    
    $username = $_POST['username'];
    $password = sha_password($username,$_POST['password']);
    
    $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
    
    if (check_for_symbols($_POST['password']) == TRUE || check_for_symbols($username) == TRUE || mysql_num_rows($qry_check_username) != 0){
    echo "Error with creating account, might already be in use or your username / password has invalid symbols in it.";
    }else{
    mysql_query("INSERT INTO account (username,sha_pass_hash,expansion) VALUES
    ('$username','$password','2')");// Insert into database.
    echo "Account created.";
    }
    
    
    }else{
    
    ?>
    
    
    <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
    Username <input type="text" name="username">
    
    Password <input type="password" name="password">
    
    <input type="submit" name="registration">
    </form>
    
    
    <?php
    // Do not remove this;)
    }
    ?>
    to use it just edit
    'db_host'=> 'localhost', //ip of db realm
    'db_username' => 'user',//realm user
    'db_password' => '',//realm password
    'db_name'=> 'realmd',//realm db name
    and insert into your website.

    create account form
  2. #2
    Xees's Avatar Contributor

    Reputation
    92
    Join Date
    Aug 2009
    Posts
    189
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there is a lot of this out there but , people could use a bit more , +Rep
    Doooooo+Repoooooooo+Repoooooood

  3. #3
    chocochaos's Avatar Member
    Reputation
    55
    Join Date
    Jul 2008
    Posts
    29
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd recommend everyone not to use this script, it's a huge security issue for your database.

    Take a look at those two lines:
    Code:
    $username = $_POST['username'];
    
    $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
    The username is put into the mysql query without any additional checks or escaping. Any characters can be put it it, and thus the actual query could be modified. For example, if I would enter the following as the username:
    Code:
    ' OR username != '
    I would still be able to register duplicates. This is just an innocent example. A security hole like this could potentially be used to read other people's account data or even wipe your whole account table.

    More information:
    - SQL injection - Wikipedia, the free encyclopedia

  4. #4
    Xees's Avatar Contributor

    Reputation
    92
    Join Date
    Aug 2009
    Posts
    189
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't got much expertise in php , XD thanks for pointing that out.
    Doooooo+Repoooooooo+Repoooooood

  5. #5
    Xees's Avatar Contributor

    Reputation
    92
    Join Date
    Aug 2009
    Posts
    189
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    forgot +Rep for u for the info
    Doooooo+Repoooooooo+Repoooooood

  6. #6
    truekush's Avatar Corporal
    Reputation
    7
    Join Date
    Dec 2009
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by chocochaos View Post
    I'd recommend everyone not to use this script, it's a huge security issue for your database.

    Take a look at those two lines:
    Code:
    $username = $_POST['username'];
    
    $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
    The username is put into the mysql query without any additional checks or escaping. Any characters can be put it it, and thus the actual query could be modified. For example, if I would enter the following as the username:
    Code:
    ' OR username != '
    I would still be able to register duplicates. This is just an innocent example. A security hole like this could potentially be used to read other people's account data or even wipe your whole account table.

    More information:
    - SQL injection - Wikipedia, the free encyclopedia
    Not true
    Code:
    check_for_symbols($username) == TRUE || mysql_num_rows($qry_check_username) != 0)
    even check my site WindFury WoW i have this create account page on there and try making a "truekush" account i guarantee u cant also there is a check so u can only use letters.



    Please before u try to put down any of my other posts.....check your facts first because it obviously shows that u cant add a username with spaces and ! or even =......i checked this script before i post it, so test it before u put it down.
    Last edited by truekush; 01-23-2010 at 01:09 AM.

  7. #7
    andross_01's Avatar Member
    Reputation
    5
    Join Date
    Apr 2008
    Posts
    28
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I submit the query it tries to take me to "my domain .com /%3C?php echo $_SERVER['PHP_SELF'] ?>"

    I dont know anything about PHP... how would i fix this?

  8. #8
    Wethers's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks may come in handy

  9. #9
    chocochaos's Avatar Member
    Reputation
    55
    Join Date
    Jul 2008
    Posts
    29
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by truekush View Post
    Not true
    Code:
    check_for_symbols($username) == TRUE || mysql_num_rows($qry_check_username) != 0)
    even check my site WindFury WoW i have this create account page on there and try making a "truekush" account i guarantee u cant also there is a check so u can only use letters.



    Please before u try to put down any of my other posts.....check your facts first because it obviously shows that u cant add a username with spaces and ! or even =......i checked this script before i post it, so test it before u put it down.
    That check is done after the first query. In
    Code:
    $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
    that check has not yet been done. Thus that query is potentially unsafe. Before you tell others they are wrong, you might want to learn what sql injection actually is and how to prevent it. Once again, check SQL injection - Wikipedia, the free encyclopedia for more info.


    On a side note, your server's website doesn't seem to load for me.
    Last edited by chocochaos; 02-08-2010 at 02:09 AM.

  10. #10
    truekush's Avatar Corporal
    Reputation
    7
    Join Date
    Dec 2009
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by chocochaos View Post
    That check is done after the first query. In
    Code:
    $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
    that check has not yet been done. Thus that query is potentially unsafe. Before you tell others they are wrong, you might want to learn what sql injection actually is and how to prevent it. Once again, check SQL injection - Wikipedia, the free encyclopedia for more info.


    On a side note, your server's website doesn't seem to load for me.
    actually i thought the same might be true when looking at it but then i relooked and even tried injecting it myself into my own site after it didnt work i released it and its even a sticky on the main mangos site now if there was a fault in this more then 1 person would be talking and believe me i always test my work when i release something.....if u feel it is wrong then go ahead and find somewhere to test it out but the server i posted before is gone now.

    if you still think im wrong then go ahead and test it on my own server
    http://bloodmist.uk.to/registration.php hell ill even make it easier on you....the accounts start at id 1 and end at 18.....go ahead do your worst!
    Last edited by truekush; 02-08-2010 at 02:45 AM.

  11. #11
    chocochaos's Avatar Member
    Reputation
    55
    Join Date
    Jul 2008
    Posts
    29
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not a hacker, and I can't abuse this bug to do more than trigger an sql error on servers without magic_quotes_gpc enabled. Leaving this open remains a potential risk though, and I'm sure an experienced hacker wouldn't have much trouble finding a way to abuse it in a worse way.
    Instead of saying it's no problem, why not just fix it? Especially when the fix is so simple.
    Code:
    function escape_unsafe_string($unescaped) {
    if (get_magic_quotes_gpc())
    return $unescaped;
    else
    return addslashes($unescaped);
    }
    
    $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='". escape_unsafe_string($username) ."'");
    There, done. No one will be able to do anything unwanted with that.

  12. #12
    truekush's Avatar Corporal
    Reputation
    7
    Join Date
    Dec 2009
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by chocochaos View Post
    I'm not a hacker, and I can't abuse this bug to do more than trigger an sql error on servers without magic_quotes_gpc enabled. Leaving this open remains a potential risk though, and I'm sure an experienced hacker wouldn't have much trouble finding a way to abuse it in a worse way.
    Instead of saying it's no problem, why not just fix it? Especially when the fix is so simple.
    Code:
    function escape_unsafe_string($unescaped) {
    if (get_magic_quotes_gpc())
    return $unescaped;
    else
    return addslashes($unescaped);
    }
    
    $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='". escape_unsafe_string($username) ."'");
    There, done. No one will be able to do anything unwanted with that.
    Well thank you for doing something about it your work is much appreciated!
    +Rep

Similar Threads

  1. Unable to create accounts for Ascent
    By towt in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 10-24-2007, 09:31 PM
  2. create account on private server
    By Lars44 in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 09-22-2007, 12:42 AM
  3. hamachi , how to create accounts?
    By baudtler in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 09-09-2007, 05:24 PM
  4. Help! Creatting accounts
    By Robob in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 09-08-2007, 08:34 AM
  5. Create Account With CD-Key, no payment required
    By kurtlesesh in forum World of Warcraft Exploits
    Replies: 19
    Last Post: 05-22-2007, 06:27 PM
All times are GMT -5. The time now is 12:56 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search