!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache. PHP/5.3.29 

uname -a: Linux tardis23.nocplanet.net 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024
x86_64
 

 

Safe-mode: OFF (not secure)

/opt/imunify360/venv/share/imunify360/scripts/migrate_csf/   drwxr-xr-x
Free 1008.8 GB of 1859.98 GB (54.24%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     csf_conf.py (1.34 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import re
from logger_config import get_logger


def get_csf_config_value(
    var_name: str, config_file="/etc/csf/csf.conf"
) -> str | None:
    logger = get_logger()
    try:
        with open(config_file, "r") as f:
            for line in f:
                # Strip whitespace and skip empty lines and comments
                line = line.strip()
                if not line or line.startswith("#"):
                    continue

                # Match pattern: VAR_NAME = "value" (with flexible whitespace)
                # This regex handles:
                # - Optional whitespace around = (e.g. VAR_NAME="value" or VAR_NAME= "value")
                # - Quoted values (double quotes, single quotes are not valid in CSF config)
                # - Captures the value inside quotes (e.g. "value")
                pattern = rf'^{re.escape(var_name)}\s*=\s*["]([^"]*)["]'
                match = re.match(pattern, line)

                if match:
                    return match.group(1)

        # Variable not found
        return None

    except FileNotFoundError:
        logger.error(f"Config file {config_file} not found")
        return None
    except PermissionError:
        logger.error(f"Permission denied reading {config_file}")
        return None
    except Exception as e:
        logger.error(f"Error reading config file: {e}")
        return None

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.5767 ]--