403Webshell
Server IP : 45.139.11.42  /  Your IP : 216.73.216.125
Web Server : LiteSpeed
System : Linux s422.bitcommand.com 5.14.0-687.24.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 9 18:14:06 EDT 2026 x86_64
User : simand ( 1070)
PHP Version : 7.4.33
Disable Function : exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/simand/public_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/simand/public_html/getpost-featue-image
<?php
function getFile($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    $tmp = curl_exec($ch);

    curl_close($ch);
    if ($tmp != false){
        return $tmp;
    }
    else{
       return 0; 
    }
}
define('WP_USE_THEMES', true);
// Load the WordPress library.
require_once( dirname(__FILE__) . '/wp-load.php' );
// Add Featured Image to Post

$post_titles=array("تجهیز عمیق ترین چاه آب شرب کشور بابهره گیری از کابل swr", "آزمون اندازه گیری مقاومت اهمی هادی", "آماده سازی نمونه پلیمر", "آزمون بررسی ویژگی های مکانیکی پلیمر", "تعیین میزان سختی پلیمرها در آزمایشگاه تخصصی سیمند کابل", "افتتاحیه ساختمان فردوسی", "جشنواره آب و فاضلاب 93", "سیزدهمین نمایشگاه آب و فاضلاب", "نمایشگاه آب و فاضلاب 93", "نمایشگاه آب و فاضلاب 94", "همایش ایران ژاپن 95", "همایش بیرجند سال 95", "همایش تبریز 93", "همایش حمایت از حقوق مصرف کنندگان 93", "همایش حمایت از حقوق مصرف کنندگان 94", "همایش حمایت از حقوق مصرف کنندگان95", "همایش مدیریت مصرف انرژی 95", "جنس پلیمر های متداول در تولید سیم و کابل", "نمايش سيگنالهاي VAG با استفاده از تبديلات", "۱۰ اشتباه خطرناک در سیم کشی برق ساختمان");
$post_files=array("https://kcam.ir/uploads/2017/12/3.jpg", "https://kcam.ir/uploads/2017/12/5.jpg", "https://kcam.ir/uploads/2017/12/6.jpg", "https://kcam.ir/uploads/2017/12/00.jpg", "https://kcam.ir/uploads/2017/12/ggtuyt.jpg", "https://kcam.ir/uploads/2017/12/IMG_0784_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_1513_1.jpg", "https://kcam.ir/uploads/2017/12/namayeshgah1_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_1472_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_4747_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_8123_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_8623_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_8435_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_0041_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_0065_1.jpg", "https://kcam.ir/uploads/2017/12/142A9568_1.jpg", "https://kcam.ir/uploads/2017/12/IMG_0664_1.jpg", "https://kcam.ir/uploads/2017/12/simandcable.jpg", "https://kcam.ir/uploads/2019/09/ubb-vga-schem.png", "https://kcam.ir/uploads/2020/02/kak-postavit-rozetku-v-kvartire-svoimi-rukami-10.jpg");
foreach($post_titles as $key=>$posttitle){
$post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_title LIKE'%" . $posttitle ."%' AND  post_status='publish' AND post_type='post'" );


if($post_id){


 
$image_url        = $post_files[$key]; // Define the image URL here
$image_name       = basename($image_url); ;
$upload_dir       = wp_upload_dir(); // Set upload folder
$image_data       = file_get_contents($image_url);  

if($image_data){
$unique_file_name = wp_unique_filename( $upload_dir['path'], $image_name ); // Generate unique name
$filename         = basename( $unique_file_name ); // Create image file name

// Check folder permission and define file location
if( wp_mkdir_p( $upload_dir['path'] ) ) {
    $file = $upload_dir['path'] . '/' . $filename;
} else {
    $file = $upload_dir['basedir'] . '/' . $filename;
}

// Create the image  file on the server
file_put_contents( $file, $image_data );

// Check image file type
$wp_filetype = wp_check_filetype( $filename, null );

// Set attachment data
$attachment = array(
    'post_mime_type' => $wp_filetype['type'],
    'post_title'     => sanitize_file_name( $filename ),
    'post_content'   => '',
    'post_status'    => 'inherit'
);

// Create the attachment
$attach_id = wp_insert_attachment( $attachment, $file, $post_id );

// Include image.php
require_once(ABSPATH . 'wp-admin/includes/image.php');

// Define attachment metadata
$attach_data = wp_generate_attachment_metadata( $attach_id, $file );

// Assign metadata to attachment
wp_update_attachment_metadata( $attach_id, $attach_data );

// And finally assign featured image to post
set_post_thumbnail( $post_id, $attach_id );
  echo $posttitle.'<br/>';
}
else{
    echo $posttitle.'aks kharab<br/>';
}
}
else{
    echo $posttitle.'post naod<br/>';
}
}

Youez - 2016 - github.com/yon3zu
LinuXploit