PATH: //proc/self/root/usr/local/lib/python3.9/site-packages/agent360/plugins
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📁 __pycache__/
X
📄 apt-updates.py
↓
X
📄 asterisk.py
↓
X
📄 bind.py
↓
X
📄 bird.py
↓
X
📄 bitninja.py
↓
X
📄 cloudlinux-dbgov.py
↓
X
📄 cloudlinux.py
↓
X
📄 cpanel.py
↓
X
📄 cpu.py
↓
X
📄 cpu_freq.py
↓
X
📄 dirsize.py
↓
X
📄 diskinodes.py
↓
X
📄 diskstatus-nvme.py
↓
X
📄 diskstatus.py
↓
X
📄 diskusage.py
↓
X
📄 docker.py
↓
X
📄 dovecot.py
↓
X
📄 elasticsearch.py
↓
X
📄 exim.py
↓
X
📄 fail2ban.py
↓
X
📄 gpu.py
↓
X
📄 haproxy.py
↓
X
📄 httpd.py
↓
X
📄 iostat.py
↓
X
📄 janus.py
↓
X
📄 kamailio.py
↓
X
📄 litespeed.py
↓
X
📄 loadavg.py
↓
X
📄 loggedin.py
↓
X
📄 mailq.py
↓
X
📄 mdstat.py
↓
X
📄 megacli.py
↓
X
📄 memcached.py
↓
X
📄 memory.py
↓
X
📄 minecraft.py
↓
X
📄 mongodb.py
↓
X
📄 mysql.py
↓
X
📄 network.py
↓
X
📄 nginx.py
↓
X
📄 openvpn.py
↓
X
📄 phpfpm.py
↓
X
📄 ping.py
↓
X
📄 plesk-cgroups.py
↓
X
📄 plugins.py
↓
X
📄 postfix.py
↓
X
📄 powerdns.py
↓
X
📄 process.py
↓
X
📄 proftpd.py
↓
X
📄 rabbitmq.py
↓
X
📄 redis_stat.py
↓
X
📄 sleeper.py
↓
X
📄 swap.py
↓
X
📄 system.py
↓
X
📄 tcpports.py
↓
X
📄 temp.py
↓
X
📄 unbound.py
↓
X
📄 vms.py
↓
X
📄 wp-toolkit.py
↓
X
📄 yum-updates.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: minecraft.py
import plugins import socket import struct import json class Plugin(plugins.BasePlugin): __name__ = 'minecraft' def run(self, config): ''' Fetch the amount of active and max players add to /etc/agent360.ini [minecraft] enabled=yes hosts=127.0.0.1:8000,127.0.0.2:8000... ''' my_hosts = config.get('minecraft', 'hosts').split(',') result = {} for connection_string in my_hosts: try: # Connect s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) hostname = connection_string.split(':')[0] port = int(connection_string.split(':')[1]) s.connect((hostname, port)) # Send handshake + status request s.send(self.pack_data("\x00\x00" + self.pack_data(hostname.encode('utf8')) + self.pack_port(port) + "\x01")) s.send(self.pack_data("\x00")) # Read response self.unpack_varint(s) # Packet length self.unpack_varint(s) # Packet ID l = self.unpack_varint(s) # String length d = "" while len(d) < l: d += s.recv(1024) # Close our socket s.close() except: pass results = {} try: players = json.loads(d.decode('utf8'))['players'] results['online'] = int(players['online']) results['max'] = int(players['max']) except: results['online'] = 0 results['max'] = 0 result[str(connection_string.replace('.', '-'))] = results return result def unpack_varint(self, s): d = 0 for i in range(5): b = ord(s.recv(1)) d |= (b & 0x7F) << 7*i if not b & 0x80: break return d def pack_varint(self, d): o = "" while True: b = d & 0x7F d >>= 7 o += struct.pack("B", b | (0x80 if d > 0 else 0)) if d == 0: break return o def pack_data(self, d): return self.pack_varint(len(d)) + d def pack_port(self, i): return struct.pack('>H', i) if __name__ == '__main__': Plugin().execute()
SIMPAN PERUBAHAN