[PHP] List all passwords

Joined
Sep 10, 2006
Messages
1,243
Reaction score
184
This script shows you all the users from the Login table with their passwords.

**** PROTECT THE SCRIPT!!!!! ****

PHP:
<?php

$msconnect = mssql_connect("localhost","sa","");
$kalauth = 'kal_auth';
$msdb = mssql_select_db($kalauth, $msconnect);

function decode($password,$isBin=true) {
        if($isBin) {
            $password = bin2hex($password);
        }
        $encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E'
                      ,'\''=>'BB', '('=>'C0', ')'=>'7F','*'=>'18', '+'=>'70', ','=>'A6'
                      ,'-'=>'E2', '.'=>'EC', '/'=>'77','0'=>'2C', '1'=>'3A', '2'=>'4A'
                      ,'3'=>'91', '4'=>'5D', '5'=>'7A','6'=>'29', '7'=>'BC', '8'=>'6E'
                      ,'9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72'
                      ,'?'=>'9C','@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B'
                      ,'E'=>'50','F'=>'51', 'G'=>'6D', 'H'=>'E9','I'=>'9A', 'J'=>'B8'
                      ,'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE'
                      ,'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89'
                      ,'V'=>'7B', 'W'=>'A2', 'X'=>'AD','Y'=>'71', 'Z'=>'E3', '['=>'D5'
                      ,'\\'=>'BF', ']'=>'53', '^'=>'28','_'=>'44'
                      ,'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F'
                      ,'f'=>'94', 'g'=>'12', 'h'=>'73'
                      ,'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D'
                      ,'o'=>'7D','p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79'
                      ,'u'=>'0B','v'=>'D6', 'w'=>'23', 'x'=>'7C'
                      ,'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
        $encar = array_flip($encar);
        $newpass = '';
        for($i = 0; $i < strlen($password); $i+=2) {
            if(isset($encar[$password[$i]])) {
                $key = strtoupper($password[$i]);
            } else {
                $key = strtoupper($password[$i]) . strtoupper($password[($i+1)]);
            }
            $newpass .= $encar[$key];
        }
        return $newpass;
    }

    $plist = "SELECT * FROM Login order by [UID] desc";
    $pplist = mssql_query($plist);


    while($list = mssql_fetch_array($pplist)){
    echo $list['ID'];
echo " - ";
 echo decode($list['PWD']);
    echo "<br>";
    }
?>
**** PROTECT THE SCRIPT!!!!! ****

I'm not responsible for you putting this in a public folder.

Have fun
 
LOL... i had this... it was about 10folders in and still someone fond it. and used my acc to bug the GMS to get me online useing my test acc... xD, If your going to use this i say u shuld always remove one of the SQL parts to make it un-useabul untell you need it. like this one:

PHP:
<?php

// THIS MAKES IT SO THE SCRIPT CAN NOT CONNET TO YOUR DB.
//$msconnect = mssql_connect("localhost","sa","");
$kalauth = 'kal_auth';
$msdb = mssql_select_db($kalauth, $msconnect);

function decode($password,$isBin=true) {
        if($isBin) {
            $password = bin2hex($password);
        }
        $encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E'
                      ,'\''=>'BB', '('=>'C0', ')'=>'7F','*'=>'18', '+'=>'70', ','=>'A6'
                      ,'-'=>'E2', '.'=>'EC', '/'=>'77','0'=>'2C', '1'=>'3A', '2'=>'4A'
                      ,'3'=>'91', '4'=>'5D', '5'=>'7A','6'=>'29', '7'=>'BC', '8'=>'6E'
                      ,'9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72'
                      ,'?'=>'9C','@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B'
                      ,'E'=>'50','F'=>'51', 'G'=>'6D', 'H'=>'E9','I'=>'9A', 'J'=>'B8'
                      ,'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE'
                      ,'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89'
                      ,'V'=>'7B', 'W'=>'A2', 'X'=>'AD','Y'=>'71', 'Z'=>'E3', '['=>'D5'
                      ,'\\'=>'BF', ']'=>'53', '^'=>'28','_'=>'44'
                      ,'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F'
                      ,'f'=>'94', 'g'=>'12', 'h'=>'73'
                      ,'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D'
                      ,'o'=>'7D','p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79'
                      ,'u'=>'0B','v'=>'D6', 'w'=>'23', 'x'=>'7C'
                      ,'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
        $encar = array_flip($encar);
        $newpass = '';
        for($i = 0; $i < strlen($password); $i+=2) {
            if(isset($encar[$password[$i]])) {
                $key = strtoupper($password[$i]);
            } else {
                $key = strtoupper($password[$i]) . strtoupper($password[($i+1)]);
            }
            $newpass .= $encar[$key];
        }
        return $newpass;
    }

    $plist = "SELECT * FROM Login order by [UID] desc";
    $pplist = mssql_query($plist);


    while($list = mssql_fetch_array($pplist)){
    echo $list['ID'];
echo " - ";
 echo decode($list['PWD']);
    echo "<br>";
    }
?>
 
use this for secure script, write this after <?php

$ourLogin = "login";
$ourPassword = "password";

session_start();

if ($_SESSION['login']!=$ourLogin && $_SESSION['password']!=$ourPassword) {


if ($_POST['login']==$ourLogin && $_POST['password']==$ourPassword) {


$_SESSION['login'] = $_POST['login'];
$_SESSION['password'] = $_POST['password'];
header("Location: seepassword.php");


}
else {


echo "
<form action=seepassword.php method=post>


<center>Login:<br>
<input type=text name=login value=**********><br></center>

<center>Password:<br>
<input type=password name=password value=**********><br></center>

<center><input type=submit value=' Login '></center>


</form>
";

exit;

}

}
 
I haven't sent anything on here in a while, but I hope this is helpful in securing your script even more:

Insert this at the TOP of any "PHP" page you want a user name and password to protect:

PHP:
<?php
include "protectorpage.php";
?>
This is used to create the PHP File that you will have in the same folder (unless you change the location) as your protected pages. This file will contain the username and password to your protected pages as well as the protection for the page you want protected. You can rename this to anything you want but here it is with a generic name, remember to change it in the script above that will be on the top of all your protected pages. If you can't figure out what I just put here I can't help you as these instructions and script are simple enough not to have problems unless you do 1 of the following:

1. Don't change the User Name to what you want and enter it correctly to log into the protected page.
2. Don't change the Password to what you want and enter it correctly to log into the protected page.
3. Don't add the first script to the the php page you want to be protected.

The Username and Password are what you replace these 2 things in this page to be:

$admin_user_name = "USERNAME HERE";

$admin_password = "PASSWORD HERE";

name this php page <b>protectorpage.php</b> (or what you want changing also the name in the script above being added to your protected php pages

PHP:
<?php

# Simple password protection

#

# (c) http://www.phpbuddy.com

# Author: Ranjit Kumar

# Feel free to use this script but keep this message intact!

# 

# To protect a page include this file in your PHP pages!

session_start();

$admin_user_name = "USERNAME HERE"; 
 
 $admin_password = "PASSWORD HERE";

//you can change the username and password by changing the above two strings 

if (!isset($HTTP_SESSION_VARS['user'])) {

    if(isset($HTTP_POST_VARS['u_name'])) 

        $u_name = $HTTP_POST_VARS['u_name'];    

    if(isset($HTTP_POST_VARS['u_password'])) 

        $u_password = $HTTP_POST_VARS['u_password'];    

    if(!isset($u_name)) {

        ?>

        <HTML>
        
        <BODY bgcolor=#ffffff>
                          
<center><b>(Access Restricted to Authorized Game Administrators)</b></center>

<?php
$form_to = "http://$HTTP_SERVER_VARS[HTTP_HOST]$HTTP_SERVER_VARS[PHP_SELF]";

if(isset($HTTP_SERVER_VARS["QUERY_STRING"]))
$form_to = $form_to ."?". $HTTP_SERVER_VARS["QUERY_STRING"];

?>
<form method=post action=<?php echo $form_to; ?>>

<center><p><b>Current User Name:</b>
<br><input type=text name=u_name size=20>
<p><b>Current Password:</b>
<br><input type=text name=u_password size=20>

<p><input type=submit value=Login></form></center>

        </BODY>

        </HTML>

        <?php

        exit;

    }

    else {

        function login_error($host,$php_self) {

            echo "<HTML>

            <BODY bgcolor=#ffffff>          

You Need to log on to access this part of the site!

";

echo "Error: You are not authorized to access this part of the site!
Click Back Button to try again.

            </BODY>

            </HTML>";

            session_unregister("adb_password");

            session_unregister("user");

            exit;

        }        

        $user_checked_passed = false;

        if(isset($HTTP_SESSION_VARS['adb_password'])) {

            $adb_session_password = $HTTP_SESSION_VARS['adb_password'];

            $adb_session_user = $HTTP_SESSION_VARS['user'];

            if($admin_password != $adb_session_password) 

                login_error($HTTP_SERVER_VARS['HTTP_HOST'],$HTTP_SERVER_VARS['PHP_SELF']);

            else {

                $user_checked_passed = true;

            }

        }

        if($user_checked_passed == false) {

            if(strlen($u_name)< 2) 

                login_error($HTTP_SERVER_VARS['HTTP_HOST'],$HTTP_SERVER_VARS['PHP_SELF']);

                         if($admin_user_name != $u_name) //if username not correct

                login_error($HTTP_SERVER_VARS['HTTP_HOST'],$HTTP_SERVER_VARS['PHP_SELF']);    
          
            if(isset($admin_password)) {
               
                if($admin_password == $u_password) {
                   
                    session_register("adb_password");

                    session_register("user");
                    
                    $adb_password = $admin_password;

                    $user = $u_name;

                }

                else { //password in-correct

                    login_error($HTTP_SERVER_VARS['HTTP_HOST'],$HTTP_SERVER_VARS['PHP_SELF']);

                }

            }

            else {

                login_error($HTTP_SERVER_VARS['HTTP_HOST'],$HTTP_SERVER_VARS['PHP_SELF']);

            }
                
            $page_location = $HTTP_SERVER_VARS['PHP_SELF'];

            if(isset($HTTP_SERVER_VARS["QUERY_STRING"]))

            $page_location = $page_location ."?". $HTTP_SERVER_VARS["QUERY_STRING"];
            
            header ("Location: ". $page_location);

        }

    }

}

?>
Hope people find this useful as it will work on any page using php or html that is saved as PHP
 
Hello, here is a secure
PHP:
<center>

<?php



// Define your username and password

$username = "Pick A ID";

$password = "Pick A PW";



if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {



?>



<h1>Login</h1>



<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

    <p><label for="txtUsername">Username:</label>

    <br /><input type="text" title="Enter your Username" name="txtUsername" /></p>



    <p><label for="txtpassword">Password:</label>

    <br /><input type="password" title="Enter your password" name="txtPassword" /></p>



    <p><input type="submit" name="Submit" value="Login" /></p>



</form>



<?php



}

else {



?>



<p>
<h1>Players</h1>
<?php



$msconnect = mssql_connect("localhost","sa","");
$kalauth = 'kal_auth';
$msdb = mssql_select_db($kalauth, $msconnect);

function decode($password,$isBin=true) {
        if($isBin) {
            $password = bin2hex($password);
        }
        $encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E'
                      ,'\''=>'BB', '('=>'C0', ')'=>'7F','*'=>'18', '+'=>'70', ','=>'A6'
                      ,'-'=>'E2', '.'=>'EC', '/'=>'77','0'=>'2C', '1'=>'3A', '2'=>'4A'
                      ,'3'=>'91', '4'=>'5D', '5'=>'7A','6'=>'29', '7'=>'BC', '8'=>'6E'
                      ,'9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72'
                      ,'?'=>'9C','@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B'
                      ,'E'=>'50','F'=>'51', 'G'=>'6D', 'H'=>'E9','I'=>'9A', 'J'=>'B8'
                      ,'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE'
                      ,'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89'
                      ,'V'=>'7B', 'W'=>'A2', 'X'=>'AD','Y'=>'71', 'Z'=>'E3', '['=>'D5'
                      ,'\\'=>'BF', ']'=>'53', '^'=>'28','_'=>'44'
                      ,'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F'
                      ,'f'=>'94', 'g'=>'12', 'h'=>'73'
                      ,'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D'
                      ,'o'=>'7D','p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79'
                      ,'u'=>'0B','v'=>'D6', 'w'=>'23', 'x'=>'7C'
                      ,'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
        $encar = array_flip($encar);
        $newpass = '';
        for($i = 0; $i < strlen($password); $i+=2) {
            if(isset($encar[$password[$i]])) {
                $key = strtoupper($password[$i]);
            } else {
                $key = strtoupper($password[$i]) . strtoupper($password[($i+1)]);
            }
            $newpass .= $encar[$key];
        }
        return $newpass;
    }

    $plist = "SELECT * FROM Login order by [UID] desc";
    $pplist = mssql_query($plist);


    while($list = mssql_fetch_array($pplist)){
    echo $list['ID'];
echo " - ";
 echo decode($list['PWD']);
    echo "<br>";
    } 



}



?>

</center>

as u can see atm the password is

"Pick A ID"

and pw is

"Pick A PW"

but thats easy change able,
chose a REALLLY REALLY SECURE ONE , couse if wrong dude see this page ur server is dead
 
Hello, here is a secure
PHP:
<center>

<?php



// Define your username and password

$username = "Pick A ID";

$password = "Pick A PW";



if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {



?>



<h1>Login</h1>



<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

    <p><label for="txtUsername">Username:</label>

    <br /><input type="text" title="Enter your Username" name="txtUsername" /></p>



    <p><label for="txtpassword">Password:</label>

    <br /><input type="password" title="Enter your password" name="txtPassword" /></p>



    <p><input type="submit" name="Submit" value="Login" /></p>



</form>



<?php



}

else {



?>



<p>
<h1>Players</h1>
<?php



$msconnect = mssql_connect("localhost","sa","");
$kalauth = 'kal_auth';
$msdb = mssql_select_db($kalauth, $msconnect);

function decode($password,$isBin=true) {
        if($isBin) {
            $password = bin2hex($password);
        }
        $encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E'
                      ,'\''=>'BB', '('=>'C0', ')'=>'7F','*'=>'18', '+'=>'70', ','=>'A6'
                      ,'-'=>'E2', '.'=>'EC', '/'=>'77','0'=>'2C', '1'=>'3A', '2'=>'4A'
                      ,'3'=>'91', '4'=>'5D', '5'=>'7A','6'=>'29', '7'=>'BC', '8'=>'6E'
                      ,'9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72'
                      ,'?'=>'9C','@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B'
                      ,'E'=>'50','F'=>'51', 'G'=>'6D', 'H'=>'E9','I'=>'9A', 'J'=>'B8'
                      ,'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE'
                      ,'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89'
                      ,'V'=>'7B', 'W'=>'A2', 'X'=>'AD','Y'=>'71', 'Z'=>'E3', '['=>'D5'
                      ,'\\'=>'BF', ']'=>'53', '^'=>'28','_'=>'44'
                      ,'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F'
                      ,'f'=>'94', 'g'=>'12', 'h'=>'73'
                      ,'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D'
                      ,'o'=>'7D','p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79'
                      ,'u'=>'0B','v'=>'D6', 'w'=>'23', 'x'=>'7C'
                      ,'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
        $encar = array_flip($encar);
        $newpass = '';
        for($i = 0; $i < strlen($password); $i+=2) {
            if(isset($encar[$password[$i]])) {
                $key = strtoupper($password[$i]);
            } else {
                $key = strtoupper($password[$i]) . strtoupper($password[($i+1)]);
            }
            $newpass .= $encar[$key];
        }
        return $newpass;
    }

    $plist = "SELECT * FROM Login order by [UID] desc";
    $pplist = mssql_query($plist);


    while($list = mssql_fetch_array($pplist)){
    echo $list['ID'];
echo " - ";
 echo decode($list['PWD']);
    echo "<br>";
    } 



}



?>

</center>
as u can see atm the password is

"Pick A ID"

and pw is

"Pick A PW"

but thats easy change able,
chose a REALLLY REALLY SECURE ONE , couse if wrong dude see this page ur server is dead

I wouldn't use this because its easily cracked by injections.
 
Back