Example #1
0
def run(cmdArguments):
    # 获取当前使用的rc4加密key
    rc4_key = get_rc4_key(cmdArguments.get('new_key'))
    Log.log_message(
        '[*]server cipher key: {}'.format(BOLD(rc4_key)), log_type=Log.SERVER)
    cmdArguments['new_key'] = rc4_key
    # 启动http监听服务
    host = cmdArguments['host']
    port = int(cmdArguments['port'])

    httpd = Server(cmdArguments)
    httpd.start()

    Log.log_message(
        '[*]host connect ip is {}:{}...'.format(BOLD(host), BOLD(port)), log_type=Log.SERVER)

    print_online_cmd(host, port)

    # 控制台命令输入
    try:
        while True:
            if not httpd.shell.get_command():
                httpd.shutdown()
                exit()
    except KeyboardInterrupt:
        httpd.shutdown()
        Log.log_message('server shutdown', log_type=Log.SERVER)
Example #2
0
def run(ip, port, new_key, sleep_time):
    # 获取当前使用的rc4加密key
    rc4_key = get_rc4_key(new_key)
    Log.log_message(
        '[*]server cipher key: {}'.format(BOLD(rc4_key)), log_type=Log.SERVER)
    # 启动http监听服务
    session = Session()
    shell = Shell(session)
    httpd = Server(ip, port, JSCatServer, session, shell, rc4_key, sleep_time)
    httpd.start()
    Log.log_message(
        '[*]server running in  {}:{}...'.format(BOLD('0.0.0.0'), BOLD(port)), log_type=Log.SERVER)
    Log.log_message(
        '[*]host connect ip is {}:{}...'.format(BOLD(ip), BOLD(port)), log_type=Log.SERVER)

    print_online_cmd(ip, port)
    # 控制台命令输入
    try:
        while True:
            if not httpd.shell.get_command():
                httpd.shutdown()
                exit()
    except KeyboardInterrupt:
        httpd.shutdown()
        Log.log_message('server shutdown', log_type=Log.SERVER)
Example #3
0
def run(ip, port, new_key, sleep_time):
    # 获取当前使用的rc4加密key
    rc4_key = get_rc4_key(new_key)
    print('[*]server encrypt key is {}'.format(BOLD(rc4_key)))
    # 启动http监听服务
    session = Session()
    shell = Shell(session)
    httpd = Server(ip, port, JSCatServer, session, shell, rc4_key, sleep_time)
    httpd.start()
    print('[*]server running in {}:{}...'.format(BOLD(ip), BOLD(port)))
    print_online_cmd(ip, port)
    # 控制台命令输入
    try:
        while True:
            if not httpd.shell.get_command():
                httpd.shutdown()
                exit()
    except KeyboardInterrupt:
        httpd.shutdown()
        print('server shutdown')
def main(args):
    utils.clearscreen()

    try:
        if(len(args) == 2):
            config = ConfigParser.ConfigParser()
            config.read(args[1])

            # Datos de servidor.
            s_host = config.get("SERVER", "Host")
            s_port = config.getint("SERVER", "Port")
            s_webdir = config.get("SERVER", "Webdir")
            s_idxdir = config.get("SERVER", "Idxpath")
            s_errdir = config.get("SERVER", "ErrPath")
            s_logdir = config.get("SERVER", "Logpath")

        elif len(args) == 7:
            s_host = args[1]
            s_port = int(args[2])
            s_webdir = args[3]
            s_idxdir = args[4]
            s_errdir = args[5]
            s_logdir = args[6]
        else:
            print utils.msg_argv
            raw_input()
            sys.exit(0)

        # Inicio de servidor.
        server = Server(s_host, s_port, s_webdir, s_idxdir, s_errdir, s_logdir)
        server.start()
    except KeyboardInterrupt:
        pass
    except Exception, e:
        print utils.msg_file_not_found
        print e
        raw_input()
        sys.exit(0)
Example #5
0
def main():
    """Start the application"""
    server = Server()
    server.start()
Example #6
0
**The main module**

Just starts the application. Run "python proxy.py" and configure 
the browser HTTP proxy to server port. By default the port is 12000,
you can change on config.json file, is the port is been used the
next will be try and on.
"""
__docformat__ = 'reStructuredText'

import sys
import json
from lib.server import Server
from lib.setup import Setup
from lib.log import Log

if __name__ == '__main__':

    try:
        setup = Setup()
        cfg = setup.config
        msg = "ProxY port load from file, trying to listening on " + cfg['port']
        Log(msg)
        print msg
        server = Server(int(cfg['port']), cfg['auto_increment_port'],
                        cfg['cache'])
        server.start()
    except KeyboardInterrupt:
        print "\nUser Requested An Interrupt"
        print "ProxY Exiting..."
        sys.exit()