!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/local/lsws/add-ons/webcachemgr/src/   drwxr-xr-x
Free 13.06 GB of 57.97 GB (22.54%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     DashNotifier.php (8.01 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/** *********************************************
 * LiteSpeed Web Server WordPress Dash Notifier
 *
 * @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com)
 * @copyright (c) 2019
 * *******************************************
 */

namespace Lsc\Wp;

use 
\Lsc\Wp\Context\Context;

class 
DashNotifier
{

    const 
BYPASS_FLAG '.dash_notifier_bypass';
    const 
DASH_MD5 'dash_md5';
    const 
DASH_PLUGIN 'dash-notifier/dash-notifier.php';
    const 
DEFAULT_PLUGIN_PATH '/wp-content/plugins/dash-notifier';

    
/**
     * @deprecated 1.9
     */
    
const DOWNLOAD_DIR '/usr/src/litespeed-wp-plugin';

    const 
PLUGIN_NAME 'dash-notifier';
    const 
VER_FILE 'dash_ver';

    private function 
__construct()
    {

    }

    
/**
     *
     * @since 1.9
     *
     * @return void
     * @throws LSCMException  Thrown indirectly.
     */
    
public static function prepLocalDashPluginFiles()
    {
        
$dashVerFile Context::LOCAL_PLUGIN_DIR '/' self::VER_FILE;

        if ( ! 
file_exists($dashVerFile) ) {
            
$latestVer self::getLatestVersion();
            
self::downloadVersion($latestVer);
            return;
        }

        
$localVer trim(file_get_contents($dashVerFile));

        
$pluginDir Context::LOCAL_PLUGIN_DIR '/' self::PLUGIN_NAME;

        if ( ! 
file_exists($pluginDir) ) {
            
self::downloadVersion($localVer);
            return;
        }

        
$md5File Context::LOCAL_PLUGIN_DIR '/' self::DASH_MD5;
        
$md5StoredVal file_get_contents($md5File);
        
$md5Val Util::DirectoryMd5($pluginDir);

        if ( 
$md5StoredVal != $md5Val ) {
            
self::downloadVersion($localVer);
            return;
        }

        
clearstatcache();

        if ( (
time() - filemtime($dashVerFile)) > 86400 ) {

            try {
                
$latestVer self::getLatestVersion();

                if ( 
version_compare($latestVer$localVer'<') ) {
                    
self::downloadVersion($latestVer);
                }
            }
            catch ( 
LSCMException $e ) {
                
Logger::error($e->getMessage());
            }

            
touch($dashVerFile);
        }
    }

    
/**
     *
     * @since 1.9
     *
     * @return string
     * @throws LSCMException
     */
    
public static function getLatestVersion()
    {
        
$latestVer '';
        
$latestVerUrl 'https://www.litespeedtech.com/packages/lswpcache/dash_latest';

        
$content Util::get_url_contents($latestVerUrl);

        if ( empty(
$content) ) {
            throw new 
LSCMException('Could not retrieve latest Dash Notifier plugin version');
        }

        
$latestVer trim($content);

        return 
$latestVer;
    }

    
/**
     *
     * @since 1.9
     *
     * @param string  $version
     * @throws LSCMException  Thrown indirectly.
     */
    
protected static function downloadVersion$version )
    {
        
$pluginDir Context::LOCAL_PLUGIN_DIR '/' self::PLUGIN_NAME;

        if ( 
file_exists($pluginDir) ) {
            
exec("/bin/rm -rf {$pluginDir}");
        }

        
self::wgetPlugin($versiontrue);
    }

    
/**
     *
     * @since 1.9
     *
     * @param string   $version
     * @param boolean  $saveMD5
     * @throws LSCMException  Thrown directly and indirectly.
     */
    
protected static function wgetPlugin$version$saveMD5 false )
    {
        
Logger::info("Downloading Dash Notifier v{$version}...");

        
$pluginDir Context::LOCAL_PLUGIN_DIR '/' self::PLUGIN_NAME;
        
$zipFileName self::PLUGIN_NAME ".{$version}.zip";
        
$localZipFile Context::LOCAL_PLUGIN_DIR "/{$zipFileName}";

        
$url "https://downloads.wordpress.org/plugin/{$zipFileName}";
        
$wget_command "wget -q --tries=1 --no-check-certificate {$url} -P "
                
Context::LOCAL_PLUGIN_DIR;

        
exec($wget_command$output$return_var);

        if ( 
$return_var !== ) {
            throw new 
LSCMException("Failed to download Dash Notifier v{$version} with wget "
                    
"exit status {$return_var}."LSCMException::E_NON_FATAL);
        }

        
$extracted Util::unzipFile($localZipFileContext::LOCAL_PLUGIN_DIR);
        
unlink($localZipFile);

        if ( ! 
$extracted ) {
            throw new 
LSCMException("Unable to unzip {$localZipFile}",
                    
LSCMException::E_NON_FATAL);
        }

        
$testfile "{$pluginDir}/" self::PLUGIN_NAME '.php';

        if ( ! 
file_exists($testfile) ) {
            throw new 
LSCMException("Unable to download Dash Notifier v{$version}.",
                    
LSCMException::E_NON_FATAL);
        }

        if ( 
$saveMD5 ) {
            
$md5Val Util::DirectoryMd5($pluginDir);
            
file_put_contents(Context::LOCAL_PLUGIN_DIR '/'
                    
self::DASH_MD5$md5Val);
        }

        
file_put_contents(Context::LOCAL_PLUGIN_DIR '/' self::VER_FILE,
                
$version);
    }

    
/**
     * Check if WordPress installation should be notified using the Dash
     * Notifier plugin.
     *
     * @param string  $wpPath  WordPress installation root directory.
     * @return boolean
     */
    
public static function canNotify$wpPath )
    {
        if ( 
file_exists("{$wpPath}/" self::BYPASS_FLAG) ) {
            return 
false;
        }

        return 
true;
    }

    
/**
     * Checks the current installation for existing LSCWP plugin files and
     * copies them to the installation's plugins directory if not found.
     * This function should only be run as the user.
     *
     * @return boolean            True when new Dash Notifier plugin files are
     *                             used.
     * @throws LSCMException
     */
    
public static function prepareUserInstall()
    {
        
$pluginDir WP_PLUGIN_DIR;

        
$dashNotifierPlugin "{$pluginDir}/dash-notifier/dash-notifier.php";

        if ( 
file_exists($dashNotifierPlugin) ) {
            
/**
             * Existing installation detected.
             */
            
return false;
        }

        
$pluginSrc Context::LOCAL_PLUGIN_DIR '/' self::PLUGIN_NAME;
        
exec("/bin/cp -rf {$pluginSrc} {$pluginDir}");

        if ( !
file_exists($dashNotifierPlugin) ) {
            throw new 
LSCMException("Failed to copy Dash Notifier plugin files to "
            
"{$pluginDir}."LSCMException::E_NON_FATAL);
        }

        
Logger::debug("Copied Dash Notifier plugin files into plugins directory {$pluginDir}");

        return 
true;
    }

    
/**
     * Activate Dash Notifier plugin if it is not already activated, and give
     * the plugin any notification data in the form of a JSON encoded array.
     *
     * @param string  $jsonInfo  Dash Notifier plugin info.
     * @return boolean
     * @throws LSCMException
     */
    
public static function doNotify$jsonInfo )
    {

        if ( 
file_exists(WP_PLUGIN_DIR '/' self::DASH_PLUGIN) ) {

            
/**
             * Used to pass info to the Dash Notifier Plugin.
             */
            
define'DASH_NOTIFIER_MSG'$jsonInfo);

            if ( !
is_plugin_active(self::DASH_PLUGIN) ) {

                
/**
                * Should not check directly, can error on success due to object
                * cache.
                */
               
activate_plugin(self::DASH_PLUGIN''falsefalse);

               if ( !
is_plugin_active(self::DASH_PLUGIN) ) {
                   return 
false;
               }
            }
            else {
                include 
WP_PLUGIN_DIR '/' self::DASH_PLUGIN;
            }
        }
        else {
            throw new 
LSCMException('Dash Notifier plugin files are missing. Cannot notify.',
                    
LSCMException::E_NON_FATAL);
        }

        return 
true;
    }

    
/**
     * WP Functions: deactivate_plugins(), delete_plugins()
     *
     * @param boolean  $uninstall
     */
    
public static function deactivate$uninstall )
    {
        
deactivate_plugins(self::DASH_PLUGIN);

        if ( 
$uninstall ) {
            
//add some msg about having removed plugin files?
            
delete_plugins(array( self::DASH_PLUGIN ));
        }
    }

}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.007 ]--