Removed kali config from yaml files. Replaced with a more generic attack_plugin config

pull/10/head
Thorsten Sick 3 years ago
parent 04215b1394
commit 279b7e59a3

@ -15,8 +15,6 @@ from pprint import pprint, pformat
# TODO: Ability deserves an own class.
# TODO: Support Stealth settings: "plain-text obfuscation","base64 obfuscation","base64jumble obfuscation","caesar cipher obfuscation","base64noPadding obfuscation","steganography obfuscation"
# TODO: Support Jitter (min/max)
# TODO: Support all Caldera agents: "Sandcat (GoLang)","Elasticat (Blue Python/ Elasticsearch)","Manx (Reverse Shell TCP)","Ragdoll (Python/HTML)"
class CalderaControl():

@ -7,7 +7,6 @@ import yaml
from app.exceptions import ConfigurationError
# TODO: Add attack scripts (that will be CACAO in the future !) and plugin config
# So the config being read is distributed into several files and they will have different formats (yaml, CACAO)
# Currently it is a single file and YAML only.
# We want to be independent from file structure or number of config files
@ -213,14 +212,14 @@ class ExperimentConfig():
raise ConfigurationError("results/loot_dir not properly set in configuration")
return res
def kali_conf(self, attack):
def attack_conf(self, attack):
""" Get kali config for a specific kali attack
@param attack: Name of the attack to look up config for
"""
try:
res = self.raw_config["kali_conf"][attack]
res = self.raw_config["attack_conf"][attack]
except KeyError:
res = {}
if res is None:

@ -193,13 +193,11 @@ class Experiment():
@returns: The output of the cmdline attacking tool
"""
# TODO: Extend beyond Kali
for plugin in self.plugin_manager.get_plugins(AttackPlugin, [attack]):
name = plugin.get_name()
self.attack_logger.vprint(f"{CommandlineColors.OKBLUE}Running Kali plugin {name}{CommandlineColors.ENDC}", 2)
plugin.process_config(self.experiment_config.kali_conf(plugin.get_config_section_name())) # TODO: De-kalify
plugin.process_config(self.experiment_config.attack_conf(plugin.get_config_section_name()))
plugin.set_attacker_machine(self.attacker_1)
plugin.set_logger(self.attack_logger)
plugin.set_caldera(self.caldera_control)

@ -150,8 +150,8 @@ plugin_based_attacks:
- fin7_1
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -253,8 +253,8 @@ plugin_based_attacks:
- nmap
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -133,8 +133,8 @@ plugin_based_attacks:
- hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -121,8 +121,8 @@ plugin_based_attacks:
# - hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -120,8 +120,8 @@ targets:
# - hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -132,8 +132,8 @@ plugin_based_attacks:
- skylla
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -123,8 +123,8 @@ plugin_based_attacks:
- hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -123,8 +123,8 @@ plugin_based_attacks:
- hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -123,8 +123,8 @@ plugin_based_attacks:
- hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -123,8 +123,8 @@ plugin_based_attacks:
- hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -116,8 +116,8 @@ plugin_based_attacks:
- hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -128,8 +128,8 @@ plugin_based_attacks:
- hydra
###
# Configuration for the kali attack tools
kali_conf:
# Configuration for the plugin based attack tools
attack_conf:
###
# Hydra configuration
hydra:

@ -561,26 +561,26 @@ class TestExperimentConfig(unittest.TestCase):
ex = ExperimentConfig("tests/data/attacker_has_empty_nicknames.yaml")
self.assertEqual(ex._targets[0].get_nicknames(), [1, 2, 3])
def test_missing_kali_config(self):
""" Getting kali config for a specific attack. Attack missing """
def test_missing_attack_config(self):
""" Getting attack config for a specific attack. Attack missing """
ex = ExperimentConfig("tests/data/basic.yaml")
self.assertEqual(ex.kali_conf("BOOM"), {})
self.assertEqual(ex.attack_conf("BOOM"), {})
def test_working_kali_config(self):
""" Getting kali config for a specific attack """
def test_working_attack_config(self):
""" Getting attack config for a specific attack """
ex = ExperimentConfig("tests/data/basic.yaml")
data = ex.kali_conf("hydra")
data = ex.attack_conf("hydra")
self.assertEqual(data["userfile"], "users.txt")
def test_kali_config_missing_attack_data(self):
""" Getting kali config for a specific attack: Missing """
def test_attack_config_missing_attack_data(self):
""" Getting attack config for a specific attack: Missing """
ex = ExperimentConfig("tests/data/attacks_missing.yaml")
data = ex.kali_conf("missing")
data = ex.attack_conf("missing")
self.assertEqual(data, {})
def test_missing_caldera_config_obfuscator(self):

Loading…
Cancel
Save