!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/libexec/webmin/firewalld/   drwxr-xr-x
Free 5.35 GB of 27.03 GB (19.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     open-ports.pl (2.32 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/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

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

# Parse args
my $no_apply = 0;
if ($ARGV[0] eq "--no-apply") {
    $no_apply = 1;
    shift(@ARGV);
    }
if (!@ARGV) {
    print STDERR "Missing ports to open\n";
    exit(5);
    }
foreach my $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 Firewalld support
if (&foreign_installed($module_name, 1) != 2) {
    print STDERR "Firewalld is not available\n";
    exit(2);
    }
if (!&is_firewalld_running()) {
    print STDERR "Firewalld is not running\n";
    exit(2);
    }

# Check if any zones are active
my @azones = &list_firewalld_zones(1);
if (!@azones) {
    print STDERR "No active FirewallD zones found\n";
    exit(3);
    }

# Get the default zone
my @zones = &list_firewalld_zones();
my ($zone) = grep { $_->{'default'} } @zones;
if (!$zone) {
    print STDERR "Default FirewallD zone not found\n";
    exit(3);
    }

my @added = ( );
foreach my $p (@ARGV) {
    # For each port, find existing rules
    $p =~ s/^(\d+):(\d+)/$1-$2/;
    print STDERR "Checking for port $p ..\n";
    if (&indexof($p."/tcp", @{$zone->{'ports'}}) >= 0) {
        print STDERR ".. already allowed\n";
        }
    else {
        # Need to add
        my $err = &create_firewalld_port($zone, $p, "tcp");
        if ($err) {
            print STDERR ".. failed : $err\n";
            }
        else {
            push(@added, $p);
            }
        }
    }

if (@added) {
    # Added some ports - apply them
    print STDERR "Opened ports ",join(" ", @added),"\n";
    my $ex = 1;
    if (!$no_apply) {
        my $err = &apply_firewalld();
        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);
    }

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0031 ]--