TARGETS plugin
TARGETS plugin is used to load detection targets during system initialization, such as loading targets from redis or database.
from pocsuite3.api import PluginBase
from pocsuite3.api import PLUGIN_TYPE
from pocsuite3.api import logger
from pocsuite3.api import register_plugin
class TargetPluginDemo(PluginBase):
category = PLUGIN_TYPE.TARGETS
def init(self):
targets = ['www.a.com', 'www.b.com'] # load from redis, database ...
count = 0
for target in targets:
if self.add_target(target):
count += 1
info_msg = "[PLUGIN] get {0} target(s) from demo".format(count)
logger.info(info_msg)
register_plugin(TargetPluginDemo)