!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/lib/python2.4/site-packages/_xmlplus/xslt/   drwxr-xr-x
Free 50.74 GB of 127.8 GB (39.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ApplyTemplatesElement.py (3.57 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
########################################################################
#
# File Name:            ApplyTemplatesElement.py
#
#
"""
Implementation of the XSLT Spec apply-templates stylesheet element.
WWW: http://4suite.com/4XSLT        e-mail: support@4suite.com

Copyright (c) 1999-2000 FourThought Inc, USA.   All Rights Reserved.
See  http://4suite.com/COPYRIGHT  for license and copyright information
"""

from xml.dom import EMPTY_NAMESPACE
import xml.dom.Element
import xml.dom.ext
import xml.xslt
from xml.xslt import XsltElement, XSL_NAMESPACE, XsltException, Error
from xml.xpath import XPathParser
from xml.xpath import Util, g_xpathRecognizedNodes

class ApplyTemplatesElement(XsltElement):

    legalAttrs = ['select', 'mode']

    def __init__(self, doc, uri=xml.xslt.XSL_NAMESPACE,
                 localName='apply-templates', prefix='xsl', baseUri=''):
        XsltElement.__init__(self, doc, uri, localName, prefix, baseUri)

    def setup(self):

        self.__dict__['_nss'] = xml.dom.ext.GetAllNs(self)
        mode_attr = self.getAttributeNS(EMPTY_NAMESPACE, 'mode')
        if mode_attr == '':
            self.__dict__['_mode'] = None
        else:
            split_name = Util.ExpandQName(
                mode_attr,
                namespaces=self._nss
                )
            self.__dict__['_mode'] = split_name



        select = self.getAttributeNS(EMPTY_NAMESPACE, 'select')
        if select:
            parser = XPathParser.XPathParser()
            self.__dict__['_expr'] = parser.parseExpression(select)
        else:
            self.__dict__['_expr'] = None

        self.__dict__['_sortSpecs'] = []
        self.__dict__['_params'] = []
        for child in self.childNodes:
            #All children should be sort and with-param
            if child.namespaceURI == XSL_NAMESPACE:
                if child.localName == 'sort':
                    self._sortSpecs.append(child)
                elif child.localName == 'with-param':
                    self._params.append(child)
                else:
                    raise XsltException(Error.ILLEGAL_APPLYTEMPLATE_CHILD)
            else:
                raise XsltException(Error.ILLEGAL_APPLYTEMPLATE_CHILD)
        return

    def instantiate(self, context, processor):

        origState = context.copy()
        context.setNamespaces(self._nss)


        params = {}

        mode = self._instantiateMode(context)

        for param in self._params:
            (name, value) = param.instantiate(context, processor)[1]
            params[name] = value

        if self._expr:
            node_set = self._expr.evaluate(context)
        else:
            node_set = context.node.childNodes

        size = len(node_set)
        if size > 1 and len(self._sortSpecs):
            node_set = self._sortSpecs[0].instantiate(context, processor, node_set, self._sortSpecs[1:])[1]

        pos = 1
        for node in node_set:
            context.setNodePosSize((node,pos,size))
            processor.applyTemplates(context, mode, params)
            pos = pos + 1

        context.set(origState)

        return (context,)

    def _instantiateMode(self,context):
        return self._mode

    def __getstate__(self):
         base_state = XsltElement.__getstate__(self)
         new_state = (base_state, self._nss, self._sortSpecs, self._params,self._expr,self._mode)
         return new_state

    def __setstate__(self, state):
        XsltElement.__setstate__(self, state[0])
        self._nss = state[1]
        self._sortSpecs = state[2]
        self._params = state[3]
        self._expr = state[4]
        self._mode = state[5]
        return


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