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


Viewing file:     packmail.py (2.92 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# Module 'packmail' -- create a self-unpacking shell archive.

# This module works on UNIX and on the Mac; the archives can unpack
# themselves only on UNIX.

import os
from stat import ST_MTIME

# Print help
def help():
    print 'All fns have a file open for writing as first parameter'
    print 'pack(f, fullname, name): pack fullname as name'
    print 'packsome(f, directory, namelist): selected files from directory'
    print 'packall(f, directory): pack all files from directory'
    print 'packnotolder(f, directory, name): pack all files from directory'
    print '                        that are not older than a file there'
    print 'packtree(f, directory): pack entire directory tree'

# Pack one file
def pack(outfp, file, name):
    fp = open(file, 'r')
    outfp.write('echo ' + name + '\n')
    outfp.write('sed "s/^X//" >"' + name + '" <<"!"\n')
    while 1:
        line = fp.readline()
        if not line: break
        if line[-1:] != '\n':
            line = line + '\n'
        outfp.write('X' + line)
    outfp.write('!\n')
    fp.close()

# Pack some files from a directory
def packsome(outfp, dirname, names):
    for name in names:
        print name
        file = os.path.join(dirname, name)
        pack(outfp, file, name)

# Pack all files from a directory
def packall(outfp, dirname):
    names = os.listdir(dirname)
    try:
        names.remove('.')
    except:
        pass
    try:
        names.remove('..')
    except:
        pass
    names.sort()
    packsome(outfp, dirname, names)

# Pack all files from a directory that are not older than a give one
def packnotolder(outfp, dirname, oldest):
    names = os.listdir(dirname)
    try:
        names.remove('.')
    except:
        pass
    try:
        names.remove('..')
    except:
        pass
    oldest = os.path.join(dirname, oldest)
    st = os.stat(oldest)
    mtime = st[ST_MTIME]
    todo = []
    for name in names:
        print name, '...',
        st = os.stat(os.path.join(dirname, name))
        if st[ST_MTIME] >= mtime:
            print 'Yes.'
            todo.append(name)
        else:
            print 'No.'
    todo.sort()
    packsome(outfp, dirname, todo)

# Pack a whole tree (no exceptions)
def packtree(outfp, dirname):
    print 'packtree', dirname
    outfp.write('mkdir ' + unixfix(dirname) + '\n')
    names = os.listdir(dirname)
    try:
        names.remove('.')
    except:
        pass
    try:
        names.remove('..')
    except:
        pass
    subdirs = []
    for name in names:
        fullname = os.path.join(dirname, name)
        if os.path.isdir(fullname):
            subdirs.append(fullname)
        else:
            print 'pack', fullname
            pack(outfp, fullname, unixfix(fullname))
    for subdirname in subdirs:
        packtree(outfp, subdirname)

def unixfix(name):
    comps = name.split(os.sep)
    res = ''
    for comp in comps:
        if comp:
            if res: res = res + '/'
            res = res + comp
    return res

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