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


Viewing file:     htaccess-lib.pl (3.49 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# htaccess-lib.pl
# Common functions for the htaccess and htpasswd file management module

BEGIN { push(@INC, ".."); };
use WebminCore;
&init_config();
do 'htpasswd-file-lib.pl';

@accessdirs = ( );
if ($module_info{'usermin'}) {
    # Allowed directories are in module configuration
    &switch_to_remote_user();
    &create_user_config_dirs();
    $default_dir = &resolve_links($remote_user_info[7]);
    push(@accessdirs, $default_dir) if ($config{'home'});
    local $d;
    foreach $d (split(/\t+/, $config{'dirs'})) {
        push(@accessdirs, $d =~ /^\// ? $d : "$default_dir/$d");
        }
    @accessdirs = &expand_root_variables(@accessdirs);
    $directories_file = "$user_module_config_directory/directories";
    $apachemod = "htaccess";
    $can_htpasswd = $config{'can_htpasswd'};
    $can_htgroups = $config{'can_htgroups'};
    $can_create = !$config{'nocreate'};
    }
else {
    # Allowed directories come from ACL
    %access = &get_module_acl();
    local @uinfo;
    if (&supports_users()) {
        # Include user home
        @uinfo = getpwnam($remote_user);
        if ($access{'home'} && scalar(@uinfo)) {
            push(@accessdirs, &resolve_links($uinfo[7]));
            }
        }
    local $d;
    foreach $d (split(/\t+/, $access{'dirs'})) {
        push(@accessdirs, $d =~ /^\// || !@uinfo ?
            $d : &resolve_links("$uinfo[7]/$d"));
        }
    $directories_file = "$module_config_directory/directories";
    $directories_file .= ".".$remote_user if ($access{'userdirs'});
    $apachemod = "apache";
    $can_htpasswd = 1;
    $can_htgroups = 1;
    $default_dir = $accessdirs[0];
    $can_sync = $access{'sync'};
    $can_create = !$access{'uonly'};
    }

# list_directories([even-if-missing])
# Returns a list of protected directories known to this module, and the
# users file, encryption mode, sync mode and groups file for each
sub list_directories
{
local @rv;
open(DIRS, $directories_file);
while(<DIRS>) {
    s/\r|\n//g;
    local @dir = split(/\t+/, $_);
    next if (!@dir);
    if ($_[0] || -d $dir[0] && -r "$dir[0]/$config{'htaccess'}") {
        push(@rv, \@dir);
        }
    }
closedir(DIRS);
return @rv;
}

# save_directories(&dirs)
# Save the list of known directories, which must be in the same format as
# returned by list_directories
sub save_directories
{
local $d;
&open_tempfile(DIRS, ">$directories_file");
foreach $d (@{$_[0]}) {
    &print_tempfile(DIRS, join("\t", @$d),"\n");
    }
&close_tempfile(DIRS);
}

# can_access_dir(dir)
# Returns 1 if files can be created under some directory, 0 if not
sub can_access_dir
{
return 1 if (!$ENV{'GATEWAY_INTERFACE'});
local $d;
foreach $d (@accessdirs) {
    return 1 if (&is_under_directory(&resolve_links($d),
                     &resolve_links($_[0])));
    }
return 0;
}

# switch_user()
# Switch to the Unix user that files are accessed as.
# No need to do anything for Usermin, because the switch was done above.
sub switch_user
{
if (!$module_info{'usermin'} &&
    $access{'user'} ne 'root' && !defined($old_uid) && &supports_users()) {
    local @uinfo = getpwnam($access{'user'} eq "*" ? $remote_user
                               : $access{'user'});
    $old_uid = $>;
    $old_gid = $);
    $) = "$uinfo[3] $uinfo[3]";
    $> = $uinfo[2];
    }
}

sub switch_back
{
if (defined($old_uid)) {
    $> = $old_uid;
    $) = $old_gid;
    $old_uid = $old_gid = undef;
    }
}

# expand_root_variables(dir, ...)
# Replaces $USER and $HOME in a list of dirs
sub expand_root_variables
{
local @rv;
local %hash = ( 'user' => $remote_user_info[0],
        'home' => $remote_user_info[7],
        'uid' => $remote_user_info[2],
        'gid' => $remote_user_info[3] );
my @ginfo = getgrgid($remote_user_info[3]);
$hash{'group'} = $ginfo[0];
foreach my $dir (@_) {
    push(@rv, &substitute_template($dir, \%hash));
    }
return @rv;
}

1;


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