From 4c0321ab9384d0e9f4aa81afb048a293c9251243 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Sun, 26 Jan 2020 18:47:46 +0200 Subject: [PATCH] Added collector and submodule --- .gitmodules | 3 +++ .../common/data/system_info_collectors_names.py | 1 + .../system_info/collectors/scoutsuite | 1 + .../collectors/scoutsuite_collector.py | 16 ++++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 .gitmodules create mode 160000 monkey/infection_monkey/system_info/collectors/scoutsuite create mode 100644 monkey/infection_monkey/system_info/collectors/scoutsuite_collector.py diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..bcb7399ee --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "monkey/infection_monkey/system_info/collectors/scoutsuite"] + path = monkey/infection_monkey/system_info/collectors/scoutsuite + url = git@github.com:ShayNehmad/ScoutSuite.git diff --git a/monkey/common/data/system_info_collectors_names.py b/monkey/common/data/system_info_collectors_names.py index 831bbe142..ad8a3fd74 100644 --- a/monkey/common/data/system_info_collectors_names.py +++ b/monkey/common/data/system_info_collectors_names.py @@ -2,3 +2,4 @@ AWS_COLLECTOR = "AwsCollector" HOSTNAME_COLLECTOR = "HostnameCollector" ENVIRONMENT_COLLECTOR = "EnvironmentCollector" PROCESS_LIST_COLLECTOR = "ProcessListCollector" +SCOUTSUITE_COLLECTOR = "ScoutSuiteCollector" diff --git a/monkey/infection_monkey/system_info/collectors/scoutsuite b/monkey/infection_monkey/system_info/collectors/scoutsuite new file mode 160000 index 000000000..e784fc27a --- /dev/null +++ b/monkey/infection_monkey/system_info/collectors/scoutsuite @@ -0,0 +1 @@ +Subproject commit e784fc27ae8311c3c610bccd556d2bef3cd54d63 diff --git a/monkey/infection_monkey/system_info/collectors/scoutsuite_collector.py b/monkey/infection_monkey/system_info/collectors/scoutsuite_collector.py new file mode 100644 index 000000000..6645290f5 --- /dev/null +++ b/monkey/infection_monkey/system_info/collectors/scoutsuite_collector.py @@ -0,0 +1,16 @@ +import logging + +from common.data.system_info_collectors_names import SCOUTSUITE_COLLECTOR +from infection_monkey.system_info.system_info_collector import SystemInfoCollector +from infection_monkey.system_info.collectors.scoutsuite.ScoutSuite.__main__ import run + +logger = logging.getLogger(__name__) + + +class HostnameCollector(SystemInfoCollector): + def __init__(self): + super().__init__(name=SCOUTSUITE_COLLECTOR) + + def collect(self) -> dict: + + return {}