2016-03-27 21:17:18 +00:00
|
|
|
class CMEModule:
|
|
|
|
'''
|
|
|
|
Example
|
|
|
|
Module by @yomama
|
|
|
|
|
|
|
|
'''
|
2016-06-04 07:13:38 +00:00
|
|
|
name = 'example module'
|
2016-12-15 07:28:00 +00:00
|
|
|
description = 'I do something'
|
|
|
|
supported_protocols = []
|
2016-12-20 07:23:40 +00:00
|
|
|
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?
|
2016-09-12 06:52:50 +00:00
|
|
|
|
2016-04-08 06:25:06 +00:00
|
|
|
def options(self, context, module_options):
|
2016-03-27 21:17:18 +00:00
|
|
|
'''Required. Module options get parsed here. Additionally, put the modules usage here as well'''
|
|
|
|
pass
|
|
|
|
|
|
|
|
def on_login(self, context, connection):
|
|
|
|
'''Concurrent. Required if on_admin_login is not present. This gets called on each authenticated connection'''
|
|
|
|
pass
|
|
|
|
|
2016-12-15 07:28:00 +00:00
|
|
|
def on_admin_login(self, context, connection):
|
2016-03-27 21:17:18 +00:00
|
|
|
'''Concurrent. Required if on_login is not present. This gets called on each authenticated connection with Administrative privileges'''
|
|
|
|
pass
|
|
|
|
|
2016-12-15 07:28:00 +00:00
|
|
|
def on_request(self, context, request):
|
2016-03-27 21:17:18 +00:00
|
|
|
'''Optional. If the payload needs to retrieve additonal files, add this function to the module'''
|
|
|
|
pass
|
|
|
|
|
|
|
|
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'''
|
2016-12-15 07:28:00 +00:00
|
|
|
pass
|
2017-03-27 21:09:36 +00:00
|
|
|
|
|
|
|
def on_shutdown(self, context, connection):
|
|
|
|
'''Optional. Do something on shutdown'''
|
|
|
|
pass
|