!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 52.23 GB of 127.8 GB (40.86%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     preferences.py (4.27 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
## preferences.py - handle application preferences in system-config-users
## Copyright (C) 2006 Red Hat, Inc.

## 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: Nils Philippsen <nphilipp@redhat.com>

class Preferences:
    defaults = {
        'FILTER': True,
        'ASSIGN_HIGHEST_UID': True,
        'ASSIGN_HIGHEST_GID': True,
        'PREFER_SAME_UID_GID': True
    }
    
    descriptions = {
        'FILTER': 'Filter out system users',
        'ASSIGN_HIGHEST_UID': 'Automatically assign highest UID for new users',
        'ASSIGN_HIGHEST_GID': 'Automatically assign highest GID for new groups',
        'PREFER_SAME_UID_GID': 'Prefer to have same UID and GID for new users'
    }
    
    def __init__ (self, filename = '/etc/sysconfig/system-config-users'):
        self.preferences = self.defaults.copy ()
        self.filename = filename
        self.configFile = None

    def __getitem__ (self, item):
        return self.preferences[item]

    def __setitem__ (self, item, value):
        if not self.has_key (item):
            raise KeyError
        self.preferences[item] = value

    def __delitem__ (self, item):
        self.preferences[item] = self.defaults[item]

    def keys (self):
        return self.defaults.keys ()

    def has_key (self, key):
        return self.defaults.has_key (key)

    def load (self):
        oldprefs = self.preferences
        self.preferences = self.defaults.copy ()

        try:
            fd = open (self.filename, 'r')
            configFile = fd.readlines ()
            fd.close ()

            linenr = 0
            for line in configFile:
                line = line.strip ()
                linenr += 1
                if line != '' and line.lstrip ()[0] != '#':
                    tokens = line.split ('=')
                    try:
                        key = tokens[0]
                        value = tokens[1]
                        if key in self.keys ():
                            if value.lower () == "true":
                                self.preferences[key] = True
                            else:
                                self.preferences[key] = False
                    except IndexError:
                        print '%s[%d]: Syntax error ("%s")' % (self.configFile, linenr, line.strip ())
            self.configFile = configFile
        except IOError:
            # no config file found, assume previous values
            self.preferences = oldprefs

    def save (self):
        found = []

        fd = open (self.filename, 'w')

        if self.configFile:
            for line in self.configFile:
                line_str = line.strip ()
                if line_str == '' or (len (line_str) and line_str[0] == '#'):
                    fd.write (line)
                else:
                    tokens = line_str.split ('=')
                    key = tokens[0].lstrip ()
                    if key in self.keys ():
                        found.append (key)
                        if self[key] == True:
                            fd.write ("%s=true\n" % (key))
                        else:
                            fd.write ("%s=false\n" % (key))

        else:
            # previously no configuration file, write standard header
            fd.write("# Configuration file for system-config-users\n")
            fd.write("\n")

        # write out defaults for non-set preferences
        for key in self.keys ():
            if key not in found:
                fd.write ("# %s\n" % self.descriptions[key])
                if self.defaults[key] == True:
                    fd.write ("%s=true\n" % (key))
                else:
                    fd.write ("%s=false\n" % (key))

        fd.close ()

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