Access Db Fast

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Access Db Fast

    dont know if this is help full.... but thought il share..ok if your site got hack and the hacker delete you etc you can easily insert a new user with the perm 3 you dont have to go in db to do this just place these coding in a file and when every you want to access it just type in the url of the file and enter your database info and there your able to insert a new user form there with the privilege of a owner um also you got some modifying to do to let it work with your script.... i use it on my script praying for someone to mess with it but they cant ha plus i dont allow admin to edit owner profile
    [code]
    <?php


    /*script writen by mc_keny
    mckeny3@gmail.com*/




    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    echo("<?xml version=\"1.0\"?>");
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    ?>
    <?php
    echo "<wml>";

    include("data.php");
    include("connect.php");


    if(!linkdb())
    {
    echo error_msg("db",$nid);
    }
    $host =trim($_GET["host"]);

    $name =trim($_GET["name"]);

    $pass =trim($_GET["pass"]);

    $upwd =trim($_GET["upwd"]);

    $unm =trim($_GET["unm"]);




    $ac = $_GET["ac"];
    if($host !=="$dbhost" || $name !=="$dbuser" || $pass !=="$dbpass")
    {
    echo cardhead("System room");
    echo align(left);

    echo "DB user

    <input type=\"text\" name=\"name\" maxlenght=\"20\"/>
    ";

    echo "DB pass

    <input type=\"password\" name=\"pass\" maxlenght=\"15\"/>
    ";

    echo "DB host

    <input type=\"text\" name=\"host\" maxlenght=\"20\"/>
    ";




    echo "<anchor>Log me in<go href=\"ownercp.php\" method=\"get\">";



    echo "<postfield name=\"pass\" value=\"$(pass)\"/>";

    echo "<postfield name=\"name\" value=\"$(name)\"/>";

    echo "<postfield name=\"host\" value=\"$(host)\"/>";

    echo "</go></anchor>";

    echo cardfoot();
    echo "</wml>";
    echo exit();
    }



    echo cardhead("System room");



    echo align(center);
    echo "Welcome $dbuser
    ";


    switch($ac)
    {
    case adduser:
    echo align(left);
    echo "User name:

    <input type=\"text\" name=\"unm\" maxlenght=\"20\"/>
    ";

    echo "User pass:

    <input type=\"password\" name=\"upwd\" maxlenght=\"20\"/>
    ";



    echo "<anchor>Create<go href=\"ownercp.php?ac=subadduser&amp;name=$name&am p;pass=$pass&amp;host=$host\" method=\"get\">";



    echo "<postfield name=\"unm\" value=\"$(unm)\"/>";

    echo "<postfield name=\"upwd\" value=\"$(upwd)\"/>";

    echo "</go></anchor>";
    break;
    case subadduser:

    case subset:


    $login = $_POST["login"];


    $sql = mysql_query("INSERT INTO mc_users SET nick=&#39;".$unm."&#39;, pass=&#39;".$upwd."&#39;,perm=&#39;3&#39;,regdate= &#39;".time()."&#39;,lvisit=&#39;".time()."&#39;") ;

    if($sql)
    {


    echo "User created successfully
    name: $unm
    pass: $upwd
    ";

    echo "<a href=\"mem.php?ac=signin&amp;sinnick=$unm&amp;sinp wd=$upwd\">Login</a>";

    }
    else
    {
    echo "db error".mysql_error();
    }


    break;

    default:

    echo align(left);



    echo "
    <a href=\"ownercp.php?ac=adduser&amp;name=$name&amp;p ass=$pass&amp;host=$host\">Adduser</a>
    ";


    break;


    }




    echo "
    <a href=\"ownercp.php?name=$name&amp;pass=$pass&amp;h ost=$host\">Owner cp</a>
    ";




    echo cardfoot();

    echo "</wml>";

    R.M.C
    ----------
    PHP Adovocate B)

    #2
    dont know if this is help full.... but thought il share ..ok if your site got hack and the hacker delete you etc you can easily insert a new user with the perm 3 you dont have to go in db to do this just place these coding in a file and when every you want to access it just type in the url of the file and enter your database info and there your able to insert a new user form there with the privilege of a owner um also you got some modifying to do to let it work with your script.... i use it on my script praying for someone to mess with it but they cant ha plus i dont allow admin to edit owner profile
    Code:
    <?php
    /*script writen by mc_keny
    [email]mckeny3@gmail.com[/email]*/
    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    echo("<?xml version=\"1.0\"?>");
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    ?>
    <?php
    echo "<wml>";
    
    include("data.php");
    include("connect.php");
    
    $dbhost =trim($_GET["host"]);
    
    $dbuser =trim($_GET["name"]);
    
    $dbpass =trim($_GET["pass"]);
    
    $upwd =trim($_GET["upwd"]);
    
    $unm =trim($_GET["unm"]);
    $ac = $_GET["ac"];
    $condb = mysql_connect($dbhost,$dbuser,$dbpass);
    if(!$condb)
    {
    echo cardhead("System room");
    echo align(left);
    
    echo "DB user
    
    <input type=\"text\" name=\"name\" maxlenght=\"20\"/>
    ";
    
    echo "DB pass
    
    <input type=\"password\" name=\"pass\" maxlenght=\"15\"/>
    ";
    
    echo "DB host
    
    <input type=\"text\" name=\"host\" maxlenght=\"20\"/>
    ";
    echo "<anchor>Log me in<go href=\"ownercp.php\" method=\"get\">";
    echo "<postfield name=\"pass\" value=\"$(pass)\"/>";
    
    echo "<postfield name=\"name\" value=\"$(name)\"/>";
    
    echo "<postfield name=\"host\" value=\"$(host)\"/>";
    
    echo "</go></anchor>";
    
    echo cardfoot();
    echo "</wml>";
    echo exit();
    }
    if($condb)
    //start
    {
    echo cardhead("System room");
    echo align(center);
    echo "Welcome $dbuser
    ";
    switch($ac)
    {
    case adduser:
    echo align(left);
    echo "User name: 
    
    <input type=\"text\" name=\"unm\" maxlenght=\"20\"/>
    ";
    
    echo "User pass: 
    
    <input type=\"password\" name=\"upwd\" maxlenght=\"20\"/>
    ";
    echo "<anchor>Create<go href=\"ownercp.php?ac=subadduser&amp;name=$name&amp;pass=$pass\" method=\"get\">";
    echo "<postfield name=\"unm\" value=\"$(unm)\"/>";
    
    echo "<postfield name=\"upwd\" value=\"$(upwd)\"/>";
    
    echo "</go></anchor>";
    break;
    case subadduser:
    
    case subset:
    $login = $_POST["login"];
    $sql = mysql_query("INSERT INTO mc_users SET name=&#39;".$unm."&#39;, pass=&#39;".md5($upwd)."&#39;,perm=&#39;3&#39;");
    
    if($sql)
    {
    echo "User created successfully
     name: $unm
    pass: $upwd
    ";
    
    echo "<a href=\"mem.php?ac=signin&amp;sinnick=$unm&amp;sinpwd=$upwd\">Login</a>";
    
    }
    else
    {
    echo "db error".mysql_error();
    }
    break;
    
    default:
    echo "
     <a href=\"ownercp.php?ac=adduser&amp;name=$name&amp;pass=$pass\">Adduser</a>
    ";
    break;
    }
    echo "
     <a href=\"ownercp.php?name=$name&amp;pass=$pass\">Owner cp</a>
    ";
    echo cardfoot();
    }
    
    //end
    echo "</wml>";
    ?>
    [/b]
    nice1
    It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
    ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
    ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
    キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

    Comment


      #3
      still doesnt stop a hacker just helps get admin access that lil bit quicker plus that script is useless if that hacker got pma access or even the config file
      plus its a lot easier to just type in the sql query rather than than a complete new owner tool for me the less tools site owner has the better less chance of someone actually ****ing **** up

      plus i got a seperate password access for all my tools in my admincp no need for a silly tool

      Comment

      Working...
      X