AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.139.82.132
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/modules/main/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/main/admin/wizard_export.php
<?
require_once(__DIR__."/../include/prolog_admin_before.php");
require_once($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/classes/general/wizard.php");
require_once($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/classes/general/tar_gz.php");

if(!$USER->CanDoOperation('edit_php') || !check_bitrix_sessid())
	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

IncludeModuleLangFile(__FILE__);

$ID = $_REQUEST["ID"];
$ID = str_replace("\\", "", $ID);
$ID = str_replace("/", "", $ID);

$bUseCompression = true;
if(!extension_loaded('zlib') || !function_exists("gzcompress"))
	$bUseCompression = false;

$HTTP_ACCEPT_ENCODING = "";

CheckDirPath($_SERVER['DOCUMENT_ROOT'].BX_PERSONAL_ROOT."/tmp/wizards/");
$tempFile = $_SERVER['DOCUMENT_ROOT'].BX_PERSONAL_ROOT."/tmp/wizards/".\Bitrix\Main\Security\Random::getString(32).".tar.gz";
$wizardPath = $_SERVER["DOCUMENT_ROOT"].CWizardUtil::GetRepositoryPath().CWizardUtil::MakeWizardPath($ID);

$strError = "";

if(is_dir($wizardPath))
{
	$oArchiver = new CArchiver($tempFile, $bUseCompression);
	$success = $oArchiver->add("\"".$wizardPath."\"", false, $_SERVER["DOCUMENT_ROOT"].CWizardUtil::GetRepositoryPath());

	if ($success)
	{
		$filename = str_replace(":", "-", $ID);
		$filename = str_replace(array("\r", "\n"), "", $filename);

		header('Pragma: public');
		header('Cache-control: private');
		header('Accept-Ranges: bytes');
		header("Content-Length: ".filesize($tempFile));
		header("Content-Type: application/x-force-download; filename=".$filename.".tar.gz");
		header("Content-Disposition: attachment; filename=\"".$filename.".tar.gz\"");
		header("Content-Transfer-Encoding: binary");

		readfile($tempFile);
		unlink($tempFile);
	}
	else
	{
		$strError .= GetMessage("MAIN_WIZARD_EXPORT_ERROR");
		$arErrors = &$oArchiver->GetErrors();
		if(!empty($arErrors))
		{
			$strError .= ":<br>";
			foreach ($arErrors as $value)
				$strError .= "[".$value[0]."] ".$value[1]."<br>";
		}
		else
			$strError .= ".<br>";
	}
}
else
	$strError .= GetMessage("MAIN_WIZARD_EXPORT_ERROR");

if ($strError <> '')
{
	$APPLICATION->SetTitle(GetMessage("MAIN_WIZARD_EXPORT_ERROR"));
	require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");

	CAdminMessage::ShowMessage($strError);

	require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin_before.php");
}
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin_after.php");
?>

Anon7 - 2022
AnonSec Team