!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/mount/   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:     index.cgi (3.98 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# index.cgi
# Display a list of known filesystems, and indicate which are currently mounted

require './mount-lib.pl';
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
    &help_search_link("mount fstab vfstab", "man"));

# List filesystems from fstab and mtab
@mounted = &list_mounted();
$yes = $text{'yes'};
$no = "<font color=#ff0000>$text{'no'}</a>";
foreach (&list_fstypes()) { $can_edit{$_}++; }
$i = 0;
foreach $m (&list_mounts()) {
    $m->[0] = "swap" if ($m->[2] eq "swap");
    $mounts{$m->[0],$m->[1]} = $i++;
    push(@all, $m);
    }
$i = 0;
foreach $m (&list_mounted()) {
    $m->[0] = "swap" if ($m->[2] eq "swap");
    $mounted{$m->[0],$m->[1]} = $i++;
    push(@all, $m) if (!defined($mounts{$m->[0],$m->[1]}));
    }

# Sort by chosen mode
if ($config{'sort_mode'} == 2) {
    @all = sort { lc($a->[0]) cmp lc($b->[0]) } @all;
    }
elsif ($config{'sort_mode'} == 1) {
    @all = sort { &fstype_name($a->[2]) cmp &fstype_name($b->[2]) } @all;
    }

# Build visible filesystems list
foreach $m (@all) {
    @minfo = @$m;
    $p = &simplify_mount_path($minfo[0], $minfo[2]);
    next if ($ignore{$minfo[2]});
    @mmodes = &mount_modes($minfo[2], $minfo[0], $minfo[1]);
    $canedit = $can_edit{$minfo[2]} && !$mmodes[4] &&
                   &can_edit_fs(@minfo);
    next if (!$canedit && $access{'hide'});
    push(@visible, $m);
    }

if (@visible) {
    # Show table of all visible filesystems
    &show_button();
    print &ui_columns_start([ $text{'index_dir'},
                $text{'index_type'},
                $text{'index_dev'},
                $config{'show_used'} ? ( $text{'index_used'} )
                             : ( ),
                $text{'index_use'},
                $text{'index_perm'} ], 100);
    foreach $m (@visible) {
        @minfo = @$m;
        $p = &simplify_mount_path($minfo[0], $minfo[2]);

        $midx = $mounts{$minfo[0],$minfo[1]};
        $medidx = $mounted{$minfo[0],$minfo[1]};
        @mmodes = &mount_modes($minfo[2], $minfo[0], $minfo[1]);
        $canedit = $can_edit{$minfo[2]} && !$mmodes[4] &&
               &can_edit_fs(@minfo);
        local @cols;
        if ($canedit && !$access{'only'}) {
            if (defined($midx)) {
                push(@cols, "<a href=\"edit_mount.cgi?".
                        "index=$midx\">$p</a>");
                }
            else {
                push(@cols, "<a href=\"edit_mount.cgi?".
                        "temp=1&index=$medidx\">$p</a>");
                }
            }
        else {
            push(@cols, $p);
            }
        local $fsn = &fstype_name($minfo[2]);
        $fsn .= " ($minfo[2])" if (uc($fsn) ne uc($minfo[2]));
        push(@cols, $minfo[2] eq "*" ? $text{'index_auto'} : $fsn);
        push(@cols, &device_name($minfo[1]));
        if ($config{'show_used'}) {
            # Add disk space used column
            ($total, $free) = &disk_space($minfo[2],$minfo[0]);
            if ($total > 0 && $total >= $free) {
                $pc = int(100*($total-$free) / $total);
                push(@cols,
                 $pc >= 99 ? "<font color=red>$pc %</font>" :
                 $pc >= 95 ? "<font color=orange>$pc %</font>" :
                         $pc."%");
                }
            else {
                push(@cols, "");
                }
            }
        if (&can_edit_fs(@minfo)) {
            push(@cols,
                defined($medidx) ?
                "<a href='unmount.cgi?index=$medidx'>$yes</a>" :
                "<a href='mount.cgi?index=$midx'>$no</a>");
            }
        else {
            push(@cols, defined($medidx) ? $yes : $no);
            }
        push(@cols, defined($midx) ? $yes : $no);
        print &ui_columns_row(\@cols);
        }
    print &ui_columns_end(),"<br>\n";
    }
else {
    print "<b>$text{'index_none'}</b><p>\n";
    }
&show_button();

&ui_print_footer("/", $text{'index'});

sub simplify_mount_path
{
if ($_[1] eq "swap") {
    return "<i>$text{'index_swap'}</i>";
    }
elsif (length($_[0]) > 20) {
    return &html_escape("... ".substr($_[0], length($_[0])-20));
    }
elsif ($_[0] eq "/") {
    return "/ (<i>$text{'index_root'}</i>)";
    }
else {
    return &html_escape($_[0]);
    }
}

sub show_button
{
return if (!$access{'create'} || $access{'only'});
local %donefs;
print "<form action=\"edit_mount.cgi\">\n";
print "<input type=submit value=\"$text{'index_add'}\"> $text{'index_type'}:\n";
print "<select name=type>\n";
local $fs;
foreach $fs (sort { &fstype_name($a) cmp &fstype_name($b) } &list_fstypes()) {
    local $nm = &fstype_name($fs);
    if (!$donefs{$nm}++ && &can_fstype($fs)) {
        print "<option value=\"$fs\">$nm ($fs)\n";
        }
    }
print "</select></form>\n";
}


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