Skip to main content

Custom, easy to integrate shell

Project description

Python application PyPI status GitHub license

!!!DISCLAIMER!!!

⚠️ This tool is experimental ⚠️ : This project currently is in early beta! The tool is extremly unstable, has a lot of unfixed bugs and currently even has no error control. USAGE AT YOU OWN RISK! We are currently working on getting everything properly working.

Console Engine

This is a simple to integrate Shell (Metasploit like)

Installation

pip3 install console-engine

Usage

You will have to pass a configuaration as Dictionary into the Shell instance. In the configuration you define the commands and their needed arguments.

Example config:

config = {
    'keywords': {
        'help': 'help_menu',
        'exit': 'exit',
        'commandone': 'method1',
        'commandtwo': 'method2',
    },
    'methods': {
        'help_menu': {
            'arguments': None
        },
        'exit': {
            'arguments': None
        },
        'method1': {
            'arguments': {
                'flags': {
                    'i': {
                        'type': 'IPADDR',
                        'idx': 'target_ip'
                    }
                }

            }
        },
        'method2': {
            'arguments': {
                'values': {
                    'STR': 'text'
                }
            }
        }
    },
}

After having made the config implement console engine into your script like in this demo script:

import cengine

if __name__=='__main__':

    shell_ = cengine.Shell(config, header='>> ')

    while True:

        inst, count = shell_.prompt()
        res = inst[0]
        
        if res['idx'] == 'help_menu':
            print("""
    command1 - returns given ip
    command2 - echos given str
    help - diplays this msg
    exit - terminates script    
    """)
        elif res['idx'] == 'exit':
            exit()
        elif res['idx'] == 'method1':
            print(res['data']['target_ip'])
        elif res['idx'] == 'method2':
            print(res['data']['text'])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

console-engine-0.1.0.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

console_engine-0.1.0-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page