!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/usr/share/webmin/virtual-server/   drwxrwxr-x
Free 28.64 GB of 117.98 GB (24.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     validate-domains.pl (3.54 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl

=head1 validate-domains.pl

Check the configuration of virtual servers

This program can be used to generate a report on selected features for selected virtual servers, to ensure that they are setup correctly. Validation is useful for detecting things such as manually removed Apache virtual hosts or BIND domains, wrong permissions and missing configuration files.

To specify the servers to check, you can either supply the C<--all-domains>
parameter, or C<--domain> followed by the domain name. Similar, you can select
features to check with the C<--feature> parameter followed by a feature name
(like web or dns), or the C<--all-features> option. Both C<--domain> and
C<--feature> can be given multiple times.

=cut

package virtual_server;
if (!$module_name) {
    $main::no_acl_check++;
    $ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin";
    $ENV{'WEBMIN_VAR'} ||= "/var/webmin";
    if ($0 =~ /^(.*)\/[^\/]+$/) {
        chdir($pwd = $1);
        }
    else {
        chop($pwd = `pwd`);
        }
    $0 = "$pwd/validate-domains.pl";
    require './virtual-server-lib.pl';
    $< == 0 || die "validate-domains.pl must be run as root";
    }

# Parse command-line args
while(@ARGV > 0) {
    local $a = shift(@ARGV);
    if ($a eq "--domain") {
        # Add a domain to validate
        $dname = shift(@ARGV);
        $d = &get_domain_by("dom", $dname);
        $d || &usage("Virtual server $dname does not exist");
        push(@doms, $d);
        }
    elsif ($a eq "--all-domains") {
        # Validating all domains
        @doms = &list_domains();
        }
    elsif ($a eq "--feature") {
        # Add a feature to validate
        $f = shift(@ARGV);
        if (&indexof($f, @validate_features) >= 0) {
            push(@feats, $f);
            }
        elsif (&plugin_defined($f, "feature_validate")) {
            push(@feats, $f);
            }
        else {
            &usage("$f is not a valid feature or supported plugin");
            }
        }
    elsif ($a eq "--all-features") {
        # Validating all features and capable plugins
        @feats = @validate_features;
        foreach $f (&list_feature_plugins()) {
            if (&plugin_defined($f, "feature_validate")) {
                push(@feats, $f);
                }
            }
        }
    elsif ($a eq "--problems") {
        # Only report problem domains
        $problems = 1;
        }
    elsif ($a eq "--multiline") {
        $multiline = 1;
        }
    elsif ($a eq "--help") {
        &usage();
        }
    else {
        &usage("Unknown parameter $a");
        }
    }

# Validate args
@doms || &usage("No virtual servers to validate specified");
@feats || &usage("No features to validate specified");

# Do it
foreach $d (@doms) {
    # Call all the feature validators
    @errs = ( );
    $count = 0;
    foreach $f (@feats) {
        next if (!$d->{$f});
        if (&indexof($f, &list_feature_plugins()) < 0) {
            # Core feature
            next if (!$config{$f});
            $vfunc = "validate_$f";
            $err = &$vfunc($d);
            $name = $text{'feature_'.$f};
            }
        else {
            # Plugin feature
            $err = &plugin_call($f, "feature_validate", $d);
            $name = &plugin_call($f, "feature_name");
            }
        push(@errs, "$name : ".
             &html_tags_to_text(&entities_to_ascii($err))) if ($err);
        $count++;
        }

    # Don't print anything if there were no problems
    next if (!@errs && $problems);

    # Print message, if anything done
    if ($count) {
        print "$d->{'dom'}\n";
        if (@errs) {
            foreach $e (@errs) {
                print "    ",&html_tags_to_text($e),"\n";
                $errcount++;
                }
            }
        else {
            print "    $text{'newvalidate_good'}\n";
            }
        }
    }
exit($errcount);

sub usage
{
print "$_[0]\n\n" if ($_[0]);
print "Validates the configurations of selected virtual servers.\n";
print "\n";
print "virtualmin validate-domains --domain name | --all-domains\n";
print "                           [--feature name]* | [--all-features]\n";
print "                           [--problems]\n";
exit(1);
}


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.004 ]--