!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/sarg/   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:     view.cgi (1.64 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# view_log.cgi
# Display the report for some log file

require './sarg-lib.pl';
&ReadParse();

$file = $ENV{'PATH_INFO'} || "/index.html";
$file =~ /\.\./ || $file =~ /\<|\>|\||\0/ && &error($text{'view_efile'});

$conf = &get_config();
$odir = &find_value("output_dir", $conf);
$odir ||= &find_value("output_dir", $conf, 1);
$odir || &error($text{'view_eodir'});
$full = "$odir$file";
&is_under_directory($odir, $full) || &error($text{'view_efile'});

# Show index page
if (-d $full && -r "$full/index.html") {
    $full = "$full/index.html";
    }

# Display file contents
if ($full =~ /\.(html|htm)$/i && !$config{'naked'}) {
    open(FILE, $full) || &error($text{'view_eopen'}." : $full");
    while(read(FILE, $buf, 1024)) {
        $data .= $buf;
        }
    close(FILE);
    if ($data =~ /<TITLE>(.*)<\/TITLE>/i) {
        $title = $1;
        }
    $data =~ s/^[\000-\377]*<BODY[^>]*>//i;
    $data =~ s/<\/BODY>[\000-\377]*$//i;

    &ui_print_header(undef, $title || $text{'view_title'}, "");
    print "<div id=sarg-report>\n";
    print $data;
    print "</div>\n";
    &ui_print_footer("", $text{'index_return'});
    }
elsif (-d $full) {
    # Show directory listing
    &ui_print_header(undef, $text{'view_title'}, "");
    print "<ul>\n";
    opendir(DIR, $full);
    foreach $f (sort { lc($a) cmp lc($b) } readdir(DIR)) {
        next if ($f eq "." || $f eq "..");
        print "<li><a href='$f/'>$f</a>\n";
        }
    closedir(DIR);
    print "</ul>\n";
    &ui_print_footer("", $text{'index_return'});
    }
else {
    # Show RAW file contents
    open(FILE, $full) || &error($text{'view_eopen'}." : $full");
    print "Content-type: ",&guess_mime_type($full, "text/plain"),"\n";
    print "\n";
    while(read(FILE, $buf, 1024)) {
        print $buf;
        }
    close(FILE);
    }


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