[ Avaa Bypassed ]




Upload:

Command:

www-data@3.139.86.128: ~ $
#!/usr/bin/perl
# Create, update or delete a jail

use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
require './fail2ban-lib.pl';
our (%in, %text, %config);
&ReadParse();
&error_setup($text{'jail_err'});

my $jail;
my @jails = &list_jails();

if ($in{'new'}) {
	# Create new jail object
	my $jfile = "$config{'config_dir'}/jail.conf";
	my $jlfile = "$config{'config_dir'}/jail.local";
	$jail = { 'members' => [ ],
		  'file' => -r $jlfile ? $jlfile : $jfile };
	}
else {
	# Find existing jail
	($jail) = grep { $_->{'name'} eq $in{'name'} } @jails;
	$jail || &error($text{'jail_egone'});
	}

if ($in{'delete'}) {
	# Just delete the jail
	&lock_all_config_files();
	&delete_section($jail->{'file'}, $jail,
			$jail->{'file'} =~ /jail.local$/ ? 1 : 0);
	&unlock_all_config_files();
	}
else {
	# Validate inputs
	my $file;
	$in{'name'} =~ /^[a-z0-9\_\-]+$/i || &error($text{'jail_ename'});
	$jail->{'name'} = $in{'name'};
	if ($in{'new'} || $in{'name'} ne $in{'old'}) {
		# Check for clash
		my ($clash) = grep { $_->{'name'} eq $in{'name'} } @jails;
		$clash && &error($text{'jail_eclash'});
		}

	# Parse and validate actions
	my @actions;
	for(my $i=0; defined($in{"action_$i"}); $i++) {
		next if (!$in{"action_$i"});
		my @opts;
		if ($in{"name_$i"}) {
			$in{"name_$i"} =~ /^(%\(\S+\))?[A-Za-z0-9\.\_\-]+$/ ||
				&error(&text('jail_eaname', $i+1));
			push(@opts, "name=".$in{"name_$i"});
			}
		if ($in{"port_$i"}) {
			my @p = split(/,/, $in{"port_$i"});
			foreach my $p (split(/,/, $in{"port_$i"})) {
				$p =~ /^\d+$/ ||
				  $p =~ /^\d+:\d+$/ ||
				    getservbyname($p,
					  $in{"protocol_$i"} || "tcp") ||
				      $p =~ /%\(\S+\)s/ ||
					&error(&text('jail_eport', $i+1));
				}
			if (@p > 1) {
				push(@opts, "port="."\"".$in{"port_$i"}."\"");
				}
			else {
				push(@opts, "port=".$in{"port_$i"});
				}
			}
		if ($in{"protocol_$i"}) {
			push(@opts, "protocol=".$in{"protocol_$i"});
			}
		push(@opts, split(/\s+/, $in{"others_$i"}));
		push(@actions, $in{"action_$i"}."[".join(", ", @opts)."]");
		}

	# Split and validate log file paths
	my @logpaths = grep { /\S/ } split(/\r?\n/, $in{'logpath'});
	@logpaths || &error($text{'jail_elogpaths'});
	foreach my $l (@logpaths) {
		$l =~ s/^\s*//;
		$l =~ s/\s*$//;
		$l =~ /^\/\S+$/ || $l =~ /^\%\(/ ||
			&error($text{'jail_elogpath'});
		}

	# Validate various counters
	foreach my $f ("maxretry", "findtime", "bantime") {
		$in{$f.'_def'} || $in{$f} =~ /^\-?\d+(\.\d+)?[mhdwy]?$/ ||
			&error($text{'jail_e'.$f});
		}

	# Split and validate IPs to ignore
	my @ignoreips = $in{'ignoreip_def'} ? ( )
					    : split(/\s+/, $in{'ignoreip'});
	foreach my $ip (@ignoreips) {
		&check_ipaddress($ip) || &check_ip6address($ip) ||
		    ($ip =~ /^([0-9\.]+)\/(\d+)/ && &check_ipaddress("$1")) ||
		    &to_ipaddress($ip) ||
			&error($text{'jail_eignoreip'});
		}

	# Create new section or rename existing if needed
	&lock_all_config_files();
	if ($in{'new'}) {
		&create_section($jail->{'file'}, $jail);
		}
	elsif ($in{'name'} ne $in{'old'}) {
		&modify_section($jail->{'file'}, $jail);
		}

	# Save directives within the section
	&save_directive("enabled", $in{'enabled'} ? 'true' : 'false', $jail);
	&save_directive("filter", $in{'filter'} || undef, $jail);
	&save_directive("action", @actions ? join("\n", @actions)
					   : undef, $jail);
	&save_directive("logpath", join("\n", @logpaths), $jail);
	foreach my $f ("maxretry", "findtime", "bantime") {
		&save_directive($f, $in{$f."_def"} ? undef : $in{$f}, $jail);
		}
	&save_directive("ignoreip",
		@ignoreips ? join(" ", @ignoreips) : undef, $jail);

	&unlock_all_config_files();
	}

# Log and redirect
&webmin_log($in{'delete'} ? 'delete' : $in{'new'} ? 'create' : 'update',
	    'jail', $jail->{'name'});
&redirect("list_jails.cgi");

Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 110 B 0644
atboot.cgi File 919 B 0755
backup_config.pl File 771 B 0755
config File 100 B 0644
config-debian-linux File 118 B 0644
config-redhat-linux File 118 B 0644
config-syno-linux File 100 B 0644
config.info File 196 B 0644
config.info.ca File 249 B 0644
config.info.de File 202 B 0644
config.info.fr File 231 B 0644
config.info.ms File 201 B 0644
config.info.no File 203 B 0644
config.info.pl File 232 B 0644
delete_actions.cgi File 877 B 0755
delete_filters.cgi File 877 B 0755
delete_jails.cgi File 624 B 0755
edit_action.cgi File 2.12 KB 0755
edit_config.cgi File 1.67 KB 0755
edit_filter.cgi File 1.67 KB 0755
edit_jail.cgi File 3.91 KB 0755
edit_jaildef.cgi File 2.57 KB 0755
edit_manual.cgi File 1.05 KB 0755
fail2ban-lib.pl File 13.86 KB 0644
index.cgi File 2.15 KB 0755
install_check.pl File 465 B 0755
list_actions.cgi File 1.15 KB 0755
list_filters.cgi File 1.2 KB 0755
list_jails.cgi File 1.55 KB 0755
list_status.cgi File 3.04 KB 0755
log_parser.pl File 804 B 0755
module.info File 201 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 150 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 233 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 225 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 239 B 0644
module.info.ca File 149 B 0644
module.info.cs File 0 B 0644
module.info.cs.auto File 161 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 157 B 0644
module.info.de File 138 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 291 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 152 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 157 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 220 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 175 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 180 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 201 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 141 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 159 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 163 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 187 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 167 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 171 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 162 B 0644
module.info.ms File 161 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 176 B 0644
module.info.nl File 0 B 0644
module.info.nl.auto File 156 B 0644
module.info.no File 36 B 0644
module.info.no.auto File 114 B 0644
module.info.pl File 158 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 161 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 167 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 186 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 249 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 174 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 147 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 164 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 326 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 173 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 236 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 272 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 203 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 118 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 124 B 0644
restart.cgi File 334 B 0755
save_action.cgi File 1.86 KB 0755
save_config.cgi File 975 B 0755
save_filter.cgi File 1.69 KB 0755
save_jail.cgi File 3.71 KB 0755
save_jaildef.cgi File 1.49 KB 0755
save_manual.cgi File 620 B 0755
start.cgi File 326 B 0755
stop.cgi File 322 B 0755
syslog_logs.pl File 599 B 0755
unblock_jail.cgi File 708 B 0755