!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.25 GB of 96.73 GB (86.07%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     dynamic_things_counter.php (3.19 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/env php
<?php

    
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)
    {
        echo 
"Analysing $dir\n";
        
$files get_all_files ($dir);
        foreach (
$files as $file)
        {
            
$file_stats get_file_stats ($file);
            if (
$file_stats === NULL 
                    
|| ($file_stats[0] == (string)"0" && $file_stats[1] == (string)"0" && $file_stats[2] == (string)"0"))
            {
                continue;
            }
            else
                if (
$argv[1] == "-delete")    
                {
                    `
rm -r -f $dir`;
                    echo 
"Deleting $dir\n";
                    continue 
2;
                }

            
add_stat ($dir$file$file_stats);
            echo 
"$file\n";
        }
    }

    
aggregate_stats ();
    
dump_stats ();


    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 
get_file_stats ($file)
    {
        
$result _exec ("src/phc $file --run plugins/tools/dynamic_things.la 2>/dev/null");
        
$result rtrim ($result);

        if (
$result == "")
            return 
NULL;


        
$result split (":"$result);
        
$result split (","$result[1]);
        return 
$result;
    }

    function 
add_stat ($package$file$file_stats)
    {
        global 
$stats;
        
$linecount = (int)(_exec ("cat $file | wc -l"));

        
$stats[$package]["eval"] += $file_stats[0];
        
$stats[$package]["include"] += $file_stats[1];
        
$stats[$package]["dynamic_include"] += $file_stats[2];
        
$stats[$package]["filecount"] += 1;
        
$stats[$package]["linecount"] += $linecount;

        
$stats["all"]["eval"] += $file_stats[0];
        
$stats["all"]["include"] += $file_stats[1];
        
$stats["all"]["dynamic_include"] += $file_stats[2];
        
$stats["all"]["filecount"] += 1;
        
$stats["all"]["linecount"] += $linecount;
    }

    function 
aggregate_stats ()
    {
        global 
$stats;

        
# Calculate averages
        
$package_count count ($stats) - 1;
        foreach (array (
"eval""include""dynamic_include""filecount""linecount") as $name)
        {
            
$stats["average"][$name] = $stats["all"][$name] / $package_count;
        }

        
# How many have at least 1?
        
foreach ($stats as $package => $actual_stats)
        {
            if (
$package == "all" || $package == "average" || $package == "aggregate")
                continue;

                
            foreach (
$actual_stats as $key => $val)
            {
                if (
$val >= 1)
                    
$stats["aggregate"][$key] += 1;
            }

            if (
$actual_stats["eval"] >= || $actual_stats["dynamic_include"] >= 1)
            {
                
$stats["aggregate"]["either"] += 1;
            }
        }
    }

    function 
dump_stats ()
    {
        global 
$stats;

        foreach (
$stats as $package => $actual_stats)
        {
            if (
$package == "all" || $package == "average" || $package == "aggregate")
            {
                print 
"$package";
                foreach (
$actual_stats as $key => $val)
                {
                    print 
", $key = $val";
                }
                print 
"\n";
            }
        }
    }

    function 
_exec ($command)
    {
        
// 20 seconds, max
        
list ($output) = complete_exec ($commandNULL20);
        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.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.0051 ]--