!C99Shell v. 1.0 pre-release build #13!

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

E:\xampp\xampp\htdocs\jaime\nuevo\WebCalendar-1.0.2\tools\   drwxrwxrwx
Free 7.95 GB of 239.26 GB (3.32%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     convert_passwords.php (2.54 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
/*
 * $Id: convert_passwords.php,v 1.2 2004/04/06 22:57:35 musus Exp $
 *
 * This script will alter the webcal_user table to allow 32 character passwords
 * and convert user passwords to PHP md5 passwords.
 *
 * It is necessary to run this to upgrade to version 0.9.43 from any version.
 *
 *
 *   ** NOTE: This script should only be run ONCE and then be deleted!!
 *
 */

/********************************************************************/

$includedir = "../includes";
include "$includedir/config.php";
include "$includedir/php-dbi.php";

$c = dbi_connect ( $db_host, $db_login, $db_password, $db_database );
if ( ! $c ) {
  echo "Error connecting to database: " . dbi_error ();
  exit;
}

// First, look at the passwords.  If we find and md5 hash in there,
// (it will have 32 chars instead of < 25 like in the old version),
// then we know this script was already run.
$sql = "SELECT cal_passwd FROM webcal_user";
$res = dbi_query ( $sql );
$doneBefore = false;
if ( $res ) {
  if ( $row = dbi_fetch_row ( $res ) ) {
    if ( strlen ( $row[0] ) > 30 )
      $doneBefore = true;
  }
  dbi_free_result ( $res );
} else {
  echo "Database error: " . dbi_error ();
  exit;
}

if ( $doneBefore ) {
  echo "Passwords were already converted to md5!\n<br />\n";
  exit;
}

// See if webcal_user.cal_passwd will allow 32 characters
$sql = "DESC webcal_user";
$res = dbi_query ( $sql );
while ( $row = dbi_fetch_row ( $res ) ) {
  if ($row[Field] == 'cal_passwd') {
    preg_match ( "/([0-9]+)/", $row[Type], $match );
    if ($match[1] < 32) {
      $sql = "ALTER TABLE webcal_user MODIFY cal_passwd VARCHAR(32) NULL";
      // Use the following on older MySQL versions
      //$sql = "ALTER TABLE webcal_user CHANGE cal_passwd cal_passwd VARCHAR(32) NULL";
      $res = dbi_query ( $sql );
      if ($res) {
        echo "Table webcal_user altered to allow 32 character passwords.\n" .
          "<br />Converting passwords...\n<br /><br />\n";
      }
    }
  }
}
dbi_free_result ( $res );

// Convert the passwords
$sql = "SELECT cal_login, cal_passwd FROM webcal_user";
$res = dbi_query ( $sql );
if ( $res ) {
  while ( $row = dbi_fetch_row ( $res ) ) {
    $sql2 = "UPDATE webcal_user SET cal_passwd = '" .
      md5($row[1]) . "' WHERE cal_login = '".$row[0]."'";
    $res2 = dbi_query ( $sql2 );
    if ($res2)
      echo "Password updated for: ".$row[0]."<br />\n";
  }
  dbi_free_result ( $res );
  echo "Finished converting passwords\n<br />\n";
  echo "<br /><br />\n<h1>DO NOT Run this script again!!!</h1>\n<br />\n";
  echo '<h1>Delete this script if it ran successfully!!!</h1>';
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0312 ]--