Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../var/softacul.../conc
File: update_pass.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
#
[3] Fix | Delete
# Portable PHP password hashing framework.
[4] Fix | Delete
#
[5] Fix | Delete
# Version 0.3 / genuine.
[6] Fix | Delete
#
[7] Fix | Delete
# Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
[8] Fix | Delete
# the public domain. Revised in subsequent years, still public domain.
[9] Fix | Delete
#
[10] Fix | Delete
[11] Fix | Delete
if(!defined('PASSWORD_HASH_PORTABLE')) {
[12] Fix | Delete
define('PASSWORD_HASH_PORTABLE', false);
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
// The higher this is the longer it will take to create password hashes, to check them, and to crack them.
[16] Fix | Delete
if(!defined('PASSWORD_HASH_COST_LOG2')) {
[17] Fix | Delete
define('PASSWORD_HASH_COST_LOG2', 12);
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
$hasher = new PasswordHash(PASSWORD_HASH_COST_LOG2, PASSWORD_HASH_PORTABLE);
[21] Fix | Delete
$resp = $hasher->HashPassword('[[admin_pass]]');
[22] Fix | Delete
echo '<update_pass>'.$resp.'</update_pass>';
[23] Fix | Delete
# There's absolutely no warranty.
[24] Fix | Delete
#
[25] Fix | Delete
# The homepage URL for this framework is:
[26] Fix | Delete
#
[27] Fix | Delete
# http://www.openwall.com/phpass/
[28] Fix | Delete
#
[29] Fix | Delete
# Please be sure to update the Version line if you edit this file in any way.
[30] Fix | Delete
# It is suggested that you leave the main version number intact, but indicate
[31] Fix | Delete
# your project name (after the slash) and add your own revision information.
[32] Fix | Delete
#
[33] Fix | Delete
# Please do not change the "private" password hashing method implemented in
[34] Fix | Delete
# here, thereby making your hashes incompatible. However, if you must, please
[35] Fix | Delete
# change the hash type identifier (the "$P$") to something different.
[36] Fix | Delete
#
[37] Fix | Delete
# Obviously, since this code is in the public domain, the above are not
[38] Fix | Delete
# requirements (there can be none), but merely suggestions.
[39] Fix | Delete
#
[40] Fix | Delete
class PasswordHash {
[41] Fix | Delete
var $itoa64;
[42] Fix | Delete
var $iteration_count_log2;
[43] Fix | Delete
var $portable_hashes;
[44] Fix | Delete
var $random_state;
[45] Fix | Delete
[46] Fix | Delete
function PasswordHash($iteration_count_log2, $portable_hashes)
[47] Fix | Delete
{
[48] Fix | Delete
$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
[49] Fix | Delete
[50] Fix | Delete
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
[51] Fix | Delete
$iteration_count_log2 = 8;
[52] Fix | Delete
$this->iteration_count_log2 = $iteration_count_log2;
[53] Fix | Delete
[54] Fix | Delete
$this->portable_hashes = $portable_hashes;
[55] Fix | Delete
[56] Fix | Delete
$this->random_state = microtime();
[57] Fix | Delete
if (function_exists('getmypid'))
[58] Fix | Delete
$this->random_state .= getmypid();
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
function get_random_bytes($count)
[62] Fix | Delete
{
[63] Fix | Delete
$output = '';
[64] Fix | Delete
if (@is_readable('/dev/urandom') &&
[65] Fix | Delete
($fh = @fopen('/dev/urandom', 'rb'))) {
[66] Fix | Delete
$output = fread($fh, $count);
[67] Fix | Delete
fclose($fh);
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
if (strlen($output) < $count) {
[71] Fix | Delete
$output = '';
[72] Fix | Delete
for ($i = 0; $i < $count; $i += 16) {
[73] Fix | Delete
$this->random_state =
[74] Fix | Delete
md5(microtime() . $this->random_state);
[75] Fix | Delete
$output .=
[76] Fix | Delete
pack('H*', md5($this->random_state));
[77] Fix | Delete
}
[78] Fix | Delete
$output = substr($output, 0, $count);
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
return $output;
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
function encode64($input, $count)
[85] Fix | Delete
{
[86] Fix | Delete
$output = '';
[87] Fix | Delete
$i = 0;
[88] Fix | Delete
do {
[89] Fix | Delete
$value = ord($input[$i++]);
[90] Fix | Delete
$output .= $this->itoa64[$value & 0x3f];
[91] Fix | Delete
if ($i < $count)
[92] Fix | Delete
$value |= ord($input[$i]) << 8;
[93] Fix | Delete
$output .= $this->itoa64[($value >> 6) & 0x3f];
[94] Fix | Delete
if ($i++ >= $count)
[95] Fix | Delete
break;
[96] Fix | Delete
if ($i < $count)
[97] Fix | Delete
$value |= ord($input[$i]) << 16;
[98] Fix | Delete
$output .= $this->itoa64[($value >> 12) & 0x3f];
[99] Fix | Delete
if ($i++ >= $count)
[100] Fix | Delete
break;
[101] Fix | Delete
$output .= $this->itoa64[($value >> 18) & 0x3f];
[102] Fix | Delete
} while ($i < $count);
[103] Fix | Delete
[104] Fix | Delete
return $output;
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
function gensalt_private($input)
[108] Fix | Delete
{
[109] Fix | Delete
$output = '$P$';
[110] Fix | Delete
$output .= $this->itoa64[min($this->iteration_count_log2 +
[111] Fix | Delete
((PHP_VERSION >= '5') ? 5 : 3), 30)];
[112] Fix | Delete
$output .= $this->encode64($input, 6);
[113] Fix | Delete
[114] Fix | Delete
return $output;
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
function crypt_private($password, $setting)
[118] Fix | Delete
{
[119] Fix | Delete
$output = '*0';
[120] Fix | Delete
if (substr($setting, 0, 2) == $output)
[121] Fix | Delete
$output = '*1';
[122] Fix | Delete
[123] Fix | Delete
$id = substr($setting, 0, 3);
[124] Fix | Delete
# We use "$P$", phpBB3 uses "$H$" for the same thing
[125] Fix | Delete
if ($id != '$P$' && $id != '$H$')
[126] Fix | Delete
return $output;
[127] Fix | Delete
[128] Fix | Delete
$count_log2 = strpos($this->itoa64, $setting[3]);
[129] Fix | Delete
if ($count_log2 < 7 || $count_log2 > 30)
[130] Fix | Delete
return $output;
[131] Fix | Delete
[132] Fix | Delete
$count = 1 << $count_log2;
[133] Fix | Delete
[134] Fix | Delete
$salt = substr($setting, 4, 8);
[135] Fix | Delete
if (strlen($salt) != 8)
[136] Fix | Delete
return $output;
[137] Fix | Delete
[138] Fix | Delete
# We're kind of forced to use MD5 here since it's the only
[139] Fix | Delete
# cryptographic primitive available in all versions of PHP
[140] Fix | Delete
# currently in use. To implement our own low-level crypto
[141] Fix | Delete
# in PHP would result in much worse performance and
[142] Fix | Delete
# consequently in lower iteration counts and hashes that are
[143] Fix | Delete
# quicker to crack (by non-PHP code).
[144] Fix | Delete
if (PHP_VERSION >= '5') {
[145] Fix | Delete
$hash = md5($salt . $password, TRUE);
[146] Fix | Delete
do {
[147] Fix | Delete
$hash = md5($hash . $password, TRUE);
[148] Fix | Delete
} while (--$count);
[149] Fix | Delete
} else {
[150] Fix | Delete
$hash = pack('H*', md5($salt . $password));
[151] Fix | Delete
do {
[152] Fix | Delete
$hash = pack('H*', md5($hash . $password));
[153] Fix | Delete
} while (--$count);
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
$output = substr($setting, 0, 12);
[157] Fix | Delete
$output .= $this->encode64($hash, 16);
[158] Fix | Delete
[159] Fix | Delete
return $output;
[160] Fix | Delete
}
[161] Fix | Delete
[162] Fix | Delete
function gensalt_extended($input)
[163] Fix | Delete
{
[164] Fix | Delete
$count_log2 = min($this->iteration_count_log2 + 8, 24);
[165] Fix | Delete
# This should be odd to not reveal weak DES keys, and the
[166] Fix | Delete
# maximum valid value is (2**24 - 1) which is odd anyway.
[167] Fix | Delete
$count = (1 << $count_log2) - 1;
[168] Fix | Delete
[169] Fix | Delete
$output = '_';
[170] Fix | Delete
$output .= $this->itoa64[$count & 0x3f];
[171] Fix | Delete
$output .= $this->itoa64[($count >> 6) & 0x3f];
[172] Fix | Delete
$output .= $this->itoa64[($count >> 12) & 0x3f];
[173] Fix | Delete
$output .= $this->itoa64[($count >> 18) & 0x3f];
[174] Fix | Delete
[175] Fix | Delete
$output .= $this->encode64($input, 3);
[176] Fix | Delete
[177] Fix | Delete
return $output;
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
function gensalt_blowfish($input)
[181] Fix | Delete
{
[182] Fix | Delete
# This one needs to use a different order of characters and a
[183] Fix | Delete
# different encoding scheme from the one in encode64() above.
[184] Fix | Delete
# We care because the last character in our encoded string will
[185] Fix | Delete
# only represent 2 bits. While two known implementations of
[186] Fix | Delete
# bcrypt will happily accept and correct a salt string which
[187] Fix | Delete
# has the 4 unused bits set to non-zero, we do not want to take
[188] Fix | Delete
# chances and we also do not want to waste an additional byte
[189] Fix | Delete
# of entropy.
[190] Fix | Delete
$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
[191] Fix | Delete
[192] Fix | Delete
$output = '$2a$';
[193] Fix | Delete
$output .= chr(ord('0') + $this->iteration_count_log2 / 10);
[194] Fix | Delete
$output .= chr(ord('0') + $this->iteration_count_log2 % 10);
[195] Fix | Delete
$output .= '$';
[196] Fix | Delete
[197] Fix | Delete
$i = 0;
[198] Fix | Delete
do {
[199] Fix | Delete
$c1 = ord($input[$i++]);
[200] Fix | Delete
$output .= $itoa64[$c1 >> 2];
[201] Fix | Delete
$c1 = ($c1 & 0x03) << 4;
[202] Fix | Delete
if ($i >= 16) {
[203] Fix | Delete
$output .= $itoa64[$c1];
[204] Fix | Delete
break;
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
$c2 = ord($input[$i++]);
[208] Fix | Delete
$c1 |= $c2 >> 4;
[209] Fix | Delete
$output .= $itoa64[$c1];
[210] Fix | Delete
$c1 = ($c2 & 0x0f) << 2;
[211] Fix | Delete
[212] Fix | Delete
$c2 = ord($input[$i++]);
[213] Fix | Delete
$c1 |= $c2 >> 6;
[214] Fix | Delete
$output .= $itoa64[$c1];
[215] Fix | Delete
$output .= $itoa64[$c2 & 0x3f];
[216] Fix | Delete
} while (1);
[217] Fix | Delete
[218] Fix | Delete
return $output;
[219] Fix | Delete
}
[220] Fix | Delete
[221] Fix | Delete
function HashPassword($password)
[222] Fix | Delete
{
[223] Fix | Delete
$random = '';
[224] Fix | Delete
[225] Fix | Delete
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
[226] Fix | Delete
$random = $this->get_random_bytes(16);
[227] Fix | Delete
$hash =
[228] Fix | Delete
crypt($password, $this->gensalt_blowfish($random));
[229] Fix | Delete
if (strlen($hash) == 60)
[230] Fix | Delete
return $hash;
[231] Fix | Delete
}
[232] Fix | Delete
[233] Fix | Delete
if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) {
[234] Fix | Delete
if (strlen($random) < 3)
[235] Fix | Delete
$random = $this->get_random_bytes(3);
[236] Fix | Delete
$hash =
[237] Fix | Delete
crypt($password, $this->gensalt_extended($random));
[238] Fix | Delete
if (strlen($hash) == 20)
[239] Fix | Delete
return $hash;
[240] Fix | Delete
}
[241] Fix | Delete
[242] Fix | Delete
if (strlen($random) < 6)
[243] Fix | Delete
$random = $this->get_random_bytes(6);
[244] Fix | Delete
$hash =
[245] Fix | Delete
$this->crypt_private($password,
[246] Fix | Delete
$this->gensalt_private($random));
[247] Fix | Delete
if (strlen($hash) == 34)
[248] Fix | Delete
return $hash;
[249] Fix | Delete
[250] Fix | Delete
# Returning '*' on error is safe here, but would _not_ be safe
[251] Fix | Delete
# in a crypt(3)-like function used _both_ for generating new
[252] Fix | Delete
# hashes and for validating passwords against existing hashes.
[253] Fix | Delete
return '*';
[254] Fix | Delete
}
[255] Fix | Delete
[256] Fix | Delete
}
[257] Fix | Delete
[258] Fix | Delete
// We do not need this file any more
[259] Fix | Delete
@unlink('update_pass.php');
[260] Fix | Delete
[261] Fix | Delete
?>
[262] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function