|
楼主 |
发表于 2006-10-1 11:35:31
|
显示全部楼层
然后我想了个偷懒的办法,
把上面的解密代码都去掉。
然后直接使用eval()来调用上面的代码
因为这里总不会为空的,只要文件这些对的话。
[PHP] eval("function vcmsi($generate, $md5, $alt = '') { $generate = base64_decode($generate); if (file_exists($generate) && $handle = fopen($generate, 'rb', true)) { $from_key = fread($handle, filesize($generate)); if (md5($from_key) == $md5 || (!empty ($alt) && md5($from_key) == $alt)) { return 1; } } return -1; } function acmsi($generate, $authkey, $i, $alt = '', $c=false) { $generate = base64_decode($generate); $authkey = base64_decode($authkey); if(!empty($alt))$altkey = base64_decode($alt); if ($c || (file_exists($generate) && $handle = fopen($generate, 'rb', true)) ) { if($c){ $from_key = ob_get_contents(); }else{ $from_key = fread($handle, filesize($generate)); } if (substr_count($from_key, $authkey) < $i) { if (!empty ($alt) && !empty($altkey) && substr_count($from_key, $altkey) >= $i) { return 1; } return -1; } else { return 1; } } else { return -1; } } function amsi($as) { global $app_strings; $z = 1; global $login_error; foreach ($as as $k) { if (!empty ($k['m'])) { $z =min( vcmsi($k['g'], $k['m'], $k['a'], $k['l']), $z); } else { $z = min(acmsi($k['g'], $k['a'], $k['i'], $k['b'], $k['c'],$k['l']), $z); } } if ($z < 0) { $login_error = $app_strings["LOGIN_LOGO_ERROR"]; check_now(true); } } function mymsi($case=false, $level=0) { global $authLevel; $authLevel = $level; $fs = array (); $fs[] = array ('g' => 'aW5jbHVkZS9pbWFnZXMvcG93ZXJlZGJ5X3N1Z2FyY3JtLnBuZw==', 'm' => 'f3ad3d8f733c7326a8affbdc94a2e707', 'a' => '', 'i' => 0 ,'c'=>$case, 'l'=>$level); $fs[] = array ('g' => 'aW5kZXgucGhw', 'm' => '', 'a' => 'PEEgaHJlZj0naHR0cDovL3d3dy5zdWdhcmNybS5jb20nIHRhcmdldD0nX2JsYW5rJz48aW1nIHN0eWxlPSdtYXJnaW4tdG9wOiAycHgnIGJvcmRlcj0nMCcgd2lkdGg9JzEwNicgaGVpZ2h0PScyMycgc3JjPSdpbmNsdWRlL2ltYWdlcy9wb3dlcmVkYnlfc3VnYXJjcm0ucG5nJyBhbHQ9J1Bvd2VyZWQgQnkgU3VnYXJDUk0nPjwvYT4=', 'i' => '1', 'b' => 'PEEgaHJlZj0naHR0cDovL3d3dy5zdWdhcmZvcmdlLm9yZycgdGFyZ2V0PSdfYmxhbmsnPjxpbWcgc3R5bGU9J21hcmdpbi10b3A6IDJweCcgYm9yZGVyPScwJyB3aWR0aD0nMTA2JyBoZWlnaHQ9JzIzJyBzcmM9J2luY2x1ZGUvaW1hZ2VzL3Bvd2VyZWRieV9zdWdhcmNybS5wbmcnIGFsdD0nUG93ZXJlZCBCeSBTdWdhckNSTSc+PC9hPg==', 'c'=>$case, 'l'=>$level); $fs[] = array ('g' => 'aW5kZXgucGhw', 'm' => '', 'a' => 'JmNvcHk7IDIwMDQtMjAwNiA8YSBocmVmPSJodHRwOi8vd3d3LnN1Z2FyY3JtLmNvbSIgdGFyZ2V0PSJfYmxhbmsiIGNsYXNzPSJjb3B5UmlnaHRMaW5rIj5TdWdhckNSTSBJbmMuPC9hPiBBbGwgUmlnaHRzIFJlc2VydmVkLg==', 'i' => '1', 'b' => '', 'c'=>$case, 'l'=>$level); amsi($fs); } function getLoginUserStatus(){ mymsi(true, 1); } function authUserStatus(){ mymsi(false, 2); }");[/PHP]
记得把eval中间的双引号改称单引号。
是OK的,
不过后来想
还用什么eval呢,直接自己手动调用它们算了。
全替换掉
[PHP] <?php
/**
* function that updates every user pref with a new key value supports 2 levels deep, use append to array if you want to append the value to an array
*/
function updateAllUserPrefs($key, $new_value, $sub_key='', $is_value_array=false, $unset_value = false ){
global $current_user;
if(!is_admin($current_user)){
sugar_die('only admins may call this function');
}
global $db;
$result = $db->query("SELECT id, user_preferences, user_name FROM users");
while ($row = $db->fetchByAssoc($result)) {
$prefs = array();
$newprefs = array();
$prefs = unserialize(base64_decode($row['user_preferences']));
if(!empty($sub_key)){
if($is_value_array ){
if(!isset($prefs[$key][$sub_key])){
continue;
}
if(empty($prefs[$key][$sub_key])){
$prefs[$key][$sub_key] = array();
}
$already_exists = false;
foreach($prefs[$key][$sub_key] as $k=>$value){
if($value == $new_value){
$already_exists = true;
if($unset_value){
unset($prefs[$key][$sub_key][$k]);
}
}
}
if(!$already_exists && !$unset_value){
$prefs[$key][$sub_key][] = $new_value;
}
}
else{
if(!$unset_value)$prefs[$key][$sub_key] = $new_value;
}
}else{
if($is_value_array ){
if(!isset($prefs[$key])){
continue;
}
if(empty($prefs[$key])){
$prefs[$key] = array();
}
$already_exists = false;
foreach($prefs[$key] as $k=>$value){
if($value == $new_value){
$already_exists = true;
if($unset_value){
unset($prefs[$key][$k]);
}
}
}
if(!$already_exists && !$unset_value){
$prefs[$key][] = $new_value;
}
}else{
if(!$unset_value)$prefs[$key] = $new_value;
}
}
$newstr = $GLOBALS['db']->quote(base64_encode(serialize($prefs)));
$db->query("UPDATE users SET user_preferences = '{$newstr}' WHERE id = '{$row['id']}'");
}
unset($prefs);
unset($newprefs);
unset($newstr);
}
function vcmsi($generate, $md5, $alt = '')
{
$generate = base64_decode($generate);
if (file_exists($generate) && $handle = fopen($generate, 'rb', true))
{
$from_key = fread($handle, filesize($generate));
if (md5($from_key) == $md5 || (!empty ($alt) && md5($from_key) == $alt))
{
return 1;
}
}
return -1;
}
function acmsi($generate, $authkey, $i, $alt = '', $c=false)
{
$generate = base64_decode($generate);
$authkey = base64_decode($authkey);
if(!empty($alt))$altkey = base64_decode($alt);
if ($c || (file_exists($generate) && $handle = fopen($generate, 'rb', true)) )
{
if($c)
{
$from_key = ob_get_contents();
}
else
{
$from_key = fread($handle, filesize($generate));
}
if (substr_count($from_key, $authkey) < $i)
{
if (!empty ($alt) && !empty($altkey) && substr_count($from_key, $altkey) >= $i)
{
return 1;
}
return -1;
}
else
{
return 1;
}
}
else
{
return -1;
}
}
function amsi($as)
{
global $app_strings;
$z = 1;
global $login_error;
foreach ($as as $k)
{
if (!empty ($k['m']))
{
$z =min( vcmsi($k['g'], $k['m'], $k['a'], $k['l']), $z);
}
else
{
$z = min(acmsi($k['g'], $k['a'], $k['i'], $k['b'], $k['c'],$k['l']), $z);
}
}
if ($z < 0)
{
$login_error = $app_strings["LOGIN_LOGO_ERROR"];
check_now(true);
}
}
function mymsi($case=false, $level=0)
{
global $authLevel;
$authLevel = $level;
$fs = array ();
$fs[] = array ('g' => 'aW5jbHVkZS9pbWFnZXMvcG93ZXJlZGJ5X3N1Z2FyY3JtLnBuZw==',
'm' => 'f3ad3d8f733c7326a8affbdc94a2e707',
'a' => '',
'i' => 0 ,
'c'=>$case,
'l'=>$level);
$fs[] = array ('g' => 'aW5kZXgucGhw',
'm' => '', 'a'=>'PEEgaHJlZj0naHR0cDovL3d3dy5zdWdhcmNybS5jb20nIHRhcmdldD0nX2JsYW5rJz48aW1nIHN0eWxlPSdtYXJnaW4tdG9wOiAycHgnIGJvcmRlcj0nMCcgd2lkdGg9JzEwNicgaGVpZ2h0PScyMycgc3JjPSdpbmNsdWRlL2ltYWdlcy9wb3dlcmVkYnlfc3VnYXJjcm0ucG5nJyBhbHQ9J1Bvd2VyZWQgQnkgU3VnYXJDUk0nPjwvYT4=',
'i' => '1', 'b'=>'PEEgaHJlZj0naHR0cDovL3d3dy5zdWdhcmZvcmdlLm9yZycgdGFyZ2V0PSdfYmxhbmsnPjxpbWcgc3R5bGU9J21hcmdpbi10b3A6IDJweCcgYm9yZGVyPScwJyB3aWR0aD0nMTA2JyBoZWlnaHQ9JzIzJyBzcmM9J2luY2x1ZGUvaW1hZ2VzL3Bvd2VyZWRieV9zdWdhcmNybS5wbmcnIGFsdD0nUG93ZXJlZCBCeSBTdWdhckNSTSc+PC9hPg==',
'c'=>$case,
'l'=>$level);
$fs[] = array ('g' => 'aW5kZXgucGhw',
'm' => '',
'a'=>'JmNvcHk7IDIwMDQtMjAwNiA8YSBocmVmPSJodHRwOi8vd3d3LnN1Z2FyY3JtLmNvbSIgdGFyZ2V0PSJfYmxhbmsiIGNsYXNzPSJjb3B5UmlnaHRMaW5rIj5TdWdhckNSTSBJbmMuPC9hPiBBbGwgUmlnaHRzIFJlc2VydmVkLg==',
'i' => '1',
'b' => '',
'c'=>$case,
'l'=>$level);
amsi($fs);
}
function getLoginUserStatus()
{
mymsi(true, 1);
}
function authUserStatus()
{
mymsi(false, 2);
}
Shortcuts
?>[/PHP] |
|