[ Avaa Bypassed ]




Upload:

Command:

www-data@3.144.13.165: ~ $
#!/usr/bin/perl
# Open some ports on the firewall. Exit statuses are :
# 0 - Nothing needed to be done
# 1 - Given ports were opened up
# 2 - IPtables is not installed or supported
# 3 - No firewall is active
# 4 - Could not apply configuration
# 5 - Bad args

$no_acl_check++;
$ENV{'WEBMIN_CONFIG'} = "/etc/webmin";
$ENV{'WEBMIN_VAR'} = "/var/webmin";
if ($0 =~ /^(.*\/)[^\/]+$/) {
	chdir($1);
	}
require './firewall-lib.pl';
if ($module_name ne 'firewall') {
	print STDERR "Command must be run with full path\n";
	exit(5);
	}

# Parse args
if ($ARGV[0] eq "--no-apply") {
	$no_apply = 1;
	shift(@ARGV);
	}
if (!@ARGV) {
	print STDERR "Missing ports to open\n";
	exit(5);
	}
foreach $p (@ARGV) {
	if ($p !~ /^\d+$/ && $p !~ /^\d+:\d+$/ && $p !~ /^\d+(,\d+)*$/) {
		print STDERR "Port $p must be number or start:end range\n";
		exit(5);
		}
	}

# Check IPtables support
if (&foreign_installed($module_name, 1) != 2) {
	print STDERR "IPtables is not available\n";
	exit(2);
	}

# Check if any rules exist
@tables = &get_iptables_save();
if (!@tables) {
	print STDERR "No IPtables rules exist yet\n";
	exit(3);
	}
($filter) = grep { $_->{'name'} eq 'filter' } @tables;
if (!$filter) {
	print STDERR "No IPtables filter table found\n";
	exit(3);
	}
elsif (!@{$filter->{'rules'}}) {
	print STDERR "No IPtables rules found in filter table\n";
	exit(3);
	}

# Check if any rules are active
@livetables = &get_iptables_save("iptables-save 2>/dev/null |");
($livefilter) = grep { $_->{'name'} eq 'filter' } @livetables;

@added = ( );
PORT: foreach $p (@ARGV) {
	# For each port, find existing rules
	print STDERR "Checking for port $p ..\n";
	foreach $r (@{$filter->{'rules'}}) {
		if ($r->{'chain'} eq 'INPUT' &&
		    $r->{'j'} && $r->{'j'}->[1] eq 'ACCEPT' &&
		    $r->{'p'} && $r->{'p'}->[0] eq '' &&
		    		 $r->{'p'}->[1] eq 'tcp') {
			# Found tcp rule .. check ports
			@rports = ( );
			$rrange = undef;
			if ($r->{'dports'} && $r->{'dports'}->[0] eq '') {
				push(@rports, split(/,/, $r->{'dports'}->[1]));
				$rrange = $r->{'dports'}->[1];
				}
			if ($r->{'dport'} && $r->{'dport'}->[0] eq '') {
				($s, $e) = split(":", $r->{'dport'}->[1]);
				if ($s && $e) {
					push(@rports, ($s .. $e));
					}
				elsif ($s) {
					push(@rports, $s);
					}
				$rrange = $r->{'dport'}->[1];
				}
			if (&indexof($p, @rports) >= 0 ||
			    $p eq $rrange) {
				print STDERR ".. already allowed\n";
				next PORT;
				}
			}
		}

	# Add a rule at the top for this port
	$r = { 'chain' => 'INPUT',
	       'm' => [ [ "", "tcp" ] ],
	       'p' => [ "", "tcp" ],
	       'j' => [ "", 'ACCEPT' ] };
	if ($p =~ /,/) {
		$r->{'dports'} = [ "", $p ];
		push(@{$r->{'m'}}, [ "", "multiport" ]);
		}
	else {
		$r->{'dport'} = [ "", $p ];
		}
	unshift(@{$filter->{'rules'}}, $r);
	push(@added, $p);
	}

if (@added) {
	# Added some rules .. save them
	&run_before_command();
	&lock_file($iptables_save_file);
	&save_table($filter);
	&unlock_file($iptables_save_file);
	&run_after_command();
	&copy_to_cluster();
	print STDERR "Opened ports ",join(" ", @added),"\n";

	# Apply, if live
	$ex = 1;
	if (!$no_apply && $livefilter && @{$livefilter->{'rules'}}) {
		$err = &apply_configuration();
		if ($err) {
			print "Failed to apply configuration : $err\n";
			$ex = 4;
			}
		else {
			print "Applied configuration successfully\n";
			}
		}
	&webmin_log("openports", undef, undef, { 'ports' => \@added });
	exit($ex);
	}
else {
	print STDERR "All ports are already open\n";
	exit(0);
	}

Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
acl_security.pl File 1.02 KB 0755
apply.cgi File 512 B 0755
backup_config.pl File 649 B 0755
bootup.cgi File 600 B 0755
cgi_args.pl File 430 B 0755
cluster.cgi File 2.08 KB 0755
cluster_add.cgi File 2.19 KB 0755
cluster_delete.cgi File 651 B 0755
coherent-linux-lib.pl File 1.54 KB 0755
config File 83 B 0644
config.info File 1.23 KB 0644
config.info.ca File 1.5 KB 0644
config.info.cs File 982 B 0644
config.info.de File 1.42 KB 0644
config.info.fr File 1.63 KB 0644
config.info.ja File 421 B 0644
config.info.nl File 976 B 0644
config.info.no File 968 B 0644
config.info.pl File 1012 B 0644
config.info.pt_BR File 983 B 0644
config.info.ru File 1.31 KB 0644
config.info.sk File 989 B 0644
config.info.tr File 827 B 0644
convert.cgi File 756 B 0755
debian-linux-lib.pl File 4.69 KB 0755
defaultacl File 100 B 0644
edit_rule.cgi File 14.88 KB 0755
firewall-lib.pl File 17.32 KB 0755
firewall4-lib.pl File 1.82 KB 0755
firewall6-lib.pl File 1.76 KB 0755
gentoo-linux-lib.pl File 722 B 0755
index.cgi File 16.42 KB 0755
install_check.pl File 841 B 0755
log_parser.pl File 835 B 0755
mandrake-linux-lib.pl File 1.69 KB 0755
module.info File 238 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 182 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 254 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 278 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 299 B 0644
module.info.ca File 155 B 0644
module.info.ca.auto File 18 B 0644
module.info.cs File 0 B 0644
module.info.cs.auto File 194 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 183 B 0644
module.info.de File 161 B 0644
module.info.de.auto File 18 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 346 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 185 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 167 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 268 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 186 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 251 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 173 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 201 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 174 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 263 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 206 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 209 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 180 B 0644
module.info.ms File 0 B 0644
module.info.ms.auto File 176 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 192 B 0644
module.info.nl File 0 B 0644
module.info.nl.auto File 186 B 0644
module.info.no File 0 B 0644
module.info.no.auto File 176 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 197 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 172 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 181 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 250 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 203 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 182 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 177 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 275 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 222 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 291 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 306 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 205 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 146 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 155 B 0644
move.cgi File 1.29 KB 0755
newchain.cgi File 898 B 0755
open-ports.pl File 3.4 KB 0755
prefs.info File 55 B 0644
redhat-linux-lib.pl File 2.14 KB 0755
save_policy.cgi File 7.15 KB 0755
save_rule.cgi File 12.4 KB 0755
save_rule6.cgi File 12.05 KB 0755
setup.cgi File 9.37 KB 0755
setup6.cgi File 8.12 KB 0755
trustix-linux-lib.pl File 2.14 KB 0755
unapply.cgi File 609 B 0755