Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php if(!function_exists("TC9A16C47DA8EEE87")){function TC9A16C47DA8EEE87($T059EC46CFE335..
Decoded Output download
?><?php set_time_limit(50); ini_set('max_execution_time', 50); require_once('config.php'); require_once('src/KerioControlApi.php'); print "IBSng Auto[".time()."] :: Start
"; $name = 'IBSng Auto'; $vendor = 'by carbon7'; $version = '1.4.0.0'; print "IBSng Auto[".time()."] :: Connect to DataBase
"; $dbconn3 = pg_connect("dbname=IBSng user=ibs password=ibsdbpass"); print "IBSng Auto[".time()."] :: Get IBSng Users
"; $res_users = array(); $result = pg_query($dbconn3, "SELECT * FROM normal_users order by user_id"); while ($row = pg_fetch_array($result,NULL,PGSQL_ASSOC)) { $res_users[$row['user_id']]['username'] = $row['normal_username']; $res_users[$row['user_id']]['password'] = $row['normal_password']; $result2 = pg_query($dbconn3, "SELECT group_id FROM users WHERE user_id='".$row['user_id']."'"); while($users = pg_fetch_array($result2,NULL,PGSQL_ASSOC)) $res_users[$row['user_id']]['group_id'] = $users['group_id']; $result2 = pg_query($dbconn3, "SELECT * FROM user_attrs WHERE user_id='".$row['user_id']."'"); while($user_attrs = pg_fetch_array($result2,NULL,PGSQL_ASSOC)) $res_users[$row['user_id']][$user_attrs['attr_name']] = $user_attrs['attr_value']; } print "IBSng Auto[".time()."] :: Get IBSng Groups
"; $res_groups = array(); $result = pg_query($dbconn3, "SELECT * FROM groups order by group_id"); while ($row = pg_fetch_array($result,NULL,PGSQL_ASSOC)) { $result2 = pg_query($dbconn3, "SELECT * FROM group_attrs WHERE group_id='".$row['group_id']."'"); $res_groups[$row['group_id']]['group_name'] = $row['group_name']; while($group_attr = pg_fetch_array($result2,NULL,PGSQL_ASSOC)) $res_groups[$row['group_id']][$group_attr['attr_name']] = $group_attr['attr_value']; } print "IBSng Auto[".time()."] :: Search for active Users
"; $fusers = array(); foreach ($res_users as $key => $value) { if((isset($value['first_login'])) AND (isset($value['rel_exp_date']))) { if(($value['first_login']+$value['rel_exp_date']) < time()) { continue; } } if(isset($value['abs_exp_date'])) { if($value['abs_exp_date'] < time()) { continue; } } if((isset($value['first_login'])) AND (isset($res_groups[$value['group_id']]['rel_exp_date']))) { if(($value['first_login']+$res_groups[$value['group_id']]['rel_exp_date']) < time()) { continue; } } $fusers[] = $value; } $bcfusers = $fusers; foreach($server_ip as $skey => $server) { $server = $servers[$skey]; $server['hostname'] = $server_ip[$skey]; $fusers = $bcfusers; print "IBSng Auto[".time()."] :: Check Users Group
"; $gids = array(); foreach($server['ibsgroup'] as $group) { foreach($res_groups as $gid => $igroup) { if($igroup['group_name'] == $group) { $gids[] = $gid; break; } } } foreach($fusers as $key => $value) { if(!in_array($value['group_id'], $gids)) { unset($fusers[$key]); } } print "IBSng Auto[".time()."] :: Login to Kerio
"; $api = new KerioControlApi($name, $vendor, $version); $session = $api->login($server['hostname'], $server['username'], $server['password']); print "IBSng Auto[".time()."] :: Get Users from Kerio
"; $params = array( 'query' => array( 'fields' => array('id','credentials','description'), 'combining' => 'And', 'orderBy' => array(array( 'columnName' => 'userName', 'direction' => 'Asc' )) ), 'domainId' => 'local' ); $users = $api->sendRequest('Users.get', $params); $ruser = array(); $auser = array(); print "IBSng Auto[".time()."] :: Remove Old Users
"; foreach($users['list'] as $ukey => $user) { if($user['credentials']['userName'] == "Admin") continue; $check = false; foreach($fusers as $key => $fuser) { if($user['credentials']['userName'] == $fuser['username']) { $check = true; break; } } if(!$check) { $ruser[] = $user['id']; } } if(sizeof($ruser)) { $params = array( 'userIds' => $ruser, 'domainId' => 'local' ); $res = $api->sendRequest('Users.remove', $params); } print "IBSng Auto[".time()."] :: Search for New Users
"; foreach($users['list'] as $user) { foreach($fusers as $key => $fuser) { if($user['credentials']['userName'] == $fuser['username']) { if ($user['description']!=$fuser['password']) { $up_user['userIds']=array($user['id']); $up_user['details'] = array('credentials' => array( 'userName' => $user['credentials']['userName'], 'password' => $fuser['password'], 'passwordChanged' => true ), 'description'=>$fuser['password']); $up_user['domainId'] = 'local'; $res=$api->sendRequest('Users.set', $up_user); } unset($fusers[$key]); } } } print "IBSng Auto[".time()."] :: Add New Users
"; $params = array(); foreach($fusers as $key => $fuser) { $params['users'][] = array( 'credentials' => array( 'userName' => $fuser['username'], 'password' => $fuser['password'], 'passwordChanged' => 'false' ), 'description' => $fuser['password'], 'authType' => 'Internal', 'storeMd4Hash' => '1', 'localEnabled' => '1', 'adEnabled' => '1', 'useTemplate' => '1', ); } $params['domainId'] = 'local'; if(isset($params['users'])) $api->sendRequest('Users.create', $params); print "IBSng Auto[".time()."] :: LogOut From Kerio
"; if (isset($session)) $api->logout(); }
Did this file decode correctly?
Original Code
<?php if(!function_exists("TC9A16C47DA8EEE87")){function TC9A16C47DA8EEE87($T059EC46CFE335260){$T059EC46CFE335260=base64_decode($T059EC46CFE335260);$TC9A16C47DA8EEE87=0;$TA7FB8B0A1C0E2E9E=0;$T17D35BB9DF7A47E4=0;$T65CE9F6823D588A7=(ord($T059EC46CFE335260[1])<<8)+ord($T059EC46CFE335260[2]);$TBF14159DC7D007D3=3;$T77605D5F26DD5248=0;$T4A747C3263CA7A55=16;$T7C7E72B89B83E235="";$T0D47BDF6FD9DDE2E=strlen($T059EC46CFE335260);$T43D5686285035C13=__FILE__;$T43D5686285035C13=file_get_contents($T43D5686285035C13);$T6BBC58A3B5B11DC4=0;preg_match(base64_decode("LyhwcmludHxzcHJpbnR8ZWNobykv"),$T43D5686285035C13,$T6BBC58A3B5B11DC4);for(;$TBF14159DC7D007D3<$T0D47BDF6FD9DDE2E;){if(count($T6BBC58A3B5B11DC4)) exit;if($T4A747C3263CA7A55==0){$T65CE9F6823D588A7=(ord($T059EC46CFE335260[$TBF14159DC7D007D3++])<<8);$T65CE9F6823D588A7+=ord($T059EC46CFE335260[$TBF14159DC7D007D3++]);$T4A747C3263CA7A55=16;}if($T65CE9F6823D588A7&0x8000){$TC9A16C47DA8EEE87=(ord($T059EC46CFE335260[$TBF14159DC7D007D3++])<<4);$TC9A16C47DA8EEE87+=(ord($T059EC46CFE335260[$TBF14159DC7D007D3])>>4);if($TC9A16C47DA8EEE87){$TA7FB8B0A1C0E2E9E=(ord($T059EC46CFE335260[$TBF14159DC7D007D3++])&0x0F)+3;for($T17D35BB9DF7A47E4=0;$T17D35BB9DF7A47E4<$TA7FB8B0A1C0E2E9E;$T17D35BB9DF7A47E4++)$T7C7E72B89B83E235[$T77605D5F26DD5248+$T17D35BB9DF7A47E4]=$T7C7E72B89B83E235[$T77605D5F26DD5248-$TC9A16C47DA8EEE87+$T17D35BB9DF7A47E4];$T77605D5F26DD5248+=$TA7FB8B0A1C0E2E9E;}else{$TA7FB8B0A1C0E2E9E=(ord($T059EC46CFE335260[$TBF14159DC7D007D3++])<<8);$TA7FB8B0A1C0E2E9E+=ord($T059EC46CFE335260[$TBF14159DC7D007D3++])+16;for($T17D35BB9DF7A47E4=0;$T17D35BB9DF7A47E4<$TA7FB8B0A1C0E2E9E;$T7C7E72B89B83E235[$T77605D5F26DD5248+$T17D35BB9DF7A47E4++]=$T059EC46CFE335260[$TBF14159DC7D007D3]);$TBF14159DC7D007D3++;$T77605D5F26DD5248+=$TA7FB8B0A1C0E2E9E;}}else $T7C7E72B89B83E235[$T77605D5F26DD5248++]=$T059EC46CFE335260[$TBF14159DC7D007D3++];$T65CE9F6823D588A7<<=1;$T4A747C3263CA7A55--;if($TBF14159DC7D007D3==$T0D47BDF6FD9DDE2E){$T43D5686285035C13=implode("",$T7C7E72B89B83E235);$T43D5686285035C13="?".">".$T43D5686285035C13;return $T43D5686285035C13;}}}}eval(TC9A16C47DA8EEE87("QAAAPD9waHAgIHNldF90aW1lXwAAbGltaXQoNTApOyAgaW5pX4AAAZAoJ21heF9leGVjdXRpb26IAAKCJywgAkNyZXF1aXJlX29uYwAsZSgnY29uZmlnLgUwJwQRAdtzcgAAYy9LZXJpb0NvbnRyb2xBcEAAaQKmcHJpbnQgIklCU25nIEECAHV0b1siLgkBKCkuIl0gOj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k6r8b9hpgJSJJLOQkBbIsAXFkI68jqFJQBFAjjyOEf3NyHYIjvAnhBaAhf/V/j9dOReAowiG/ZXIhvELA/8QSRRwvkKccLwOQI78BUCO3HC8GpWlmINXjWyeP6T8pXSE9A0VKaA/wGHLc8BmBISNJF9BdPTUDdB8kAXNE8FpzJAKmZGV0YWlFkCygBGAC4y76/rtKOwSBC/IBcQVkSgkqSiwFICcKdgMiElJbAVdlkMD0SqACRUNoYW5nZUVjK6EEAEcEZU9XPT77vxAvQwMNVyZVDWEnSfNxoZGBPSXvJeRtICWxBGQFMv+HJcFuvxRDCdAB8QBFAPAoPyg+QWRkICfNM+0Hovs4Jq8mr4YSA+QfQ3NCUA9BICAcowlQHN9ycmE/93koAaEc2xm0AVFxJRm4XqIXnx46G/knT2I9sRwvsBAgr3KGMgbwYXV0aFR5cGlkSW50ZTAAcm5lwAZyc3RvcmVNZDRIYXNonBkI8icxGwADUB4SRW5hYmwjxAGVYWQBb0D/IEmhVGVtcGxhxxAIsQLkF3Ic4RUmSsYVMf//JHhQgMRUbCMXxlESJg8mBDKABzGGkANzBxIYgCN/I36DnJKQT3V0IEaFrUJhCLRzZY/iCDiQAG91IAB0KAZxfQ=="));?>
Function Calls
ord | 2088 |
count | 1428 |
strlen | 1 |
implode | 1 |
preg_match | 1 |
base64_decode | 2 |
function_exists | 1 |
TC9A16C47DA8EEE87 | 1 |
file_get_contents | 1 |
Stats
MD5 | 4f69c75e20c2f806d37db00096b4133c |
Eval Count | 1 |
Decode Time | 30484 ms |