asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T cyberpanel.pl000064400000013205151030256710007226 0ustar00#!/usr/bin/perl ############################################################################### # Copyright 2006-2023, Way to the Web Limited # URL: http://www.configserver.com # Email: sales@waytotheweb.com ############################################################################### # start main use strict; use File::Find; use Fcntl qw(:DEFAULT :flock); use Sys::Hostname qw(hostname); use IPC::Open3; use lib '/usr/local/csf/lib'; use ConfigServer::DisplayUI; use ConfigServer::Config; our ($script, $images, $myv, %FORM, %in); my $config = ConfigServer::Config->loadconfig(); my %config = $config->config; open (my $IN, "<", "/etc/csf/version.txt"); $myv = <$IN>; close ($IN); chomp $myv; $script = "/configservercsf/iframe/"; $images = "/static/configservercsf"; my $file = $ARGV[0]; unless (-e $file) {die "Cannot find tempfile [$file]"} my (undef,undef,$uuid,$ugid) = getpwnam("cyberpanel"); my $uid = (stat($file))[4]; my $gid = (stat($file))[5]; if ($uid != $uuid or $gid != $ugid) {die "Invalid tempfile ownership [$file]"} open (my $DATA, "<", $file); my $buffer = <$DATA>; close ($DATA); my @pairs = split(/&/, $buffer); foreach my $pair (@pairs) { my ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } #print "
$ARGV[0]:$ARGV[1]:[[$buffer]]
\n"; #foreach my $key (keys %ENV) { # print "$key = [$ENV{$key}]
\n"; #} my $bootstrapcss = ""; my $jqueryjs = ""; my $bootstrapjs = ""; unless ($FORM{action} eq "tailcmd" or $FORM{action} =~ /^cf/ or $FORM{action} eq "logtailcmd" or $FORM{action} eq "loggrepcmd") { print < ConfigServer Security & Firewall $bootstrapcss $jqueryjs $bootstrapjs \n"; print <

ConfigServer Security & Firewall - csf v$myv

EOF } #my $templatehtml; #open (my $SCRIPTOUT, '>', \$templatehtml); #select $SCRIPTOUT; ConfigServer::DisplayUI::main(\%FORM, $script, $script, $images, $myv); #close ($SCRIPTOUT); #select STDOUT; #open (OUT, ">/tmp/out.html"); #print OUT $templatehtml; #close (OUT); #print $templatehtml; unless ($FORM{action} eq "tailcmd" or $FORM{action} =~ /^cf/ or $FORM{action} eq "logtailcmd" or $FORM{action} eq "loggrepcmd") { print < \n"; print "\n"; print "\n"; } 1; configservercsf/urls.py000064400000000332151030256710011271 0ustar00from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.configservercsf, name='configservercsf'), url(r'^iframe/$', views.configservercsfiframe, name='configservercsfiframe'), ] configservercsf/views.py000064400000003345151030256710011450 0ustar00# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import os.path import sys import django sys.path.append('/usr/local/CyberCP') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings") django.setup() import json from plogical.acl import ACLManager import plogical.CyberCPLogFileWriter as logging import subprocess from django.shortcuts import HttpResponse, render from plogical.processUtilities import ProcessUtilities from django.views.decorators.csrf import csrf_exempt import tempfile from django.http import HttpResponse from django.views.decorators.clickjacking import xframe_options_exempt def configservercsf(request): userID = request.session['userID'] currentACL = ACLManager.loadedACL(userID) if currentACL['admin'] == 1: pass else: return ACLManager.loadError() return render(request,'configservercsf/index.html') @csrf_exempt @xframe_options_exempt def configservercsfiframe(request): userID = request.session['userID'] currentACL = ACLManager.loadedACL(userID) if currentACL['admin'] == 1: pass else: return ACLManager.loadError() if request.method == 'GET': qs = request.GET.urlencode() elif request.method == 'POST': qs = request.POST.urlencode() try: tmp = tempfile.NamedTemporaryFile(mode = "w", delete=False) tmp.write(qs) tmp.close() command = "/usr/local/csf/bin/cyberpanel.pl '" + tmp.name + "'" try: output = ProcessUtilities.outputExecutioner(command) except: output = "Output Error from csf UI script" os.unlink(tmp.name) except: output = "Unable to create csf UI temp file" return HttpResponse(output) configservercsf/templates/configservercsf/menu.html000064400000002156151030256710016760 0ustar00 ConfigServer Services
  • configservercsf/templates/configservercsf/index.html000064400000001015151030256710017114 0ustar00{% extends "baseTemplate/index.html" %} {% load i18n %} {% block title %}ConfigServer Security and Firewall{% endblock %} {% block content %} {% load static %} {% endblock %} configservercsf/signals.py000064400000000606151030256710011750 0ustar00from django.dispatch import receiver from django.shortcuts import redirect from firewall.signals import preFirewallHome, preCSF @receiver(preFirewallHome) def csfFirewallHome(sender, **kwargs): request = kwargs['request'] return redirect('/configservercsf/') @receiver(preCSF) def csfCSF(sender, **kwargs): request = kwargs['request'] return redirect('/configservercsf/') configservercsf/tests.py000064400000000175151030256710011453 0ustar00# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase # Create your tests here. configservercsf/meta.xml000064400000000373151030256710011407 0ustar00 ConfigServer Security and Firewall plugin ConfigServer Security and Firewall 1.0 configservercsf/migrations/__init__.py000064400000000000151030256710014207 0ustar00configservercsf/apps.py000064400000000326151030256710011252 0ustar00# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class configservercsfConfig(AppConfig): name = 'configservercsf' def ready(self): import signals configservercsf/admin.py000064400000000200151030256710011366 0ustar00# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin # Register your models here. configservercsf/models.py000064400000000172151030256710011571 0ustar00# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # Create your models here. configservercsf/config000064400000000000151030256710011112 0ustar00configservercsf/__init__.py000064400000000104151030256710012040 0ustar00#default_app_config = 'configservercsf.apps.configservercsfConfig'