!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/php/contrib/lib/   drwxr-xr-x
Free 14.52 GB of 61.93 GB (23.44%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     toba_manejador_procesos.php (2.58 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
*    Manipulacion de procesos Windows/Linux
* @package Varios
*/
class toba_manejador_procesos
{
    function 
background($command)
    {
        if (
strtoupper(substr(PHP_OS03)) === 'WIN')
            return 
self::background_win($command);
        else 
            return 
self::background_linux($command);        
    }

    function 
is_running($PID)
    {
        if (
strtoupper(substr(PHP_OS03)) === 'WIN')
            return 
self::is_running_win($PID);
        else 
            return 
self::is_running_linux($PID);    
    }

    function 
kill($PID)
    {
        if (
strtoupper(substr(PHP_OS03)) === 'WIN')
            return 
self::kill_win($PID);
        else 
            return 
self::kill_linux($PID);
    }

    function 
buscar_pids($match)
    {
        if (
strtoupper(substr(PHP_OS03)) === 'WIN')
            return 
self::buscar_pids_win($match);
        else 
            return 
self::buscar_pids_linux($match);
    }

    function 
crear_identificador($id)
    {
        return 
"pid_sistema_$id";
    }

    function 
quitar_identificador($cadena)
    {
        return 
str_replace('pid_sistema_','',$cadena);
    }

    
// LINUX ------------------------------------------------------------------------------------
    // Ojo: Si el comando es un scritp, devuelve solo su PID. 
    // Por ej: un script que haga "toba ejecutar item ...." genera 3 procesos:
    //  - Uno para el script.
    //    - Uno para el script toba.
    //    - Uno para php.

    
function background_linux($command)
    {
        
$PID trim(shell_exec("nohup $command > /dev/null & echo $!"));
        return(
$PID);
    }

    function 
is_running_linux($PID)
    {
        
exec("ps $PID"$ProcessState);
        return(
count($ProcessState) >= 2);
    }

    function 
kill_linux($PID)
    {
        if (
self::is_running($PID))    {
            
exec("kill -KILL $PID");
            return 
true;
        } else
               return 
false;
    }

    
/**
     * Busca los PIDs de todos los procesos que matcheen con el parametro de entrada $match.
     * Retorna un arreglo con los PIDs.
     *
     * @param string $match
     * @return array
     */
    
function buscar_pids_linux($match)
    {
        
$match escapeshellarg($match);
        
exec("ps fx|grep $match|grep -v grep|awk '{print $1}'"$output$ret);
        if(
$ret) return 'you need ps, grep, and awk installed for this to work';
        return 
$output;
    }

    
// WINDOWS ----------------------------------------------------------------------------------

    
function background_win($command)
    {
        
$WshShell = new COM("WScript.Shell");
        return 
$WshShell->Run($command0false);
    }

    function 
is_running_win($pid)
    {
        
//NO IMPLEMENTADO
        
return false;
    }

    function 
kill_win($pid)
    {
        
//NO IMPLEMENTADO
        
return false;
    }

    function 
buscar_pids_win($match)
    {
        
//NO IMPLEMENTADO
        
return array();
    }
}

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.8039 ]--