!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/sos/plugins/   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:     emc.py (11.51 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
## emc.py
## Captures EMC specific information during a sos run.

## Copyright (C) 2008 EMC Corporation. Keith Kearnan <kearnan_keith@emc.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

## 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 commands, sos.plugintools, os, sys

class emc(sos.plugintools.PluginBase):
    """EMC related information (PowerPath, Solutions Enabler CLI and Navisphere CLI)
    """

    def about_emc(self):
        """ EMC Corporation specific information
        """
        self.addCustomText('<center><h1><font size="+4"color="blue">EMC&sup2;</font><font size="-2" color="blue">&reg;</font>')
        self.addCustomText('<br><font size="+1">where information lives</font><font size="-2">&reg;</font></h1>')
        self.addCustomText("EMC Corporation is the world's leading developer and provider of information ")
        self.addCustomText("infrastructure technology and solutions that enable organizations of all sizes to transform ")
        self.addCustomText("the way they compete and create value from their information. &nbsp;")
        self.addCustomText("Information about EMC's products and services can be found at ")
        self.addCustomText('<a href="http://www.EMC.com/">www.EMC.com</a>.</center>')
        return

    def get_pp_files(self):
        """ EMC PowerPath specific information - files
        """
        self.collectExtOutput("/sbin/powermt version")
        self.addCopySpec("/etc/init.d/PowerPath")
        self.addCopySpec("/etc/powermt.custom")
        self.addCopySpec("/etc/emcp_registration")
        self.addCopySpec("/etc/emc/mpaa.excluded")
        self.addCopySpec("/etc/emc/mpaa.lams")
        self.addCopySpec("/etc/emcp_devicesDB.dat")
        self.addCopySpec("/etc/emcp_devicesDB.idx")
        self.addCopySpec("/etc/emc/powerkmd.custom")
        self.addCopySpec("/etc/modprobe.conf.pp")
        return

    def get_pp_config(self):
        """ EMC PowerPath specific information - commands
        """
        self.collectExtOutput("/sbin/powermt display")
        self.collectExtOutput("/sbin/powermt display dev=all")
        self.collectExtOutput("/sbin/powermt check_registration")
        self.collectExtOutput("/sbin/powermt display options")
        self.collectExtOutput("/sbin/powermt display ports")
        self.collectExtOutput("/sbin/powermt display paths")
        self.collectExtOutput("/sbin/powermt dump")
        return

    def get_symcli_files(self):
        """ EMC Solutions Enabler SYMCLI specific information - files
        """
        self.addCopySpec("/var/symapi/db/symapi_db.bin")
        self.addCopySpec("/var/symapi/config/[a-z]*")
        self.addCopySpec("/var/symapi/log/[a-z]*")
        return

    def get_symcli_config(self):
        """ EMC Solutions Enabler SYMCLI specific information - Symmetrix/DMX - commands
        """
        self.collectExtOutput("/usr/symcli/bin/symcli -def")
        self.collectExtOutput("/usr/symcli/bin/symdg list")
        self.collectExtOutput("/usr/symcli/bin/symdg -v list")
        self.collectExtOutput("/usr/symcli/bin/symcg list")
        self.collectExtOutput("/usr/symcli/bin/symcg -v list")
        self.collectExtOutput("/usr/symcli/bin/symcfg list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -v list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -db")
        self.collectExtOutput("/usr/symcli/bin/symcfg -semaphores list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -dir all -v list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -connections list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -app -v list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -fa all -port list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -ra all -port list")
        self.collectExtOutput("/usr/symcli/bin/symcfg -sa all -port list")
        self.collectExtOutput("/usr/symcli/bin/symcfg list -lock")
        self.collectExtOutput("/usr/symcli/bin/symcfg list -lockn all")
        self.collectExtOutput("/usr/symcli/bin/syminq")
        self.collectExtOutput("/usr/symcli/bin/syminq -v")
        self.collectExtOutput("/usr/symcli/bin/syminq -symmids")
        self.collectExtOutput("/usr/symcli/bin/syminq hba -fibre")
        self.collectExtOutput("/usr/symcli/bin/syminq hba -scsi")
        self.collectExtOutput("/usr/symcli/bin/symhost show -config")
        self.collectExtOutput("/usr/symcli/bin/stordaemon list")
        self.collectExtOutput("/usr/symcli/bin/stordaemon -v list")
        self.collectExtOutput("/usr/symcli/bin/sympd list")
        self.collectExtOutput("/usr/symcli/bin/sympd list -vcm")
        self.collectExtOutput("/usr/symcli/bin/symdev list")
        self.collectExtOutput("/usr/symcli/bin/symdev -v list")
        self.collectExtOutput("/usr/symcli/bin/symdev -rdfa list")
        self.collectExtOutput("/usr/symcli/bin/symdev -rdfa -v list")
        self.collectExtOutput("/usr/symcli/bin/symbcv list")
        self.collectExtOutput("/usr/symcli/bin/symbcv -v list")
        self.collectExtOutput("/usr/symcli/bin/symrdf list")
        self.collectExtOutput("/usr/symcli/bin/symrdf -v list")
        self.collectExtOutput("/usr/symcli/bin/symrdf -rdfa list")
        self.collectExtOutput("/usr/symcli/bin/symrdf -rdfa -v list")
        self.collectExtOutput("/usr/symcli/bin/symsnap list")
        self.collectExtOutput("/usr/symcli/bin/symsnap list -savedevs")
        self.collectExtOutput("/usr/symcli/bin/symclone list")
        self.collectExtOutput("/usr/symcli/bin/symevent list")
        self.collectExtOutput("/usr/symcli/bin/symmask list hba")
        self.collectExtOutput("/usr/symcli/bin/symmask list logins")
        self.collectExtOutput("/usr/symcli/bin/symmaskdb list database")
        self.collectExtOutput("/usr/symcli/bin/symmaskdb -v list database")
        return

    def get_navicli_config(self):
        """ EMC Navisphere Host Agent NAVICLI specific information - files
        """
        self.addCopySpec("/etc/Navisphere/agent.config")
        self.addCopySpec("/etc/Navisphere/Navimon.cfg")
        self.addCopySpec("/etc/Navisphere/Quietmode.cfg")
        self.addCopySpec("/etc/Navisphere/messages/[a-z]*")
        self.addCopySpec("/etc/Navisphere/log/[a-z]*")
        return

    def get_navicli_SP_info(self,SP_address):
        """ EMC Navisphere Host Agent NAVICLI specific information - CLARiiON - commands
        """
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getall" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getsptime -spa" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getsptime -spb" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getlog" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getdisk" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getcache" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getlun" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getlun -rg -type -default -owner -crus -capacity" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s lunmapinfo" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getcrus" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s port -list -all" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s storagegroup -list" % SP_address)
        self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s spportspeed -get" % SP_address)
        return

    def setup(self):
        ## About EMC Corporation default no if no EMC products are installed
        add_about_emc="no"

        ## If PowerPath is installed collect PowerPath specific information
        emc_pp_installed = commands.getoutput("/bin/rpm -qa | /bin/grep -i EMCpower")
        if emc_pp_installed != "":
            print "EMC PowerPath is installed."
            print " Gathering EMC PowerPath information..."
            self.addCustomText("EMC PowerPath is installed.<br>")
            self.get_pp_files()
            add_about_emc = "yes"

        ## If PowerPath is running collect additional PowerPath specific information
        if os.path.isdir("/proc/emcp"):
            print "EMC PowerPath is running."
            print " Gathering additional EMC PowerPath information..."
            self.get_pp_config()

        ## If Solutions Enabler is installed collect Symmetrix/DMX specific information
        emc_symcli_installed = commands.getoutput("/bin/rpm -qa | /bin/grep -i symcli-symcli")
        if emc_symcli_installed != "":
            print "EMC Solutions Enabler SYMCLI is installed."
            print " Gathering EMC Solutions Enabler SYMCLI information..."
            self.addCustomText("EMC Solutions Enabler is installed.<br>")
            self.get_symcli_files()
            self.get_symcli_config()
            add_about_emc = "yes"

        ## If Navisphere Host Agent is installed collect CLARiiON specific information
        if os.path.isdir("/opt/Navisphere/bin"):
            print ""
            print "The EMC CLARiiON Navisphere Host Agent is installed."
            self.addCustomText("EMC CLARiiON Navisphere Host Agent is installed.<br>")
            self.get_navicli_config()
            print " Gathering Navisphere NAVICLI Host Agent information..."
            print " Please enter a CLARiiON SP IP address.  In order to collect"
            print " information for both SPA and SPB as well as multiple"
            print " CLARiiON arrays (if desired) you will be prompted multiple times."
            print " To exit simply press [Enter]"
            print ""
            add_about_emc = "yes"
            CLARiiON_IP_address_list = []
            CLARiiON_IP_loop = "stay_in"
            while CLARiiON_IP_loop == "stay_in":
                ans = raw_input("CLARiiON SP IP Address or [Enter] to exit: ")
                ## Check to make sure the CLARiiON SP IP address provided is valid
                status, output = commands.getstatusoutput("/opt/Navisphere/bin/navicli -h %s getsptime" % ans)
                if status == 0:
                    CLARiiON_IP_address_list.append(ans)
                else:
                    if ans != "":
                        print "The IP address you entered, %s, is not to an active CLARiiON SP." % ans
                    if ans == "":
                        CLARiiON_IP_loop = "get_out"
            ## Sort and dedup the list of CLARiiON IP Addresses
            CLARiiON_IP_address_list.sort()
            for SP_address in CLARiiON_IP_address_list:
                if CLARiiON_IP_address_list.count(SP_address) > 1:
                    CLARiiON_IP_address_list.remove(SP_address)
            for SP_address in CLARiiON_IP_address_list:
                if SP_address != "":
                    print " Gathering NAVICLI information for %s..." % SP_address
                    self.get_navicli_SP_info(SP_address)

        ## Only provide About EMC if EMC products are installed
        if add_about_emc != "no":
            self.about_emc()
        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.0154 ]--