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


Viewing file:     faxsettingsform.py (4.04 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2006 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Author: Don Welch
#



from qt import *
from faxsettingsform_base import FaxSettingsForm_base
from base.g import *
from base import device, pml, utils

class PhoneNumValidator(QValidator):
    def __init__(self, parent=None, name=None):
        QValidator.__init__(self, parent, name)

    def validate(self, input, pos):
        input = str(input)
        if not input:
            return QValidator.Acceptable, pos
        elif input[pos-1] not in '0123456789-(+) ':
            return QValidator.Invalid, pos
        elif len(input) > 50:
            return QValidator.Invalid, pos
        else:
            return QValidator.Acceptable, pos
            
            
class StationNameValidator(QValidator):
    def __init__(self, parent=None, name=None):
        QValidator.__init__(self, parent, name)

    def validate(self, input, pos):
        input = str(input)
        if not input:
            return QValidator.Acceptable, pos
        # TODO: Find valid chars for this field
        elif input != utils.printable(input): 
            return QValidator.Invalid, pos
        elif len(input) > 50:
            return QValidator.Invalid, pos
        else:
            return QValidator.Acceptable, pos
            
    

class FaxSettingsForm(FaxSettingsForm_base):

    def __init__(self, dev, fax_num, name_co, parent = None,name = None,modal = 0,fl = 0):
        FaxSettingsForm_base.__init__(self,parent,name,modal,fl)
        self.dev = dev
        
        self.faxEdit.setValidator(PhoneNumValidator(self.faxEdit))
        self.nameEdit.setValidator(StationNameValidator(self.nameEdit))
        self.voiceEdit.setValidator(PhoneNumValidator(self.voiceEdit))
        
##        try:
##            result_code, fax_num = dev.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)
##        except Error:
##            log.error("PML failure.")
##        else:
##            fax_num = str(fax_num)
        self.faxEdit.setText(fax_num)
##            
##        try:
##            result_code, name = dev.getPML(pml.OID_FAX_STATION_NAME)
##        except Error:
##            log.error("PML failure.")
##            name = str(name)
        self.nameEdit.setText(name_co)
        
        self.setOKButton(fax_num and name_co)
        
        self.voiceEdit.setText(user_cfg.fax.voice_phone or '')
        self.emailEdit.setText(user_cfg.fax.email_address or user_cfg.alerts.email_address or '')
        
    def faxEdit_textChanged(self,a0):
        self.setOKButton()
        
    def nameEdit_textChanged(self,a0):
        self.setOKButton()
        
    def setOKButton(self, toggle=None):
        if toggle is not None:
            self.pushButtonOK.setEnabled(bool(toggle))
        else:
            name = str(self.nameEdit.text())
            fax_num = str(self.faxEdit.text())
            self.pushButtonOK.setEnabled(bool(name and fax_num))
        
        
    def accept(self):
        try:
            self.dev.setPML(pml.OID_FAX_LOCAL_PHONE_NUM, str(self.faxEdit.text()))
            self.dev.setPML(pml.OID_FAX_STATION_NAME, str(self.nameEdit.text()))
        except Error:
            log.error("Error setting fax settings to device.")
            
        user_cfg.fax.voice_phone = str(self.voiceEdit.text())
        user_cfg.fax.email_address = str(self.emailEdit.text())
        FaxSettingsForm_base.accept(self)
        

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