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


Viewing file:     userGroupCheck.py (6.26 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
## userGroupCheck.py - code to make sure that the user/group input is valid
## Copyright (C) 2001-2005 Red Hat, Inc.
## Copyright (C) 2001-2003 Brent Fox <bfox@redhat.com>
## Copyright (C) 2004-2005 Nils Philippsen <nphilipp@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.

import string
import libuser
import gtk
import messageDialog

##
## I18N
##
from rhpl.translate import _, N_
import rhpl.translate as translate
domain = "system-config-users"
translate.textdomain (domain)

maxusernamelength = libuser.UT_NAMESIZE - 1
maxgroupnamelength = libuser.UT_NAMESIZE - 1

MSG_EMPTY = 0
MSG_TOOLONG = 1
MSG_WHITESPACE = 2
MSG_DOLLARSIGN = 3
MSG_ILLEGAL_CHARS = 4
MSG_NUMBERS = 5

user_msgs = {
    MSG_EMPTY: _("Please enter a user name."),
    MSG_TOOLONG: _("The user name must not exceed %d characters."),
    MSG_WHITESPACE: _("The user name '%s' contains whitespace. Please do not include whitespace in the user name."),
    MSG_DOLLARSIGN: _("The user name '%s' contains a dollar sign which is not at the end. Please use dollar signs only at the end of user names to indicate Samba machine accounts."),
    MSG_ILLEGAL_CHARS: _("The user name '%s' contains an invalid character at position %d."),
    MSG_NUMBERS: _("Using all numbers as the user name can cause confusion about whether the user name or numerical user id is meant. Do you really want to use a numerical-only user name?")
    }

group_msgs = {
    MSG_EMPTY: _("Please enter a group name."),
    MSG_TOOLONG: _("The group name must not exceed %d characters."),
    MSG_WHITESPACE: _("The group name '%s' contains whitespace. Please do not include whitespace in the group name."),
    MSG_ILLEGAL_CHARS: _("The group name '%s' contains an invalid character at position %d."),
    MSG_NUMBERS: _("Using all numbers as the group name can cause confusion about whether the group name or numerical group id is meant. Do you really want to use a numerical-only group name?")
    }

def isUserGroupNameOk (type, name, widget):
    if type == 'user':
        msgs = user_msgs
        maxnamelength = maxusernamelength
    if type == 'group':
        msgs = group_msgs
        maxnamelength = maxgroupnamelength

    if len (string.strip (name)) == 0:
        messageDialog.show_message_dialog (msgs[MSG_EMPTY])
        widget.set_text ("")
        widget.grab_focus ()
        return False
        
    if len(name) > maxnamelength:
        messageDialog.show_message_dialog (msgs[MSG_TOOLONG] % (maxusernamelength))
        widget.set_text ("")
        widget.grab_focus ()
        return False

    alldigits = True
    for i, j in map (lambda x: (name[x], x), range (len (name))):
        if i == "_" or (i == "-" and j != 0) or (type == "user" and i == "$" and j != 0 and j == len (name) - 1):
            #specifically allow "-" (except at the beginning), "$" at the end and "_"
            alldigits = False
            continue

        if i == "$":
            messageDialog.show_message_dialog (msgs[MSG_DOLLARSIGN] % (name))
            widget.set_text ("")
            widget.grab_focus ()
            return False

        if i not in string.ascii_letters and i not in string.digits and i != '.': 
            messageDialog.show_message_dialog (msgs[MSG_ILLEGAL_CHARS] % (name, j+1))
            widget.set_text ("")
            widget.grab_focus ()
            return False

        if i not in string.digits:
            alldigits = False

    if alldigits:
        yesno = messageDialog.show_confirm_dialog (msgs[MSG_NUMBERS])
        widget.set_text ("")
        widget.grab_focus ()
        if yesno == gtk.RESPONSE_YES:
            return True
        else:
            return False

    return True

def isUsernameOk (str, widget):
    return isUserGroupNameOk ('user', str, widget)

def isGroupnameOk(str, widget):
    return isUserGroupNameOk ('group', str, widget)

def isPasswordOk(str, widget):
    for i in str:
        if i not in string.ascii_letters and i not in string.digits and i not in string.punctuation and i not in string.whitespace:
            messageDialog.show_message_dialog(_("The password contains invalid characters.  "
                                                "Please use only ASCII characters."))
            widget.set_text("")
            widget.grab_focus()
            return 0
    return 1

def isNameOk(str, widget):
    try:
        dummy = str.decode ('utf-8')
    except UnicodeDecodeError:
        #have to check for whitespace for gecos, since whitespace is ok
        messageDialog.show_message_dialog(_("The name '%s' contains invalid characters.  "
                                            "Please use only UTF-8 characters.") % str)
        widget.set_text("")
        widget.grab_focus()
        return 0

    if string.find(str, ":") > 0:
            #have to check for colons since /etc/passwd is a colon delimited file
            messageDialog.show_message_dialog(_("The name '%s' contains a colon.  "
                                                "Please do not use colons in the name.") % str)
            widget.set_text("")
            widget.grab_focus()
            return 0
    return 1

def isHomedirOk(str, widget):
    if len(string.strip(str)) == 0:
        messageDialog.show_message_dialog(_("Please enter a home directory."))
        widget.set_text("")
        widget.grab_focus()
        return 0        

    if string.find(str, ":") > 0:
        #have to check for colons since /etc/passwd is a colon delimited file
        messageDialog.show_message_dialog(_("The directory name '%s' contains a colon.  "
                                            "Please do not use colons in the directory name.") % str)
        widget.set_text("")
        widget.grab_focus()
        return 0
    return 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.0058 ]--