!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023
aarch64
 

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

Safe-mode: OFF (not secure)

/home/scripts/pba/phc-read-only/misc/   drwxrwxr-x
Free 83.26 GB of 96.73 GB (86.08%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     replace_concat_includes.php (1.91 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/env php
<?php
/*
*
* Replaces define ("MYCONSTANT", "mydir/"); include (MYCONSTANT."myfile.php"); with include ("mydir/"."myfile.php");
* in all php files in downloaded_php/downloads
*
* TODO:  This isn't working properly.  Probably need to escape more characters passed to r-option.  This is probably best done in 
* the replace_include_constants plugin, however.
*/

    
include ("test/framework/lib/header.php");

    function 
eh ($errno$errstr)
    {
        if (
$errno == E_NOTICE)
            return;

        print 
"$errno$errstr";
    }

    
set_error_handler ("eh"E_ALL);



    
$directory_name "downloaded_php/downloads/";

    
$dirs get_directories ($directory_name);
    foreach (
$dirs as $dir)
    {
        
$defines "";
        
$i 0;
        
$files get_all_files ($dir);
        foreach (
$files as $file)
        {
            if (
$file != NULL)
            {
                
$defines $defines.get_defines ($file);    
                echo 
"Analysing $file\n";
            }
        }
        foreach (
$files as $file)
        {
            echo 
"Applying changes to $file\n";
            
apply_changes ($file$defines);    
            
        }

    }



    function 
get_directories ($dirname)
    {
        
$result = array ();

        foreach (new 
DirectoryIterator($dirname) as $fileInfo)
        {
            if (
$fileInfo->isDot())
                continue;

            
$result[] = $fileInfo->getPathname ();
        }

        return 
$result;
    }

    function 
get_all_files ($dir)
    {
        
$results split ("\n"_exec ("find $dir/ -type f -name \"*.php\""));
        
array_pop ($results);
        return 
$results;
    }

    
    function 
_exec ($command)
    {
        
// 20 seconds, max
        
list ($output) = complete_exec ($commandNULL20);
        return 
$output;
    }

    function 
get_defines ($file)
    {
        
$command "src/phc $file --run plugins/tools/get_defines.la 2>/dev/null";
        return 
_exec ($command);
    }

    function 
apply_changes ($file$defines)
    {
        
$command "src/phc $file --run plugins/tools/replace_include_constants.la --r-option='$defines' --dump=decomment 2>/dev/null";
        
$newcode _exec ($command);
        
$fh fopen ($file"w");
        
fwrite ($fh$newcode);
        
fclose ($fh);
    }
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.0041 ]--