Prv8 Shell
Server : Apache
System : Linux ecngx264.inmotionhosting.com 4.18.0-553.77.1.lve.el8.x86_64 #1 SMP Wed Oct 8 14:21:00 UTC 2025 x86_64
User : lonias5 ( 3576)
PHP Version : 7.3.33
Disable Function : NONE
Directory :  /opt/support/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/support/lib/output.py
import sys
from collections.abc import Callable
import netaddr
from rads.color import green, red, bold, yellow


def err_exit(*args, file=sys.stderr, rcode=1, **kwargs):
    color_print(*args, color=red, file=file, **kwargs)
    sys.exit(rcode)


def warn(*args, file=sys.stderr, color: Callable = red, **kwargs):
    color_print(*args, color=color, file=file, **kwargs)


def print_listed(ipaddr: netaddr.IPAddress, listed: bool, where: str):
    """For printing whether an IP is listed in iptables"""
    print(
        f'The IP {ipaddr}',
        red('is listed') if listed else green('is not listed'),
        f'in {where}',
    )


def print_fail2ban_listed(jail: str, ports: str):
    if 'ALL' in ports:
        blocked_on = 'ALL ports'
    else:
        blocked_on = f'ports {ports}'
    warn(
        f'Automatically blocked by fail2ban in the {jail} jail '
        f'on {red(blocked_on)}',
        color=yellow,
    )


def header(*args, color: Callable = bold, **kwargs):
    color_print(*args, color=color, **kwargs)


def color_print(*args, color: Callable = red, **kwargs):
    out = color(*args)
    if isinstance(out, str):
        print(out, **kwargs)
    else:
        print(*out, **kwargs)

@StableExploit - 2025