[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: revisium.py
File is not writable. Editing disabled.
""" This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> """ import csv import json import os import sys import time from contextlib import suppress from pathlib import Path from typing import Optional from defence360agent.contracts.config import Core from defence360agent.utils import snake_case class RevisiumTempFile: ext = "txt" def __init__(self, tempdir=None, mode=None): self.tempdir = Path(Core.TMPDIR) if tempdir is None else Path(tempdir) self.mode = mode def __enter__(self): filename = "%s_%d.%s" % (self.name, int(time.time() * 10e6), self.ext) self._path = self.tempdir / filename if self.mode: self._path.touch() os.chmod(str(self._path), mode=self.mode) return self def __exit__(self, *_): with suppress(FileNotFoundError): self._path.unlink() @property def filename(self): return str(self._path) @property def name(self): return snake_case(self.__class__.__name__) class RevisiumJsonFile(RevisiumTempFile): ext = "json" def read(self): with self._path.open() as f: return json.load(f) class RevisiumCSVFile(RevisiumTempFile): ext = "csv" @staticmethod def _convert_boolean(value: Optional[str]): if value: low_value = value.lower() if low_value in ["true", "false"]: return low_value == "true" elif value is None: return "" return value def read(self): with self._path.open( encoding=sys.getfilesystemencoding(), errors=sys.getfilesystemencodeerrors(), ) as f: reader = csv.DictReader( f, fieldnames=["f", "e", "d", "s", "t", "r"] ) return [ { field: self._convert_boolean(value) for field, value in row.items() if field is not None # ignore unknown fields } for row in reader ]
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.34 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A