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


Viewing file:     save_share.cgi (2.55 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# save_share.cgi
# Create, update or delete a samba share

require './file-lib.pl';
$disallowed_buttons{'sharing'} && &error($text{'ebutton'});
&ReadParse();
print "Content-type: text/plain\n\n";
if ($access{'ro'} || $access{'uid'}) {
    # User has no access to samba
    print "0\n";
    exit;
    }

%minfo = &get_module_info("samba");
&read_acl(\%acl, undef);
if (!%minfo || !&check_os_support(\%minfo) ||
    !$acl{$base_remote_user,'samba'}) {
    # Samba module not installed or supported
    print "0\n";
    exit;
    }

&foreign_require("samba", "samba-lib.pl");
%sconfig = &foreign_config("samba");
&lock_file($sconfig{'smb_conf'});
@shares = &foreign_call("samba", "list_shares");

if ($in{'delete'}) {
    # Deleting an old share
    foreach $s (@shares) {
        &foreign_call("samba", "get_share", $s);
        if ($samba::share{'path'} &&
            $samba::share{'path'} eq $in{'path'}) {
            &foreign_call("samba", "delete_share", $s);
            last;
            }
        }
    print "1\n";
    }
elsif ($in{'new'}) {
    # Creating a new share
    map { $taken{$_}++ } @shares;
    if ($in{'path'} =~ /\/([^\/]+)$/) {
        $base = $1;
        }
    else {
        $base = "root";
        }
    if ($taken{$base}) {
        for($i=2; $taken{$base.$i}; $i++) { }
        $base = $base.$i;
        }
    $samba::share{'path'} = $in{'path'};
    $samba::share{'available'} = $in{'available'} ? 'yes' : 'no';
    $samba::share{'writeable'} = $in{'writable'} ? 'yes' : 'no';
    $samba::share{'comment'} = $in{'comment'};
    if ($in{'guest'} == 2) {
        $samba::share{'public'} = 'yes';
        $samba::share{'guest only'} = 'yes';
        }
    elsif ($in{'guest'} == 1) {
        $samba::share{'public'} = 'yes';
        }
    &foreign_call("samba", "create_share", $base);
    print "1\n";
    }
else {
    # Updating an existing share
    foreach $s (@shares) {
        &foreign_call("samba", "get_share", $s);
        if ($samba::share{'path'} &&
            $samba::share{'path'} eq $in{'path'}) {
            # found the share to update
            $samba::share{'available'} = $in{'available'} ? 'yes'
                                      : 'no';
            $samba::share{'writeable'} = $in{'writable'} ? 'yes'
                                    : 'no';
            $samba::share{'comment'} = $in{'comment'};
            if ($in{'guest'} == 2) {
                $samba::share{'public'} = 'yes';
                $samba::share{'guest only'} = 'yes';
                }
            elsif ($in{'guest'} == 1) {
                $samba::share{'public'} = 'yes';
                delete($samba::share{'guest only'});
                }
            else {
                delete($samba::share{'public'});
                delete($samba::share{'guest only'});
                }
            &foreign_call("samba", "modify_share", $s, $s);
            last;
            }
        }
    print "1\n";
    }
&unlock_file($sconfig{'smb_conf'});
&webmin_log($in{'delete'} ? 'delete' : $in{'new'} ? 'create' : 'modify',
        'share', $in{'path'});


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