[ Avaa Bypassed ]




Upload:

Command:

www-data@3.16.30.154: ~ $
#!/usr/bin/perl
# Update one firewall rule

require './ipfilter-lib.pl';
&ReadParse();
$rules = &get_config();
if (!$in{'new'}) {
	# Get the rule
	$rule = $rules->[$in{'idx'}];
	}
else {
	$rule = { 'file' => $config{'ipf_conf'},
		  'type' => 'ipf' };
	}

if ($in{'delete'}) {
	# Just deleting
	&lock_file($rule->{'file'});
	&delete_rule($rule);
	&flush_file_lines();
	&unlock_file($rule->{'file'});
	&webmin_log("delete", "rule", undef, $rule);
	&redirect("");
	exit;
	}

# Validate and store inputs, starting with action
$rule->{'cmt'} = $in{'cmt'};
$rule->{'active'} = $in{'active'};
$rule->{'action'} = $in{'action'};
if ($rule->{'action'} eq "block") {
	# Parse ICMP block options
	if ($in{'block_return'}) {
		$rule->{'block-return'} = $in{'block_return'};
		$rule->{'block-return-dest'} = $in{'block_return_dest'};
		}
	else {
		$rule->{'block-return'} = undef;
		}
	}
elsif ($rule->{'action'} eq "log") {
	# Parse logging options
	&parse_logging_options("log");
	}
elsif ($rule->{'action'} eq "skip") {
	# Save rule to skip to
	$in{'skip'} =~ /^\d+$/ || &error($text{'save_eskip'});
	$rule->{'skip'} = $in{'skip'};
	}
elsif ($rule->{'action'} eq "call") {
	# Save function to call
	$in{'call'} =~ /^\S+$/ || &error($text{'save_ecall'});
	$rule->{'call'} = $in{'call'};
	$rule->{'call-now'} = $in{'call_now'};
	}

# Parse source and destination
$rule->{'all'} = $in{'all'};
if (!$in{'all'}) {
	&parse_object_input($rule, "from");
	&parse_object_input($rule, "to");
	}

# Parse other conditions
$rule->{'dir'} = $in{'dir'};
$rule->{'proto'} = $in{'proto'};
if ($in{'tos_def'}) {
	delete($rule->{'tos'});
	}
else {
	&valid_hexdec($in{'tos'}) || &error($text{'save_etos'});
	$rule->{'tos'} = $in{'tos'};
	}
if ($in{'ttl_def'}) {
	delete($rule->{'ttl'});
	}
else {
	&valid_hexdec($in{'ttl'}) || &error($text{'save_ettl'});
	$rule->{'ttl'} = $in{'ttl'};
	}
if ($in{'on'} eq "") {
	delete($rule->{'on'});
	}
else {
	$rule->{'on'} = &parse_interface_choice("on", $text{'save_eon'});
	}
if ($in{'flags1_def'}) {
	delete($rule->{'flags1'});
	delete($rule->{'flags2'});
	}
else {
	$in{'flags1'} =~ /^[FSRPAU]+$/ || &error($text{'save_eflags1'});
	$in{'flags2'} =~ /^[FSRPAU]*$/ || &error($text{'save_eflags2'});
	$rule->{'flags1'} = $in{'flags1'};
	$rule->{'flags2'} = $in{'flags2'};
	}
if (!$in{'icmptype'}) {
	delete($rule->{'icmp-type'});
	}
else {
	lc($rule->{'proto'}) eq "icmp" || &error($text{'save_eicmp'});
	$rule->{'icmp-type'} = $in{'icmptype'};
	$rule->{'icmp-type-code'} = $in{'icmpcode'};
	}

# Parse action options
$rule->{'quick'} = $in{'quick'};
$rule->{'olog'} = $in{'olog'};
if ($in{'olog'}) {
	&parse_logging_options("olog");
	}
if ($in{'tag'}) {
	&valid_hexdec($in{'tagid'}) || &error($text{'save_etag'});
	$rule->{'tag'} = $in{'tagid'};
	}
else {
	delete($rule->{'tag'});
	}
if ($in{'dup_to'}) {
	$rule->{'dup-to'} = &parse_interface_choice("dup_toiface",
						    $text{'save_edupto'});
	if ($in{'dup_toip'}) {
		&check_ipaddress($in{'dup_toip'}) ||
			&error($text{'save_eduptoip'});
		$rule->{'dup-to'} .= ":".$in{'dup_toip'};
		}
	}
else {
	delete($rule->{'dup-to'});
	}
if ($in{'fastroute'}) {
	$rule->{'fastroute'} = &parse_interface_choice("fastrouteiface",
						       $text{'save_eto'});
	if ($in{'fastrouteip'}) {
		&check_ipaddress($in{'fastrouteip'}) ||
			&error($text{'save_etoip'});
		}
	$rule->{'fastroute-ip'} = $in{'fastrouteip'};
	}
else {
	delete($rule->{'fastroute'});
	}
if ($in{'reply_to'}) {
	$rule->{'reply-to'} = &parse_interface_choice("reply_toiface",
					   $text{'save_ereplyto'});
	$rule->{'reply-to'} =~ /^[a-z]+\d*/ || &error($text{'save_ereply_to'});
	if ($in{'reply_toip'}) {
		&check_ipaddress($in{'reply_toip'}) ||
			&error($text{'save_ereplytoip'});
		}
	$rule->{'reply-to-ip'} = $in{'reply_toip'};
	}
else {
	delete($rule->{'reply-to'});
	}
if ($in{'keep'}) {
	$rule->{'keep'} = $in{'keepmode'};
	}
else {
	delete($rule->{'keep'});
	}

&lock_file($rule->{'file'});
if ($in{'new'}) {
	if ($in{'before'} ne '') {
		# Insert before some rule
		$before = $rules->[$in{'before'}];
		&insert_rule($rule, $before);
		}
	elsif ($in{'after'} ne '') {
		if ($in{'after'} == @$rules - 1) {
			&create_rule($rule);	# at end anyway
			}
		else {
			# Insert after some rule
			$before = $rules->[$in{'after'}+1];
			&insert_rule($rule, $before);
			}
		}
	else {
		# Append to end
		&create_rule($rule);
		}
	}
else {
	&modify_rule($rule);
	}
&flush_file_lines();
&unlock_file($rule->{'file'});
&copy_to_cluster();
&webmin_log($in{'new'} ? "create" : "modify", "rule", undef, $rule);

&redirect("");

# parse_logging_options(prefix)
sub parse_logging_options
{
local $pfx = $_[0];
if ($in{$pfx."_pri"}) {
	if ($in{$pfx."_fac"}) {
		$rule->{$pfx."-level"} = $in{$pfx."_fac"}.".".$in{$pfx."_pri"};
		}
	else {
		$rule->{$pfx."-level"} = $in{$pfx."_pri"};
		}
	}
else {
	delete($rule->{$pfx."-level"});
	}
$rule->{$pfx."-body"} = $in{$pfx."_body"};
$rule->{$pfx."-first"} = $in{$pfx."_first"};
$rule->{$pfx."-or-block"} = $in{$pfx."_orblock"};
}



Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 896 B 0644
apply.cgi File 271 B 0755
backup_config.pl File 604 B 0755
bootup.cgi File 252 B 0755
cluster.cgi File 2.01 KB 0755
cluster_add.cgi File 1.78 KB 0755
cluster_delete.cgi File 522 B 0755
config File 155 B 0644
config-freebsd File 149 B 0644
config-solaris-10-ALL File 177 B 0644
config.info File 669 B 0644
config.info.ca File 717 B 0644
config.info.de File 743 B 0644
config.info.nl File 741 B 0644
convert.cgi File 341 B 0755
edit_nat.cgi File 7.83 KB 0755
edit_rule.cgi File 9.81 KB 0755
index.cgi File 8.42 KB 0755
install_check.pl File 337 B 0755
ipfilter-lib.pl File 39.32 KB 0755
log_parser.pl File 928 B 0755
module.info File 198 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 129 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 183 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 180 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 232 B 0644
module.info.ca File 121 B 0644
module.info.cs File 0 B 0644
module.info.cs.auto File 121 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 117 B 0644
module.info.de File 97 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 239 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 118 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 117 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 182 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 123 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 132 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 166 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 121 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 150 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 130 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 179 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 140 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 144 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 134 B 0644
module.info.ms File 0 B 0644
module.info.ms.auto File 125 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 123 B 0644
module.info.nl File 26 B 0644
module.info.nl.auto File 109 B 0644
module.info.no File 0 B 0644
module.info.no.auto File 126 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 117 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 116 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 122 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 128 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 166 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 126 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 125 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 122 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 202 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 154 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 186 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 198 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 149 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 110 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 116 B 0644
move.cgi File 427 B 0755
natmove.cgi File 432 B 0755
save_nat.cgi File 5.06 KB 0755
save_rule.cgi File 4.88 KB 0755
setup.cgi File 6.12 KB 0755
unapply.cgi File 235 B 0755