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


Viewing file:     selinux.py (4.98 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
## selinuxProperties - event handling code for userconf's selinux properties
## Copyright (C) 2003 Red Hat, Inc.
## Copyright (C) 2003 Dan Walsh <dwalsh@redhat.com>

## 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., 675 Mass Ave, Cambridge, MA 02139, USA.

## Author: Dan Walsh

import gtk
import gobject
import commands
import string
class properties:
    def __init__(self, parent, xml):
        self.rolesCheckbox = xml.get_widget('rolesCheckbutton')
        self.availableRolesTreeView = xml.get_widget('availableRolesTreeview')
        self.setupTreeview(self.availableRolesTreeView,self.addRole)

        self.selinux_enabled = (self.initAvailableRoles() == 0)
        if not self.selinux_enabled:
            self.rolesCheckbox.set_active(False)
            self.rolesCheckbox.set_sensitive(False)
        self.assignedRolesTreeView = xml.get_widget('assignedRolesTreeview')
        self.setupTreeview(self.assignedRolesTreeView,self.removeRole)
        
        self.addRoleButton = xml.get_widget('addRoleButton')
        self.addRoleButton.connect("clicked", self.addRole)
        self.removeRoleButton = xml.get_widget('removeRoleButton')
        self.removeRoleButton.connect("clicked", self.removeRole)
        self.rolesCheckbox.connect("toggled", self.toggled_roles)
        self.toggled_roles(self.rolesCheckbox)

    def init(self,user):
        model=self.assignedRolesTreeView.get_model()
        model.clear()
        (status,msg)=commands.getstatusoutput("seuser show users %s" % user)
        if status==0:
            self.rolesCheckbox.set_active(True)
            rolestring=msg.strip().split(":")[1]
            roles=rolestring.split()
            roles.sort()
            for role in roles:
                iter = model.append()
                model.set (iter, 0, role)
        else:
            self.rolesCheckbox.set_active(False)
        
    def initAvailableRoles(self):
        model = self.availableRolesTreeView.get_model ()
        out=commands.getstatusoutput("seuser show roles")
        if out[0]==0:
            for i in out[1].split():
                iter = model.append()
                model.set (iter, 0, i)
            self.availableRolesTreeView.get_selection ().select_path ((0,))
        return out[0]
        
    def addRole(self,*args):
        result = self.availableRolesTreeView.get_selection().get_selected()
        if result != None:
            (model, iter) = result
            if iter != None:
                role = model.get_value (iter, 0)
                model=self.assignedRolesTreeView.get_model()
                roles=self.getRoles()
                if role not in roles:
                    iter = model.append()
                    model.set (iter, 0, role)
            
    def getRoles(self):
        if not self.selinux_enabled:
            return []
        m=self.assignedRolesTreeView.get_model()
        l=[]
        def getList(model, path, iter, text):
            l.append(model.get_value(iter,0))
        m.foreach (getList, None)
        return l
                     
    def saveRoles(self,user, roles):
        if not self.selinux_enabled:
            return (0,"")
        if len(roles) == 0:
            return commands.getstatusoutput("seuser delete -N %s" % (user))
            
        r= string.join(roles,",")
        result=commands.getstatusoutput("seuser change -N -R %s %s" % (r, user))
        if result[0] != 0:
            result=commands.getstatusoutput("seuser add -N -R %s %s" % (r, user))
        return result
    
    def removeRole(self,*args):
        result = self.assignedRolesTreeView.get_selection().get_selected()
        if result != None:
            (model, iter) = result
            if iter != None:
                model.remove (iter)
                
        
    def setupTreeview(self,tv,activateFunc):
        model = gtk.ListStore (gobject.TYPE_STRING)
        tv.set_model (model)
        column = gtk.TreeViewColumn (None, gtk.CellRendererText(), text=0)
        tv.append_column (column)
        model.set_sort_column_id(0, gtk.SORT_ASCENDING)
        tv.connect("row_activated",activateFunc)
        
    def toggled_roles(self, data):
        active=data.get_active();
        self.availableRolesTreeView.set_sensitive(active)
        self.assignedRolesTreeView.set_sensitive(active)
        self.addRoleButton.set_sensitive(active)
        self.removeRoleButton.set_sensitive(active)
        
    def enabled(self):
        return self.selinux_enabled
        

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