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.137.181.69
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 /
plugins /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
0
B
-rw-r--r--
apache.py
19.06
KB
-rw-r--r--
apache_kafka.py
12.9
KB
-rw-r--r--
apache_zookeeper.py
6.26
KB
-rw-r--r--
bandwidth.py
21.3
KB
-rw-r--r--
cassandra.py
9.21
KB
-rw-r--r--
cert.py
2.78
KB
-rw-r--r--
couch.py
9.5
KB
-rw-r--r--
cpu_usage.py
33
KB
-rw-r--r--
dem_plugin.py
6.08
KB
-rw-r--r--
disk.py
16.48
KB
-rw-r--r--
docker.py
38.41
KB
-rw-r--r--
elasticsearch.py
2.83
KB
-rw-r--r--
entropy.py
900
B
-rw-r--r--
exim.py
1.01
KB
-rw-r--r--
file_presence.py
5
KB
-rw-r--r--
haproxy.py
13.37
KB
-rw-r--r--
io_stats.py
13.41
KB
-rw-r--r--
jboss.py
13.46
KB
-rw-r--r--
jmx.py
8.02
KB
-rw-r--r--
linux_logs.py
3.4
KB
-rw-r--r--
lm_sensors.py
2.51
KB
-rw-r--r--
logstash_forwarder.py
1.58
KB
-rw-r--r--
memcache.py
5.99
KB
-rw-r--r--
memory_usage.py
26.11
KB
-rw-r--r--
mongo.py
15.96
KB
-rw-r--r--
mysql.py
19.74
KB
-rw-r--r--
nagios.py
5.36
KB
-rw-r--r--
nginx.py
11.96
KB
-rw-r--r--
nodejs.py
6.29
KB
-rw-r--r--
ntp.py
1.98
KB
-rw-r--r--
opcache.py
2.26
KB
-rw-r--r--
oracle.py
15.15
KB
-rw-r--r--
package_upgrade.py
8.08
KB
-rw-r--r--
phpfpm.py
5.51
KB
-rw-r--r--
ping.py
2.45
KB
-rw-r--r--
postfix.py
1.98
KB
-rw-r--r--
postgresql.py
19.13
KB
-rw-r--r--
process.py
16.32
KB
-rw-r--r--
rabbitmq.py
19.33
KB
-rw-r--r--
redis.py
11.19
KB
-rw-r--r--
sendmail.py
2.39
KB
-rw-r--r--
sysctl.py
1.46
KB
-rw-r--r--
tcp.py
6.26
KB
-rw-r--r--
template.py
3.28
KB
-rw-r--r--
tomcat.py
6.79
KB
-rw-r--r--
tomcat_jmx.py
15.82
KB
-rw-r--r--
unbound_dns.py
4.54
KB
-rw-r--r--
uptime.py
3.46
KB
-rw-r--r--
users.py
1.09
KB
-rw-r--r--
uwsgi.py
4.57
KB
-rw-r--r--
varnish.py
4.79
KB
-rw-r--r--
weblogic.py
13.38
KB
-rw-r--r--
weblogic12c.py
18.75
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : package_upgrade.py
#from dateutil.parser import parse #from dateutil.relativedelta import relativedelta from datetime import datetime, date import time import gzip import os import agent_util import re DEBIAN = 1 REDHAT = 2 IS_DEBIAN = agent_util.which("/usr/bin/apt-get") is not None IS_REDHAT = agent_util.which("/usr/bin/yum") is not None class PackageUpgradePlugin(agent_util.Plugin): textkey = "package_upgrade" label = "Package Upgrades" @classmethod def get_metadata(self, config): package_count_status = agent_util.UNSUPPORTED package_date_status = agent_util.UNSUPPORTED package_count_msg = None package_date_msg = None if IS_DEBIAN or IS_REDHAT: package_date_status = agent_util.SUPPORTED if IS_DEBIAN: try: import apt_check if agent_util.execute_command("sudo /usr/bin/apt-get --version")[0] == 0: package_count_status = agent_util.SUPPORTED except: package_count_msg = "Insufficient permission - enable sudo access to apt-get for agent user" else: if PackageUpgradePlugin._can_use_sudo(): package_count_status = agent_util.SUPPORTED else: package_count_msg = "Insufficient permission - enable sudo access to yum for agent user" else: package_date_msg = "Unsupported platform" package_count_msg = "Unsupported platform" self.log.info("Unsupported platform") return {} metadata = { "packages.security": { "label": "Security-related packages waiting to be updated", "options": None, "status": package_count_status, "error_message": package_count_msg, "unit": "", "option_string": False }, "packages.nonsecurity": { "label": "Non-security-related packages waiting to be updated", "options": None, "status": package_count_status, "error_message": package_count_msg, "unit": "", "option_string": False }, "packages.lastupdated": { "label": "Days since the last package update was run", "options": None, "status": package_date_status, "error_message": package_date_msg, "unit": "", "option_string": False }, "packages.check_installation": { "label": "Check for Package installation", "options": None, "status": package_date_status, "error_message": package_date_msg, "unit": "", "option_string": True } } return metadata @classmethod def _can_use_sudo(self): """ Verify that the user running the agent has enough permissions to run. """ if agent_util.execute_command('sudo /usr/bin/yum --help')[0] == 0: return True else: self.log.error('Insufficient permission - Enable sudo access for agent user.') return False def check(self, textkey, data, config={}): if IS_DEBIAN: if textkey in ['packages.security', 'packages.nonsecurity']: try: import apt_check except: return 0 if agent_util.execute_command("sudo /usr/bin/apt-get update")[0] != 0: return 0 upgrades, security_updates = apt_check.check() if textkey == 'packages.security': return security_updates else: return upgrades if textkey == 'packages.security': return security_updates else: return upgrades elif textkey == 'packages.lastupdated': # Get list of apt history log files, from newest to oldest, search each one til we find an update files = agent_util.execute_command("ls -t /var/log/apt/history*")[1].strip().split('\n') for f in files: if f.endswith(".gz"): lines = agent_util.execute_command("zcat %s" % f)[1] else: lines = agent_util.execute_command("cat %s" % f)[1] matches = re.findall("Upgrade:.+\nEnd-Date:(.*)\n", lines) if matches: try: dt = matches[-1].strip() d, t = dt.split() d = datetime.strptime(d, "%Y-%m-%d") age = (datetime.now() - d).days return max(age, 0) except: self.log.error("Error parsing last upgrade time in %s" % f) # if we got here, we didn't find anything. Return None as a marker return None elif textkey == 'packages.check_installation': if data: command = "dpkg-query -l %s" % data.strip() if agent_util.execute_command(command)[0] != 0: return 0 else: return 1 elif IS_REDHAT: if textkey in ['packages.security', 'packages.nonsecurity']: if not self._can_use_sudo(): return None retcode, output = agent_util.execute_command("sudo yum check-update --security") if '\n\n' not in output: num_sec_packages = 0 else: num_sec_packages = len(output.split('\n\n')[-1].split('\n')) if textkey == 'packages.security': return num_sec_packages else: retcode, output = agent_util.execute_command("sudo yum check-update") if '\n\n' not in output: num_packages = 0 else: num_packages = len(output.split('\n\n')[-1].split('\n')) return max(0, num_packages - num_sec_packages) elif textkey == 'packages.lastupdated': # Get list of apt history log files, from newest to oldest, # search each one til we find an update if not self._can_use_sudo(): # Return 0 cause we can't determine the update time return None files = agent_util.execute_command("ls -t /var/log/yum.log*")[1].strip().split('\n') for f in files: lines = agent_util.execute_command("sudo zgrep -A 1 Updated: %s | tail -n 1" % f)[1].strip().split('\n') if len(lines) >= 1: d = lines[-1][:6] if not d: # Logs came up empty due to rotation. continue try: d = datetime.strptime(d, "%b %d").replace(year=date.today().year) except AttributeError: # strptime doesn't appeared until Py2.5, using fallback time. d = datetime(*(time.strptime(d, '%b %d')[0:6])).replace(year=date.today().year) if d > datetime.now(): d = d.replace(year=date.today().year-1) age = (datetime.now() - d).days return max(age, 0) elif textkey == 'packages.check_installation': if data: command = "rpm -qi %s" % data.strip() if agent_util.execute_command(command)[0] != 0: return 0 else: return 1 # if we got here, we didn't find anything. Return None as a marker return None # If we get here, we aren't running on a system where we can actually determine what's available. # Default to None to signify error. return None
Close