<commit_before>from lib.common import helpers

class Module:

    def __init__(self, mainMenu, params=[]):

        # metadata info about the module, not modified during runtime
        self.info = {
            # name for the module that will appear in module menus
            'Name': 'PowerCat',

            # list of one or more authors for the module
            'Author': ['besimorhino'],

            # more verbose multi-line description of the module
            'Description': ('powercat is a powershell function. First you need to load the function before you can execute it.'
                            'You can put one of the below commands into your powershell profile so powercat is automatically'
			    'loaded when powershell starts..'),
            # True if the module needs to run in the background
            'Background' : False,

            # File extension to save the file as
            'OutputExtension' : None,

            # True if the module needs admin rights to run
            'NeedsAdmin' : False,

            # True if the method doesn't touch disk/is reasonably opsec safe
            'OpsecSafe' : True,
            
            'Language' : 'powershell',

            'MinLanguageVersion' : '2',

            # list of any references/other comments
            'Comments': [
                'comment',
                'https://github.com/besimorhino/powercat'
            ]
        }

        # any options needed by the module, settable during runtime
        self.options = {
            # format:
            #   value_name : {description, required, default_value}
            'l' : {
                'Description'   :   'Switch. Listen for a connection',
                'Required'      :   False,
                'Value'         :   ''
            },
            'c' : {
                'Description'   :   'Connect to a listener',
                'Required'      :   False,
                'Value'         :   ''
            },
            'p' : {
                'Description'   :   'The port to connect to, or listen on.',
                'Required'      :   False,
                'Value'         :   ''            
            },
            'e' : {
                'Description'   :   'Execute. (GAPING_SECURITY_HOLE) ',
                'Required'      :   False,
                'Value'         :   'reverse_https'
            },
            'ep' : {
                'Description'   :   'Switch. Execute Powershell.',
                'Required'      :   False,
                'Value'         :   ''
            },
            'r' : {
                'Description'   :   'Switch. Relay. Format: -r tcp:10.1.1.1:443',
                'Required'      :   False,
                'Value'         :   ''
            },
			'u' : {
                'Description'   :   'Switch. Transfer data over UDP.',
                'Required'      :   False,
                'Value'         :   ''
            },
			'u' : {
                'Description'   :   'Switch. Transfer data over UDP.',
                'Required'      :   False,
                'Value'         :   ''
            },
			'dns' : {
                'Description'   :   'Transfer data over dns (dnscat2).',
                'Required'      :   False,
                'Value'         :   ''<commit_msg>add powercat.py<commit_after>from lib.common import helpers

class Module:

    def __init__(self, mainMenu, params=[]):

        # metadata info about the module, not modified during runtime
        self.info = {
            # name for the module that will appear in module menus
            'Name': 'PowerCat',

            # list of one or more authors for the module
            'Author': ['besimorhino'],

            # more verbose multi-line description of the module
            'Description': ('powercat is a powershell function. First you need to load the function before you can execute it.'
                            'You can put one of the below commands into your powershell profile so powercat is automatically'
			    'loaded when powershell starts..'),
            # True if the module needs to run in the background
            'Background' : True,

            # File extension to save the file as
            'OutputExtension' : None,

            # True if the module needs admin rights to run
            'NeedsAdmin' : False,

            # True if the method doesn't touch disk/is reasonably opsec safe
            'OpsecSafe' : True,
            
            'Language' : 'powershell',

            'MinLanguageVersion' : '2',

            # list of any references/other comments
            'Comments': [
                'comment',
                'https://github.com/besimorhino/powercat'
            ]
        }

        # any options needed by the module, settable during runtime
        self.options = {
            # format:
            #   value_name : {description, required, default_value}
			'Agent' : {
                'Description'   :   'Agent to run module on.',
                'Required'      :   True,
                'Value'         :   ''
            },
            'l' : {
                'Description'   :   'Switch. Listen for a connection',
                'Required'      :   False,
                'Value'         :   ''
            },
            'c' : {
                'Description'   :   'Connect to a listener',
                'Required'      :   False,
                'Value'         :   ''
            },
            'p' : {
                'Description'   :   'The port to connect to, or listen on.',
                'Required'      :   False,
                'Value'         :   ''            
            },
            'e' : {
                'Description'   :   'Execute. (GAPING_SECURITY_HOLE) ',
                'Required'      :   False,
                'Value'         :   ''
            },
            'ep' : {
                'Description'   :   'Switch. Execute Powershell.',
                'Required'      :   False,
                'Value'         :   ''
            },
            'r' : {
                'Description'   :   'Switch. Relay. Format: -r tcp:10.1.1.1:443',
                'Required'      :   False,
                'Value'         :   ''
            },
			'u' : {
                'Description'   :   'Switch. Transfer data over UDP.',
                'Required'      :   False,
                'Value'         :   ''
            },
			'u' : {
                'Description'   :   'Switch. Transfer data over UDP.',
                'Required'      :   False,
                'Value'         :   ''
            },
			'dns' : {
                'Description'   :   'Transfer data over dns (dnscat2).',
                'Required'      :   False,
                'Value'         :   ''
{'fraction_non_alphanumeric': 0.10047211566833875, 'fraction_numerical': 0.0029507229271171437, 'mean_word_length': 1.0968141045468605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3128876', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1660, 'n_words': 504}