ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:23.46 GB of 70.42 GB (33.32%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ usr/ src/ courier-0.66.1/ debian/ - drwxrwxrwx

Directory:
Viewing file:     correctpermissions.pl (2.84 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl -w
#
# Copyright 2004 by Willi Mann <willi@wm1.at>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA  02111-1307  USA.



use strict;

while (my $line = <STDIN>)
{
    if (( my $file, my $perms, my $user, my $group, my $type) = 
        ( $line =~ /^([^\s]+)\s([^\s]+)\s([^\s]+)\s([^\s]+)(:?\s([^\s]+)|)/ ))
    {
        my $isdir = 0;
        my $isexecbyuser = 0;
        my $isexecbyother = 0;
        my $issymlink = 0;
        my $issetuid = 0;
        my $issetgid = 0;
        my $isreadablebyother = 0;
        my $pathtofile = $file;
        $pathtofile =~ s/^.*\/debian\/tmp//;

        #remove .dist from some config-files
        $pathtofile =~ s/\.dist$//;
        $perms = oct($perms);
        $isdir = 1 if -d $file;
        $isexecbyuser = 1 if $perms & 0100;
        $isexecbyother = 1 if $perms & 0001;
        $isreadablebyother = 1 if $perms & 0004;
        $issymlink = 1 if -l $file;
        $issetgid = 1 if $perms & 02000;
        $issetuid = 1 if $perms & 04000;

        
        if( $issymlink) 
        {
            # do nothing 
            $perms = "-";
            $user = "-";
            $group = "-";
        }
        #Deal with directories
        elsif( $isdir )
        {
            if (not $pathtofile =~ /\/usr/ )
            {
                #trust
            }
            else
            {
                # change to 755 root:root (dh_fixperms ?)
                $perms = 0755;
                $user = "root";
                $group = "root";
            }
        }
        #Now non-exec files
        elsif ( not $isexecbyuser )
        {
            if ( $pathtofile =~ /\/usr/ )
            {
                #change to 644 root:root (dh_fixperms ?)
                $perms = 0644;
                $user = "root";
                $group = "root";
            }
            else 
            {
                if ( $isreadablebyother )
                {    
                    #set to 644 root:root 
                    $perms = 0644;
                    $user = "root";
                    $group = "root";
                }
                else
                {
                    #trust
                }
            }
        }
        #Now with executeables
        else
        {
            if ( $issetuid )
            {
                if ( $isexecbyother )
                {
                    # set to 4755, trust for owner:group
                    $perms = 04755;
                }
                else
                {
                    # set to 4754, trust for owner:group
                    $perms = 04754;
                }
            }
            elsif ( $issetgid ) {
                if ($isexecbyother) {
                    # set to 2755, trust for owner:group
                    $perms = 02755;
                } else {
                    # set to 2754, trust for owner:group
                }
            }
            else 
            {    
                # set to 755 root:root
                $perms = 0755;
                $user = "root";
                $group = "root";
            }
        }
        next if $perms eq "-" and $user eq "-" and $group eq "-";
        printf "%s %o %s %s\n", $pathtofile, $perms, $user, $group;
        
    }
}
Command:
Quick Commands:
Upload:
[OK] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [OK]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.4685 seconds