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


Viewing file:     hp-fab (26.44 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/env python
# -*- 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
#

__version__ = '2.0'
__title__ = "Fax Address Book"
__doc__ = "A simple fax address book for HPLIP."

import cmd


from base.g import *
from base import utils

import getopt

log.set_module("hp-fab")


def additional_copyright():
    log.info("Includes code from KirbyBase 1.8.1")
    log.info("Copyright (c) Jamey Cribbs (jcribbs@twmi.rr.com)")
    log.info("Licensed under the Python Software Foundation License.")
    log.info("")

USAGE = [(__doc__, "", "name", True),
         ("Usage: hp-fab [MODE] [OPTIONS]", "", "summary", True),
         ("[MODE]", "", "header", False),
         ("Enter interactive mode:", "-i or --interactive (see Note 1)", "option", False),
         ("Enter graphical UI mode:", "-u or --gui (Default)", "option", False),
         #("Run in non-interactive mode (batch mode):", "-n or --non-interactive", "option", False),
         utils.USAGE_SPACE,
         utils.USAGE_OPTIONS,
         utils.USAGE_LOGGING1, utils.USAGE_LOGGING2, utils.USAGE_LOGGING3,
         utils.USAGE_HELP,
         utils.USAGE_NOTES,
         ("1. Use 'help' command at the fab > prompt for command help (interactive mode (-i) only).", "", "note", False),
         utils.USAGE_SPACE,
         utils.USAGE_SEEALSO,
         ("hp-sendfax", "", "seealso", False),
         ]
         
def usage(typ='text'):
    if typ == 'text':
        utils.log_title(__title__, __version__)
        additional_copyright()
        
    utils.format_text(USAGE, typ, __title__, 'hp-fab', __version__)
    sys.exit(0)

    
    
    
    
## Console class (from ASPN Python Cookbook)
## Author:   James Thiele
## Date:     27 April 2004
## Version:  1.0
## Location: http://www.eskimo.com/~jet/python/examples/cmd/
## Copyright (c) 2004, James Thiele

class Console(cmd.Cmd):

    def __init__(self):
        cmd.Cmd.__init__(self)
        self.intro  = "Type 'help' for a list of commands. Type 'exit' or 'quit' to quit."
        self.db =  fax.FaxAddressBook() # kirbybase instance
        self.prompt = utils.bold("fab > ")

    ## Command definitions ##
    def do_hist(self, args):
        """Print a list of commands that have been entered"""
        print self._hist

    def do_exit(self, args):
        """Exits from the console"""
        return -1

    def do_quit(self, args):
        """Exits from the console"""
        return -1

    ## Command definitions to support Cmd object functionality ##
    def do_EOF(self, args):
        """Exit on system end of file character"""
        return self.do_exit(args)

    def do_help(self, args):
        """Get help on commands
           'help' or '?' with no arguments prints a list of commands for which help is available
           'help ' or '? ' gives help on 
        """
        ## The only reason to define this method is for the help text in the doc string
        cmd.Cmd.do_help(self, args)

    ## Override methods in Cmd object ##
    def preloop(self):
        """Initialization before prompting user for commands.
           Despite the claims in the Cmd documentaion, Cmd.preloop() is not a stub.
        """
        cmd.Cmd.preloop(self)   ## sets up command completion
        self._hist    = []      ## No history yet
        self._locals  = {}      ## Initialize execution namespace for user
        self._globals = {}
        
        self.do_list('')

    def postloop(self):
        """Take care of any unfinished business.
           Despite the claims in the Cmd documentaion, Cmd.postloop() is not a stub.
        """
        cmd.Cmd.postloop(self)   ## Clean up command completion
        print "Exiting..."

    def precmd(self, line):
        """ This method is called after the line has been input but before
            it has been interpreted. If you want to modifdy the input line
            before execution (for example, variable substitution) do it here.
        """
        self._hist += [line.strip()]
        return line

    def postcmd(self, stop, line):
        """If you want to stop the console, return something that evaluates to true.
           If you want to do some post command processing, do it here.
        """
        return stop

    def emptyline(self):
        """Do nothing on empty input line"""
        pass

    def default(self, line):
        print utils.red("error: Unrecognized command. Use 'help' to list commands.")

    def get_nickname(self, args, fail_if_match=True, alt_text=False):
        if not args:
            while True:
                if alt_text:
                    nickname = raw_input(utils.bold("Enter the entry name (nickname) to add (=done*, c=cancel) ? "))
                else:
                    nickname = raw_input(utils.bold("Enter the entry name (nickname) (c=cancel) ? "))
                
                if nickname.lower().strip() == 'c':
                    print utils.red("Canceled")
                    return ''
                    
                if not nickname:
                    if alt_text:
                        return ''
                    else:
                        print utils.red("error: Nickname must not be blank.")
                        continue
                    
                    
                if fail_if_match:
                    if self.db.select(['name'], [nickname]):
                        print utils.red("error: Entry already exists. Please choose a different name.")
                        continue
                    
                else:
                    if not self.db.select(['name'], [nickname]):
                        print utils.red("error: Entry not found. Please enter a different name.")
                        continue
                
                break
        
        else:
            nickname = args.strip()
            
            if fail_if_match:
                if self.db.select(['name'], [nickname]):
                    print utils.red("error: Entry already exists. Please choose a different name.")
                    return ''
                
            else:
                if not self.db.select(['name'], [nickname]):
                    print utils.red("error: Entry not found. Please enter a different name.")
                    return ''

        return nickname
        
        
    def get_groupname(self, args, fail_if_match=True, alt_text=False):
        all_groups = self.db.AllGroups()

        if not args:
            while True:
                if alt_text:
                    groupname = raw_input(utils.bold("Enter the group name to join (=done*, c=cancel) ? "))
                else:
                    groupname = raw_input(utils.bold("Enter the group name (c=cancel) ? "))
                
                
                if groupname.lower().strip() == 'c':
                    print utils.red("Canceled")
                    return ''
                    
                if not groupname:
                    if alt_text:
                        return ''
                    else:
                        print utils.red("error: The group name must not be blank.")
                        continue
                    
                if fail_if_match: 
                    if groupname in all_groups:
                        print utils.red("error: Entry already exists. Please choose a different name.")
                        continue
                    
                else:
                    if groupname not in all_groups:
                        print utils.red("error: Entry not found. Please enter a different name.")
                        continue
                
                break
        
        else:
            groupname = args.strip()

            if fail_if_match: 
                if groupname in all_groups:
                    print utils.red("error: Entry already exists. Please choose a different name.")
                    return ''
                
            else:
                if groupname not in all_groups:
                    print utils.red("error: Entry not found. Please enter a different name.")
                    return ''
            
        return groupname

    def do_list(self, args):
        """ 
        List entries and/or groups.
        list [groups
bool(false)

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