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


Viewing file:     https_server.py (2.61 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/env python

"""A https server built on Medusa's http_server. 

Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved."""

import asynchat, asyncore, http_server, socket, sys
from M2Crypto import SSL, version

VERSION_STRING=version

class https_channel(http_server.http_channel):

    ac_in_buffer_size = 1 << 16

    def __init__(self, server, conn, addr):
        http_server.http_channel.__init__(self, server, conn, addr)

    def send(self, data):
        try:
            result = self.socket._write_nbio(data)
            if result <= 0:
                return 0
            else:
                self.server.bytes_out.increment(result)
                return result
        except SSL.SSLError, why:
            self.close()
            self.log_info('send: closing channel %s %s' % (repr(self), why))
            return 0

    def recv(self, buffer_size):
        try:
            result = self.socket._read_nbio(buffer_size)
            if result is None:
                return ''
            elif result == '':
                self.close()
                return ''
            else:
                self.server.bytes_in.increment(len(result))
                return result
        except SSL.SSLError, why:
            self.close()
            self.log_info('recv: closing channel %s %s' % (repr(self), why))
            return ''


class https_server(http_server.http_server):

    SERVER_IDENT='M2Crypto HTTPS Server (v%s)' % VERSION_STRING

    channel_class=https_channel

    def __init__(self, ip, port, ssl_ctx, resolver=None, logger_object=None):
        http_server.http_server.__init__(self, ip, port, resolver, logger_object)
        sys.stdout.write(self.SERVER_IDENT + '\n\n')
        sys.stdout.flush()
        self.ssl_ctx=ssl_ctx
        
    def handle_accept(self):
        # Cribbed from http_server.
        self.total_clients.increment()
        try:
            conn, addr = self.accept()
        except socket.error:
            # linux: on rare occasions we get a bogus socket back from
            # accept.  socketmodule.c:makesockaddr complains that the
            # address family is unknown.  We don't want the whole server
            # to shut down because of this.
            sys.stderr.write ('warning: server accept() threw an exception\n')
            return

        # Turn the vanilla socket into an SSL connection.
        try:
            ssl_conn=SSL.Connection(self.ssl_ctx, conn)
            ssl_conn._setup_ssl(addr)
            ssl_conn.accept_ssl()
            self.channel_class(self, ssl_conn, addr)
        except SSL.SSLError:
            pass

    def writeable(self):
        return 0


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