!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/libexec/webmin/squid/   drwxr-xr-x
Free 5.29 GB of 27.03 GB (19.58%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     init_cache.cgi (2.98 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# init_cache.cgi
# Initialize the cache by running squid with the -z option

use strict;
use warnings;
our (%text, %in, %access, $squid_version, %config);
require './squid-lib.pl';
$access{'rebuild'} || &error($text{'icache_ecannot'});
&ReadParse();
&error_setup($text{'icache_ftic'});

&lock_file($config{'squid_conf'});
my $conf = &get_config();

# Set user to run squid as..
if (!$in{'nouser'}) {
    $in{'user'} || &error($text{'icache_ymcautrsa'});
    my @uinfo = getpwnam($in{'user'});
    scalar(@uinfo) || &error($text{'icache_euser'});
    my @ginfo = getgrgid($uinfo[3]);
    if ($squid_version < 2) {
        my $dir = { 'name' => 'cache_effective_user',
                'values' => [ $in{'user'}, $ginfo[0] ] };
        &save_directive($conf, "cache_effective_user", [ $dir ]);
        }
    else {
        my $dir = { 'name' => 'cache_effective_user',
                'values' => [ $in{'user'} ] };
        &save_directive($conf, "cache_effective_user", [ $dir ]);
        $dir = { 'name' => 'cache_effective_group',
             'values' => [ $ginfo[0] ] };
        &save_directive($conf, "cache_effective_group", [ $dir ]);
        }
    &flush_file_lines();
    }

# If cache_dir is set but disabled, enable it by un-commenting (but only the
# valid directives)
my @cachestruct = &find_config("cache_dir", $conf, 2);
if ($squid_version >= 2.3) {
    @cachestruct = grep { $_->{'values'}->[1] =~ /^\// &&
                  -d $_->{'values'}->[1] } @cachestruct;
    }
else {
    @cachestruct = grep { $_->{'values'}->[0] } @cachestruct;
    }
if (@cachestruct) {
    &save_directive($conf, "cache_dir", \@cachestruct);
    &flush_file_lines();
    }

&unlock_file($config{'squid_conf'});

# Stop squid (if running)
&ui_print_unbuffered_header(undef, $text{'icache_title'}, "");
my $pid = &is_squid_running();
my $stopped = 0;
if ($pid && kill(0, $pid)) {
    print "<p>$text{'clear_stop'}<br>\n";
    &system_logged("$config{'squid_path'} -f $config{'squid_conf'} ".
                   "-k shutdown >/dev/null 2>&1");
    for(my $i=0; $i<40; $i++) {
        if (!kill(0, $pid)) { last; }
        sleep(1);
        }
    print "$text{'clear_done'}<br>\n";
    $stopped++;
    }

# Initialize the cache
my ($user, $group) = &get_squid_user($conf);
if ($user) {
    foreach my $c (split(/\s+/, $in{'caches'})) {
        &make_dir($c, 0755);
        }
    }
&chown_files($user, $group, $conf);
my $cmd = "$config{'squid_path'} -f $config{'squid_conf'} -z";
print "<p>", &text('icache_itscwtc',$cmd), "<br>\n";
print "<pre>\n";
&additional_log('exec', undef, $cmd);
my $fh;
open($fh, "$cmd 2>&1 |");
while(<$fh>) {
    print &html_escape($_);
    }
close($fh);
print "</pre>\n";

# Try to re-start squid (if it was running before)
if ($stopped) {
    my $temp = &transname();
    &system_logged("$config{'squid_path'} -sY -f $config{'squid_conf'} >$temp 2>&1 </dev/null &");
    sleep(3);
    my $errs = &read_file_contents($temp);
    unlink($temp);
    if ($errs) {
        &system_logged("$config{'squid_path'} -k shutdown -f $config{'squid_conf'} >/dev/null 2>&1");
        print "$text{'clear_failrestart'}<br>\n";
        print "<pre>".&html_escape($errs)."</pre>\n";
        }
    }

&webmin_log("init");
&ui_print_footer("", $text{'icache_return'});


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0033 ]--