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


Viewing file:     Representation.py (4.3 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"""This file contains the Representation class."""

import gtk

import Const

class Representation:
    """This class maps a device to presentation texts and icons used in
    the GUI"""

    def load_and_scale_icon(self, path):
        """Helper function for loading an icon and scaling it to 16x16"""
        orig = gtk.gdk.pixbuf_new_from_file(path)
        icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16)
        orig.scale(icon, 0, 0, 16, 16,
                   0, 0,
                   16.0/orig.get_width(),
                   16.0/orig.get_height(),
                   gtk.gdk.INTERP_HYPER)
        return icon

    def __init__(self):
        """Init the class and load neccessary resources."""
        self.icons = {}
        self.icons["computer"] = self.load_and_scale_icon(Const.DATADIR + "/hal-computer.png")
        self.icons["bus_pci"] = self.load_and_scale_icon(Const.DATADIR + "/hal-bus-pci.png")
        self.icons["bus_usb"] = self.load_and_scale_icon(Const.DATADIR + "/hal-bus-usb.png")
        self.icons["abstract"] = self.load_and_scale_icon(Const.DATADIR + "/hal-abstract.png");
        self.icons["harddisk"] = self.load_and_scale_icon(Const.DATADIR + "/hal-harddisk.png");
        self.icons["cdrom"] = self.load_and_scale_icon(Const.DATADIR + "/hal-cdrom.png");
        self.icons["floppy"] = self.load_and_scale_icon(Const.DATADIR + "/hal-floppy.png");
        self.icons["unknown"] = self.load_and_scale_icon(Const.DATADIR + "/hal-unknown.png")
        self.icons["mouse"] = self.load_and_scale_icon(Const.DATADIR + "/hal-cat-mouse.png")
        self.icons["keyboard"] = self.load_and_scale_icon(Const.DATADIR + "/hal-cat-keyboard.png")
        self.icons["cardbus"] = self.load_and_scale_icon(Const.DATADIR + "/hal-cat-cardbus.png")
        self.icons["video"] = self.load_and_scale_icon(Const.DATADIR + "/hal-video.png")
        self.icons["flash"] = self.load_and_scale_icon(Const.DATADIR + "/hal-flash.png")
        self.icons["network"] = self.load_and_scale_icon(Const.DATADIR + "/hal-network.png")
        self.icons["audio"] = self.load_and_scale_icon(Const.DATADIR + "/hal-audio.png")
        self.icons["camera"] = self.load_and_scale_icon(Const.DATADIR + "/hal-camera.png")
        self.icons["serial"] = self.load_and_scale_icon(Const.DATADIR + "/hal-serial-port.png")


    def get_icon(self, device):
        """Given a Device object return an icon to display"""

        # Default to abstract icon
        icon = self.icons["abstract"]

        try:
            product = device.properties["info.product"]
        except KeyError:
            product = "Unknown"
        except TypeError:
            return icon
            
        if product=="Computer":
            return self.icons["computer"]

        # First look at bus type, every device got Bus property
        if device.properties.has_key("info.bus"):
        bus = device.properties["info.bus"]
        if bus=="usb_device":
        icon = self.icons["bus_usb"]
        elif bus=="pci":
        icon = self.icons["bus_pci"]
    else:
        bus = "unknown"

        # Then look at Category, if available
        if not device.properties.has_key("info.category"):
            return icon
        cat = device.properties["info.category"]
        if cat=="input.mouse":
            icon = self.icons["mouse"]
        elif cat=="input.keyboard":
            icon = self.icons["keyboard"]
        elif cat=="pcmcia_socket":
            icon = self.icons["cardbus"]
        elif cat=="video4linux":
            icon = self.icons["video"]
        elif cat=="dvb":
            icon = self.icons["video"]
        elif cat=="camera":
            icon = self.icons["camera"]
        elif cat=="storage" or cat=="storage.removable":
            if device.properties.has_key("storage.media"):
                media = device.properties["storage.media"]
                if media=="cdrom":
                    icon = self.icons["cdrom"]
                elif media=="floppy":
                    icon = self.icons["floppy"]
                elif media=="disk":
                    icon = self.icons["harddisk"]
                elif media=="flash":
                    icon = self.icons["flash"]
        elif cat=="net":
            icon = self.icons["network"]
        elif cat=="multimedia.audio":
            icon = self.icons["audio"]
        elif cat=="serial":
            icon = self.icons["serial"]

        return icon

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