!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/nucleo/lib/   drwxr-xr-x
Free 14.92 GB of 61.93 GB (24.09%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

    
class toba_hash
{
    protected 
$rounds 10;
    protected 
$metodo 'bcrypt';    
    private  
$randomState null;
    private 
$indicadores_hash = array('$5$''$6$''$1$');
    private 
$indicadores_bcrypt = array('$2y$','$2a$''$2x$');
    
    
    public final function 
__construct($metodo=null)
    {
        if (
version_compare(PHP_VERSION'5.3.2') < 0) {
            throw new 
toba_error('Se requiere PHP 5.3.2 al menos para usar esta clase');
        }
        
        if (! 
is_null($metodo)) {
            
$this->metodo $metodo;
        }
    }
    
    public function 
set_ciclos($nro)
    {
        
$this->rounds = ($nro 10) ? $nro 10;
    }
    
    public function 
hash($input
    {
        
$hash crypt($input$this->getSalt());
        if(
strlen($hash) > 13) {
            return 
$hash;
        }
        throw new 
toba_error('Se produjo un error al crear el hash');
    }

    public function 
get_hash_verificador($input$existingHash)
    {        
        return  
crypt($input$existingHash);
    }
        
    public function 
verify($input$existingHash
    {
        
$hash crypt($input$existingHash);
        return (
$hash === $existingHash);
    }
        
    private function 
getSalt() 
    {        
        switch(
strtoupper($this->metodo)) {        
        case 
'BCRYPT' $str_inicial = (version_compare(PHP_VERSION'5.3.7') < 0) ? "$2a$""$2y$";
                      
$salt sprintf($str_inicial.'%02d$'$this->rounds);   
                       break;
        
        case 
'SHA512'
                    
$vueltas = ($this->rounds 1000) ? $this->rounds 1000$this->rounds 5000;
                    
$salt sprintf('$6$rounds=%d$'$this->rounds);
                     break;
                 
        case 
'SHA256'
                    
$vueltas = ($this->rounds 1000) ? $this->rounds 1000$this->rounds 5000;
                    
$salt sprintf('$5$rounds=%d$'$this->rounds);
                     break;

        case 
'MD5':      $salt '$1$';
        
        default: 
                    
toba::logger()->debug("Se suministro un algoritmo no esperado para el hash: {$this->metodo}");
                    
$salt '';
        }
        
        
$bytes $this->getRandomBytes(16);
        
$salt .= $this->encodeBytes($bytes);
        return 
$salt;
    }    
    
    
//-----------------------------------------------------------------------------------------------------------------------------------------//
    //            FUNCIONES PARA GENERAR SALT (tomadas de bcrypt.php @StackOverflow)
    //-----------------------------------------------------------------------------------------------------------------------------------------//
    
    
private function getRandomBytes($count
    {
        
$bytes '';
        if(
function_exists('openssl_random_pseudo_bytes') &&    (strtoupper(substr(PHP_OS03)) !== 'WIN')) { // OpenSSL slow on Win
            
$bytes openssl_random_pseudo_bytes($count);
        }
        if(
$bytes === '' && is_readable('/dev/urandom') && ($hRand = @fopen('/dev/urandom''rb')) !== FALSE) {
            
$bytes fread($hRand$count);
            
fclose($hRand);
        }
        
        if(
strlen($bytes) < $count) {
            
$bytes '';
            if(
$this->randomState === null) {
                
$this->randomState microtime();
                if(
function_exists('getmypid')) {
                    
$this->randomState .= getmypid();
                }
            }

            for(
$i 0$i $count$i += 16) {
                
$this->randomState md5(microtime() . $this->randomState);
                if (
PHP_VERSION >= '5') {
                    
$bytes .= md5($this->randomStatetrue);
                } else {
                    
$bytes .= pack('H*'md5($this->randomState));
                }
            }

            
$bytes substr($bytes0$count);
        }
        return 
$bytes;
    }

    private function 
encodeBytes($input) {
        
// The following is code from the PHP Password Hashing Framework
        
$itoa64 './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

        
$output '';
        
$i 0;
        do {
            
$c1 ord($input[$i++]);
            
$output .= $itoa64[$c1 >> 2];
            
$c1 = ($c1 0x03) << 4;
            if (
$i >= 16) {
                
$output .= $itoa64[$c1];
                break;
            }

            
$c2 ord($input[$i++]);
            
$c1 |= $c2 >> 4;
            
$output .= $itoa64[$c1];
            
$c1 = ($c2 0x0f) << 2;

            
$c2 ord($input[$i++]);
            
$c1 |= $c2 >> 6;
            
$output .= $itoa64[$c1];
            
$output .= $itoa64[$c2 0x3f];
        } while (
1);
        return 
$output;
    }
}
?>

:: 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.7997 ]--