!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)

/usr/lib/python3/dist-packages/uaclient/files/   drwxr-xr-x
Free 28.57 GB of 117.98 GB (24.22%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     files.py (2.63 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import json
import logging
import os
from typing import Any, Dict, Optional

from uaclient import defaults, event_logger, exceptions, system, util

event = event_logger.get_event_logger()
LOG = logging.getLogger(util.replace_top_level_logger_name(__name__))


class UAFile:
    def __init__(
        self,
        name: str,
        directory: str = defaults.DEFAULT_DATA_DIR,
        private: bool = True,
    ):
        self._directory = directory
        self._file_name = name
        self._is_private = private
        self._path = os.path.join(self._directory, self._file_name)

    @property
    def path(self) -> str:
        return self._path

    @property
    def is_private(self) -> bool:
        return self._is_private

    @property
    def is_present(self):
        return os.path.exists(self.path)

    def write(self, content: str):
        file_mode = (
            defaults.ROOT_READABLE_MODE
            if self.is_private
            else defaults.WORLD_READABLE_MODE
        )
        # try/except-ing here avoids race conditions the best
        try:
            if os.path.basename(self._directory) == defaults.PRIVATE_SUBDIR:
                os.makedirs(self._directory, mode=0o700)
            else:
                os.makedirs(self._directory)
        except OSError:
            pass

        system.write_file(self.path, content, file_mode)

    def read(self) -> Optional[str]:
        content = None
        try:
            content = system.load_file(self.path)
        except FileNotFoundError:
            LOG.debug("Tried to load %s but file does not exist", self.path)
        return content

    def delete(self):
        system.ensure_file_absent(self.path)


class ProJSONFile:
    def __init__(
        self,
        pro_file: UAFile,
    ):
        self.pro_file = pro_file

    def write(self, content: Dict[str, Any]):
        self.pro_file.write(
            content=json.dumps(content, cls=util.DatetimeAwareJSONEncoder)
        )

    def read(self) -> Optional[Dict[str, Any]]:
        content = self.pro_file.read()

        if content:
            try:
                return json.loads(content, cls=util.DatetimeAwareJSONDecoder)
            except json.JSONDecodeError as e:
                raise exceptions.InvalidJson(
                    source=self.pro_file.path, out="\n" + str(e)
                )

        return None

    def delete(self):
        return self.pro_file.delete()

    @property
    def is_present(self):
        return self.pro_file.is_present


class UserCacheFile(UAFile):
    def __init__(self, name: str):
        super().__init__(
            name, directory=system.get_user_cache_dir(), private=False
        )

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

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