refactor(example_module): update init and formatting
parent
d3080a3304
commit
f0fe1ba8a9
|
@ -2,37 +2,51 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
class CMEModule:
|
class CMEModule:
|
||||||
'''
|
"""
|
||||||
Example
|
Example
|
||||||
Module by @yomama
|
Module by @yomama
|
||||||
|
"""
|
||||||
'''
|
def __init__(self, context=None):
|
||||||
name = 'example module'
|
self.name = 'example module'
|
||||||
description = 'I do something'
|
self.description = 'I do something'
|
||||||
supported_protocols = []
|
self.supported_protocols = []
|
||||||
opsec_safe= True #Does the module touch disk?
|
self.opsec_safe = True # Does the module touch disk?
|
||||||
multiple_hosts = True #Does it make sense to run this module on multiple hosts at a time?
|
self.multiple_hosts = True # Does it make sense to run this module on multiple hosts at a time?
|
||||||
|
self.context = context
|
||||||
|
|
||||||
def options(self, context, module_options):
|
def options(self, context, module_options):
|
||||||
'''Required. Module options get parsed here. Additionally, put the modules usage here as well'''
|
"""Required.
|
||||||
|
Module options get parsed here. Additionally, put the modules usage here as well
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_login(self, context, connection):
|
def on_login(self, context, connection):
|
||||||
'''Concurrent. Required if on_admin_login is not present. This gets called on each authenticated connection'''
|
"""Concurrent.
|
||||||
|
Required if on_admin_login is not present. This gets called on each authenticated connection
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_admin_login(self, context, connection):
|
def on_admin_login(self, context, connection):
|
||||||
'''Concurrent. Required if on_login is not present. This gets called on each authenticated connection with Administrative privileges'''
|
"""Concurrent.
|
||||||
|
Required if on_login is not present
|
||||||
|
This gets called on each authenticated connection with Administrative privileges
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_request(self, context, request):
|
def on_request(self, context, request):
|
||||||
'''Optional. If the payload needs to retrieve additonal files, add this function to the module'''
|
"""Optional.
|
||||||
|
If the payload needs to retrieve additional files, add this function to the module
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_response(self, context, response):
|
def on_response(self, context, response):
|
||||||
'''Optional. If the payload sends back its output to our server, add this function to the module to handle its output'''
|
"""Optional.
|
||||||
|
If the payload sends back its output to our server, add this function to the module to handle its output
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_shutdown(self, context, connection):
|
def on_shutdown(self, context, connection):
|
||||||
'''Optional. Do something on shutdown'''
|
"""Optional.
|
||||||
|
Do something on shutdown
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue