!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-useradmin/   drwxr-xr-x
Free 50.93 GB of 127.8 GB (39.85%)
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.61 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# delete_group.cgi
# Delete a group, after asking for confirmation

require './cluster-useradmin-lib.pl';
&ReadParse();
&error_setup($text{'gdel_err'});
@hosts = &list_useradmin_hosts();
@servers = &list_servers();

foreach $h (@hosts) {
    local ($g) = grep { $_->{'group'} eq $in{'group'} } @{$h->{'groups'}};
    if ($g) {
        %group = %$g;
        last;
        }
    }
%group || &error($text{'gdel_ealready'});

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

$| = 1;
&ui_print_header(undef, $text{'gdel_title'}, "");
if ($in{'confirmed'}) {
    # Do the deletion on all hosts
    foreach $host (@hosts) {
        $del_error_msg = undef;
        ($serv) = grep { $_->{'id'} == $host->{'id'} } @servers;
        ($group) = grep { $_->{'group'} eq $in{'group'} }
                     @{$host->{'groups'}};
        next if (!$group);
        print "<b>",&text('gdel_on', $serv->{'desc'} ? $serv->{'desc'} :
                         $serv->{'host'}),"</b><p>\n";
        print "<ul>\n";
        &remote_foreign_require($serv->{'host'},
                    "useradmin", "user-lib.pl");
        if ($del_error_msg) {
            # Host is down ..
            print &text('gdel_failed', $del_error_msg),"<p>\n";
            print "</ul>\n";
            next;
            }
        local @glist = &remote_foreign_call($serv->{'host'},
                    "useradmin", "list_groups");
        ($group) = grep { $_->{'group'} eq $in{'group'} } @glist;
        if (!$group) {
            # Already deleted?
            print "$text{'gdel_gone'}<p>\n";
            print "</ul>\n";
            next;
            }

        # Delete from other modules
        if ($in{'others'}) {
            if (&supports_gothers($serv)) {
                # Delete in other modules on the server
                print "$text{'gdel_other'}<br>\n";
                &remote_foreign_call($serv->{'host'},
                    "useradmin", "other_modules",
                    "useradmin_delete_group", $group);
                print "$text{'gdel_done'}<p>\n";
                }
            else {
                # Group syncing not supported
                print "$text{'gsave_nosync'}<p>\n";
                }
            }

        # Run the pre-change command
        &remote_eval($serv->{'host'}, "useradmin", <<EOF
\$ENV{'USERADMIN_GROUP'} = '$group->{'group'}';
\$ENV{'USERADMIN_ACTION'} = 'DELETE_GROUP';
EOF
        );
        $merr = &remote_foreign_call($serv->{'host'}, "useradmin",
                         "making_changes");
        if (defined($merr)) {
            print &text('usave_emaking', "<tt>$merr</tt>"),"<p>\n";
            print "</ul>\n";
            next;
            }

        # Delete the group
        print "$text{'gdel_group'}<br>\n";
        &remote_foreign_call($serv->{'host'}, "useradmin",
                     "delete_group", $group);
        print "$text{'gdel_done'}<p>\n";

        # Run the post-change command
        &remote_foreign_call($serv->{'host'}, "useradmin",
                     "made_changes");

        # Update in local list
        @glist = grep { $_ ne $group } @glist;
        $host->{'groups'} = \@glist;
        &save_useradmin_host($host);
        print "</ul>\n";
        }
    &webmin_log("delete", "group", $group->{'group'}, $group);

    &ui_print_footer("", $text{'index_return'});
    }
else {
    # Check if this is anyone's primary group
    foreach $h (@hosts) {
        foreach $u (@{$h->{'users'}}) {
            if ($u->{'gid'} == $group{'gid'}) {
                $puser = $u;
                last;
                }
            }
        }
    if ($puser) {
        print "<b>",&text('gdel_eprimary', $puser->{'user'}),
              "</b><p>\n";
        &ui_print_footer("", $text{'index_return'});
        exit;
        }

    # Ask if the user is sure
    print "<form action=delete_group.cgi>\n";
    print "<input type=hidden name=group value=\"$group{'group'}\">\n";
    print "<input type=hidden name=confirmed value=1>\n";

    print "<center><b>",&text('gdel_sure',
                   $group{'group'}),"</b>\n";
    print "<input type=submit value=\"$text{'gdel_del'}\">\n";
    print "<br><input type=checkbox name=others value=1 checked> ",
          "$text{'gdel_dothers'}<br>\n";
    print "</center><p>\n";
    print "</form>\n";
    &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.0059 ]--