!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/cluster-webmin/   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:     delete_group.cgi (3.22 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# delete_group.cgi
# Delete a webmin group across all servers

require './cluster-webmin-lib.pl';
&ReadParse();
&ui_print_header(undef, $text{'gdelete_title'}, "");

# Find groups and members on all hosts
foreach $h (&list_webmin_hosts()) {
    foreach $g (@{$h->{'groups'}}) {
        if ($g->{'name'} eq $in{'group'}) {
            push(@hosts, $h);
            push(@mems, @{$g->{'members'}});
            foreach $m (@{$g->{'members'}}) {
                $onhost{$h,$m}++;
                ($mg) = grep { $_->{'name'} eq $m }
                         @{$h->{'groups'}};
                push(@subs, $mg->{'name'}) if ($mg);
                }
            last;
            }
        }
    }
@mems = &unique(@mems);

if (@subs) {
    print &text('gdelete_esub',
        "<b>".join(" ", &unique(@subs))."</b>"),"<p>\n";
    &ui_print_footer("", $text{'index_return'});
    exit;
    }
if (!$in{'confirm'} && @mems) {
    # Ask if the user really wants to delete the group and members
    print "<center><form action=delete_group.cgi>\n";
    print "<input type=hidden name=group value='$in{'group'}'>\n";
    print &text('gdelete_desc', "<b>$in{'group'}</b>",
            "<b>".join(" ", @mems)."</b>"),"<p>\n";
    print "<input type=submit name=confirm value='$text{'gdelete_ok'}'>\n";
    print "</form></center>\n";
    &ui_print_footer("", $text{'index_return'});
    exit;
    }

print "<b>",&text('gdelete_doing', $in{'group'}),"</b><p>\n";

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

@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'}, "acl", "acl-lib.pl");
        if ($group_error_msg) {
            # Host is down
            print $wh &serialise_variable([ 0, $group_error_msg ]);
            exit;
            }

        # Delete the group
        &remote_foreign_call($s->{'host'}, "acl", "delete_group",
                     $in{'group'});
        $h->{'groups'} = [ grep { $_->{'name'} ne $in{'group'} }
                        @{$h->{'groups'}} ];

        # Remove from any groups
        foreach $g (@{$h->{'groups'}}) {
            local @mems = @{$g->{'members'}};
            local $i = &indexof($in{'group'}, @mems);
            if ($i >= 0) {
                splice(@mems, $i, 1);
                $g->{'members'} = \@mems;
                &remote_foreign_call($s->{'host'}, "acl",
                        "modify_group", $g->{'name'}, $g);
                }
            }

        # Delete any members
        foreach $u (grep { $onhost{$h,$_} } @mems) {
            &remote_foreign_call($s->{'host'}, "acl",
                         "delete_user", $u);
            $h->{'users'} = [ grep { $_->{'name'} ne $u }
                           @{$h->{'users'}} ];
            }
        &save_webmin_host($h);

        # Restart the remote webmin
        print $wh &serialise_variable([ 1 ]);
        &remote_foreign_call($s->{'host'}, "acl", "restart_miniserv");
        exit;
        }
    close($wh);
    $p++;
    }

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

    if ($rv && $rv->[0] == 1) {
        # It worked
        print &text('gdelete_success', $d),"<br>\n";
        }
    else {
        # Something went wrong
        print &text('gdelete_failed', $d, $rv->[1]),"<br>\n";
        }
    $p++;
    }

print "<p><b>$text{'gdelete_done'}</b><p>\n";

&remote_finished();
&ui_print_footer("", $text{'index_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.0175 ]--