Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
1e7ed54
test
May 29, 2020
bd02019
test
May 29, 2020
a8ad12a
test
May 29, 2020
361acdb
test
V4K11 May 30, 2020
e5d4f10
test1
V4K11 May 30, 2020
5329ba2
Merge branch 'dev' of https://github.com/qsecure-labs/overlord into dev
Sikkis May 30, 2020
949e7e1
bug: change ignore on projects
Sikkis May 30, 2020
cd47be1
feat: add clone command & minor bug fixes
Sikkis May 30, 2020
1eb53dd
feat: initial TF change for Kali support AWS
V4K11 Jun 1, 2020
f2da946
feat: add kali support on aws C2
Sikkis Jun 2, 2020
26c7885
Update: iRedMail and installation script
V4K11 Jun 2, 2020
3527716
V4K11 Jun 2, 2020
e35fea9
bug: empire script update
Sikkis Jun 3, 2020
d9a757e
Update: Installation commands
V4K11 Jun 3, 2020
5ccd6ff
V4K11 Jun 3, 2020
180a4bf
V4K11 Jun 3, 2020
5b01596
V4K11 Jun 3, 2020
079db58
feat: localhost pfwd for http traffic
Sikkis Jun 3, 2020
0553229
Feat: Added support for Ubuntu on AWS
V4K11 Jun 3, 2020
f9c0ef8
feat: Support for Ubuntu on both AWS and DO on the C2
V4K11 Jun 3, 2020
ce95b14
Update: read me moved to wiki
V4K11 Jun 3, 2020
83af5d2
Update README.md
V4K11 Jun 3, 2020
9d897c7
Update README.md
V4K11 Jun 3, 2020
a37a75c
Update README.md
V4K11 Jun 3, 2020
0d822ed
Feat: Support for GoDoh DNS C2 installation
V4K11 Jun 4, 2020
ba24714
Merge remote-tracking branch 'origin/dev' into dev
V4K11 Jun 4, 2020
35f5dba
feat: localhost pfwd for dns traffic
Sikkis Jun 4, 2020
4593986
update: finalize GoDoH with new update
V4K11 Jun 4, 2020
d88af45
feat: update autossh feature to print the commands on the outputs
V4K11 Jun 4, 2020
73d0936
feat: localhost certificate creation
Sikkis Jun 4, 2020
4415cd1
fix: on letsencrypt webserver cert
Sikkis Jun 5, 2020
9dc20ed
update: print postmaster password iredmail
V4K11 Jun 5, 2020
35e8f41
Merge remote-tracking branch 'origin/dev' into dev
Sikkis Jun 5, 2020
450c389
update: change the set domain command
Sikkis Jun 9, 2020
a2171ef
fix: DigitalOcean issue with DNS records (not found)
V4K11 Jun 9, 2020
411c348
fix: problem with the AWS region when modules are deleted or edited
V4K11 Jun 10, 2020
0f0ee92
feat: Ansible TF implementation
V4K11 Jun 10, 2020
85ca74d
fix: remove Ansible from modules
V4K11 Jun 10, 2020
f75b33a
fix: install.sh file and remove prints in main
V4K11 Jun 10, 2020
cb950bd
feat: add ansible module to overlord
Sikkis Jun 11, 2020
b994e2d
fix: ansible to use Python3 instead of 2
V4K11 Jun 11, 2020
7cf8ac8
clean: remove unused TF variables
V4K11 Jun 11, 2020
7acd4d1
improve: autoload playbooks on ansible module
Sikkis Jun 11, 2020
cba658a
fix: dns_record provider module after ansible
V4K11 Jun 11, 2020
d17b261
Merge pull request #1 from qsecure-labs/dev
Sikkis Jun 12, 2020
5b50b49
upd: new terraform 0.12
V4K11 Jun 12, 2020
05246ce
update modules for tf0.12 - aws works
V4K11 Jun 15, 2020
4ea7232
delete unused module
V4K11 Jun 15, 2020
48bf23a
remove godaddy create dns record
V4K11 Jun 15, 2020
07bdd31
fix: variable needed in letsencrypt
V4K11 Jun 16, 2020
f62f759
update: merge overlord changes with new TF
Jun 16, 2020
c195ed7
update: migration
Jun 16, 2020
1cb9efa
update - integration with TF 0.12
Jun 17, 2020
8d05777
fix: aws dns record add [0]
Jun 17, 2020
108e2f4
Update README.md
V4K11 Jun 17, 2020
9d169b4
upd: clean code and webserver letsencrypt AWS
Jun 17, 2020
2765cc9
Merge remote-tracking branch 'origin/dev-new-tf' into dev-new-tf
Jun 17, 2020
1083829
update read me
Jun 17, 2020
8d3a712
fix: aws webserver letsencrypt
Jun 17, 2020
d04fc49
clean: terraform modules
Sikkis Jun 17, 2020
bb103b3
fix: DNS records MX both providers
Jun 17, 2020
0427799
fix: variables to remove warnings new TF
Jun 17, 2020
f697463
update: sshkeys + certificates path
Sikkis Jun 17, 2020
e783fa2
feat: AWS support for multiple redirectors
Jun 18, 2020
550d71f
update: install.sh to use sudo
Jun 18, 2020
7c7c8da
clean TF code
Jun 18, 2020
4cb4175
update: Redbaron AWS documentation
Jun 18, 2020
9496b47
updated: Redbaron DO documentation
Jun 18, 2020
a9be500
update: started letsencrypt documentation redbaron
Jun 18, 2020
4c2ce10
fix: godaddy plugin chmod
Jun 18, 2020
0e51429
upd: let's encrypt documentation redbaron
Jun 19, 2020
e223da3
update: Redbaron documentation
Jun 19, 2020
c17e2f4
fix: DO 404 error on create domains
Jun 19, 2020
46a2f00
Revert "fix: DO 404 error on create domains"
Jun 19, 2020
69367b1
fix: 404 DO error fix by using delay
Jun 19, 2020
7cf8342
fix: aws 404 on route 53 hosted zones
Jun 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__pycache__
redbaron/data/plugins/
291 changes: 19 additions & 272 deletions README.md

Large diffs are not rendered by default.

94 changes: 73 additions & 21 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"mod_redirector": {
"module": "redirector",
"type" : "http",
"type": "http",
"region": "LON1",
"redirector_id":"",
"redirector_id": "",
"provider": "digitalocean",
"size": "s-1vcpu-1gb",
"id": ""
},
"mod_c2": {
"module": "c2",
"type" : "http",
"type": "http",
"redirectors": 1,
"tools": [],
"region": "LON1",
"provider": "digitalocean",
"size": "s-1vcpu-1gb",
"id": ""
"id": "",
"distro": "debian"
},
"mod_dns_record": {
"module": "dns_record",
Expand All @@ -39,8 +40,8 @@
"mod_letsencrypt": {
"module": "letsencrypt",
"id": "",
"domain_name" : "",
"mod_id" : "",
"domain_name": "",
"mod_id": "",
"email": "kokos@example.com"
},
"mod_mail": {
Expand All @@ -67,27 +68,78 @@
"domain": "",
"id": ""
},
"mod_ansible": {
"module": "ansible",
"hosts": [],
"playbook": "",
"id": ""
},
"mod_firewall": {
"module": "firewall",
"provider": "digitalocean",
"protocol": "tcp",
"port": "",
"address": "0.0.0.0/0",
"rule": "inbound",
"mod_id":""
"mod_id": ""
},
"aws" :{
"regions" : ["us-east-2", "us-east-1", "us-west-1", "us-west-2", "ap-east-1", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "me-south-1", "sa-east-1", "us-gov-east-1", "us-gov-west-1"],
"size" : ["t2.nano", "t2.micro", "t2.small", "t2.medium", "t2.large", "t2.xlarge", "t2.2xlarge", "a1.medium", "a1.large", "a1.xlarge", "a1.2xlarge", "a1.4xlarge", "t3.nano", "t3.micro", "t3.small", "t3.medium", "t3.large", "t3.xlarge", "t3.2xlarge", "t3a.nano", "t3a.micro", "t3a.small", "t3a.medium", "t3a.large", "t3a.xlarge", "t3a.2xlarge"],
"aws": {
"regions": ["us-east-2", "us-east-1", "us-west-1", "us-west-2", "ap-east-1", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "me-south-1", "sa-east-1", "us-gov-east-1", "us-gov-west-1"],
"size": ["t2.nano", "t2.micro", "t2.small", "t2.medium", "t2.large", "t2.xlarge", "t2.2xlarge", "a1.medium", "a1.large", "a1.xlarge", "a1.2xlarge", "a1.4xlarge", "t3.nano", "t3.micro", "t3.small", "t3.medium", "t3.large", "t3.xlarge", "t3.2xlarge", "t3a.nano", "t3a.micro", "t3a.small", "t3a.medium", "t3a.large", "t3a.xlarge", "t3a.2xlarge"],
"default_region": "eu-west-1",
"default_size": "t2.micro"
},
"digitalocean" :{
"regions" : ["NYC1","NYC2","NYC2", "SFO1", "SFO2", "AMS2", "AMS1", "LON1","FRA1","TOR1","BLR1"],
"size" : ["s-1vcpu-1gb"],
"default_region" : "LON1",
"default_size" : "s-1vcpu-1gb"
},
"providers_list" : ["digitalocean","aws"]
}

"default_size": "t2.micro",
"supported_distros": ["debian","kali","ubuntu"],
"amis": {
"ap-northeast-1-debian": "ami-b6b568d0",
"ap-northeast-2-debian": "ami-b7479dd9",
"ap-south-1-debian": "ami-02aded6d",
"ap-southeast-1-debian": "ami-d76019b4",
"ap-southeast-2-debian": "ami-8359bae1",
"ca-central-1-debian": "ami-3709b053",
"eu-central-1-debian": "ami-8bb70be4",
"eu-west-1-debian": "ami-ce76a7b7",
"eu-west-2-debian": "ami-a6f9ebc2",
"sa-east-1-debian": "ami-f5c7b899",
"us-east-1-debian": "ami-71b7750b",
"us-east-2-debian": "ami-dab895bf",
"us-west-1-debian": "ami-58eedd38",
"us-west-2-debian": "ami-c032f6b8",
"ap-northeast-1-kali": "ami-0d701fcae946c61ed",
"ap-northeast-2-kali": "ami-0fbd27bb0a724c459",
"ap-south-1-kali": "ami-055e6bebd7c5e24c2",
"ap-southeast-1-kali": "ami-01027fa676ff2da3d",
"ap-southeast-2-kali": "ami-02811a36e6f758099",
"ca-central-1-kali": "ami-0f394074fe16decd6",
"eu-central-1-kali": "ami-0b61a044e0ae0d17d",
"eu-west-1-kali": "ami-0ac0bf7b0683eb820",
"eu-west-2-kali": "ami-071d0c011e7ab12f5",
"sa-east-1-kali": "ami-00c9b2d0ec9e3835c",
"us-east-1-kali": "ami-0c11557d0e4e9c896",
"us-east-2-kali": "ami-00f7390b60c41a3c0",
"us-west-1-kali": "ami-09aa8451f267643a9",
"us-west-2-kali": "ami-0a967289406d51ad4",
"ap-northeast-1-ubuntu": "ami-0f29c17df60493658",
"ap-northeast-2-ubuntu": "ami-065a2f32a35b7c52f",
"ap-south-1-ubuntu": "ami-05a3a2a452701c0ff",
"ap-southeast-1-ubuntu": "ami-05405da5795c2f2e7",
"ap-southeast-2-ubuntu": "ami-0243fb2a9c789bb43",
"ca-central-1-ubuntu": "ami-07d2c94058f3ca045",
"eu-central-1-ubuntu": "ami-07d14b5d47292e022",
"eu-west-1-ubuntu": "ami-014aff0119d738e34",
"eu-west-2-ubuntu": "ami-0339455b66e82a8ca",
"sa-east-1-ubuntu": "ami-0a32099c90454cc7a",
"us-east-1-ubuntu": "ami-07d1c0a30a7814597",
"us-east-2-ubuntu": "ami-083af2bfea9e15579",
"us-west-1-ubuntu": "ami-0b3f68410f4d4fed6",
"us-west-2-ubuntu": "ami-0652b0a864db01553"}
},
"digitalocean": {
"regions": ["NYC1", "NYC2", "NYC2", "SFO1", "SFO2", "AMS2", "AMS1", "LON1", "FRA1", "TOR1", "BLR1"],
"size": ["s-1vcpu-1gb"],
"default_region": "LON1",
"default_size": "s-1vcpu-1gb",
"supported_distros": ["debian","ubuntu"]
},
"providers_list": ["digitalocean", "aws"],
"distros": ["debian","kali","ubuntu"]
}
27 changes: 17 additions & 10 deletions config/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
#!/bin/bash

apt install python3
apt install python3-pip
# install all the packages required
sudo apt install python3
sudo apt install python3-pip
sudo apt install wget
sudo apt install unzip
sudo apt install curl
sudo apt install autossh

# install the python requirements from the txt
pip3 install -r requirements.txt

pip install ansible
wget https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_linux_amd64.zip
unzip terraform_0.11.14_linux_amd64.zip
mv terraform /opt/terraform
rm terraform_0.11.14_linux_amd64.zip
echo 'export PATH="$PATH:/opt"' >> ~/.profile
# download terraform binary
wget https://releases.hashicorp.com/terraform/0.12.26/terraform_0.12.26_linux_amd64.zip
unzip terraform_0.12.26_linux_amd64.zip
sudo mv terraform /opt/terraform
rm terraform_0.12.26_linux_amd64.zip

wget https://github.com/n3integration/terraform-godaddy/releases/download/v1.6.4/terraform-godaddy_linux_amd64.tgz
# download godaddy plugin for terraform
wget https://github.com/n3integration/terraform-godaddy/releases/download/v1.7.3/terraform-godaddy_linux_amd64.tgz
tar -xvzf terraform-godaddy_linux_amd64.tgz
rm terraform-godaddy_linux_amd64.tgz
mv terraform-godaddy_linux_amd64 ../redbaron/data/plugins/terraform-provider-godaddy_v1.6.4_x4
sudo mv terraform-godaddy_linux_amd64 ../redbaron/data/plugins/terraform-provider-godaddy_v1.7.3_x4
3 changes: 2 additions & 1 deletion config/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cmd2
prettytable
PTable
PTable
ansible
182 changes: 182 additions & 0 deletions modules/ansible.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
import cmd2
import os
import argparse
from prettytable import PrettyTable
from prettytable import MSWORD_FRIENDLY
import random
import string
import json

module = {}
campaign_list = []

class main(list):
"""Main function to initialize variables and calls the cmd2 package for the godaddy module """
def __init__(self,campaign,mod,project_id):
global campaign_list
campaign_list = campaign

if mod is not None:
global module
module = mod

# Call cmd_main class
i = cmd_main()
i.prompt = "(" + cmd2.ansi.style("Overlord", fg='red', bg='',bold=True, underline=False) + " : " + cmd2.ansi.style( project_id, fg='bright_black', bg='',bold=True, underline=False) + cmd2.ansi.style("/ansible", fg='blue', bg='',bold=True, underline=False) +")" +"$> "
i.cmdloop()

def hide_cmd2_modules(self):
# Remove most of the functionalities of the cmd2 package
self.hidden_commands.append('py')
self.hidden_commands.append('alias')
self.hidden_commands.append('macro')
self.hidden_commands.append('script')
self.hidden_commands.append('shortcuts')
self.hidden_commands.append('pyscript')
self.hidden_commands.append('run_pyscript')
self.hidden_commands.append('edit')
self.hidden_commands.append('run_script')
self.hidden_commands.append('quit')
self.hidden_commands.append('load')

class cmd_main(cmd2.Cmd):
"""cmd2 instance for firewall module"""
# The mod dictionary for the firewall module
mod = {}
playbooks_list = []
providers_list = []

def __init__(self):
super().__init__()
global module
global campaign_list
# Hide the Quit funcitionality
hide_cmd2_modules(self)

dir_path = "config"
if os.path.exists(dir_path+"/config.json"):
with open(dir_path+'/config.json', 'r') as filehandle:
config = json.load(filehandle)
self.mod = config["mod_ansible"]
else:
print("The config/config.json file does not exists! Exiting...")
return True

# Check if the editmodule functionality was used
if module:
self.mod = dict(module)
else:
self.mod["id"] = randomString()

# Create list with modules id
modules_ids=[]
for c in campaign_list:
if c["module"] != "dns_record" and c["module"] != "letsencrypt" and c["module"] != "godaddy" and c["module"] != "ansible":
modules_ids.insert(len(modules_ids),(c["id"]+"/"+c["module"]))
if c["module"] != "redirector":
for i in range(c["redirectors"]):
modules_ids.insert(len(modules_ids),(c["id"]+"-"+str(i+1)+"/"+c["module"]))
modules_ids.insert(len(modules_ids),"all")
self.module_hosts_parser.choices = modules_ids

# Load the playbooks
dir_path = "redbaron/data/playbooks"
for pb in os.listdir(dir_path):
self.playbooks_list.append(pb)

def do_back(self, arg):
"""Return to main menu"""
return True

def do_clear(self, arg):
"""Clears screen"""
os.system('clear')

def do_info(self,mod):
"""Prints variable table"""
if mod:
x = PrettyTable()
x.title = mod["module"] + "/"+ mod["id"]
x.field_names = ["VARIABLE", "VALUE", "REQUIRED", "DESCRITPION"]
x.add_row(["id", mod["id"], "N/A", "Module ID"])
x.add_row(["hosts", mod["hosts"], "yes", "Module to be used"])
x.add_row(["playbook", mod["playbook"], "yes", "Playbook to be used"])
x.align["DESCRITPION"] = "l"
else:
x = PrettyTable()
x.title = 'Ansible module'
x.field_names = ["VARIABLE", "VALUE", "REQUIRED", "DESCRITPION"]
x.add_row(["id", self.mod["id"], "N/A", "Module ID"])
x.add_row(["hosts", self.mod["hosts"], "yes", "Module to be used"])
x.add_row(["playbook", self.mod["playbook"], "yes", "Playbook to be used"])
x.align["DESCRITPION"] = "l"
print(x)

# set command
# create the top-level parser for the set command
set_parser = argparse.ArgumentParser(prog='set')
set_subparsers = set_parser.add_subparsers(title='set-commands', help='Sets the variables of the module')

# create the parser for the "hosts" sub-command
parser_hosts = set_subparsers.add_parser('hosts', help='hosts to be used')
module_hosts_parser = parser_hosts.add_argument('hosts',nargs="+", type=str, help='example : [set hosts <id> ]')

parser_playbook = set_subparsers.add_parser('playbook', help='playbook to be used')
parser_playbook.add_argument('playbook', type=str,choices=playbooks_list, help='example : [set playbook <playbook name> ]')

def set_mod(self, arg):
"""Sets the hosts variable"""
if 'all' in arg.hosts:
for c in campaign_list:
if c["module"] != "dns_record" and c["module"] != "letsencrypt" and c["module"] != "godaddy" and c["module"] != "ansible":
self.mod["hosts"].insert(len(self.mod["hosts"]),(c["id"]+"/"+c["module"]))
for i in range(c["redirectors"]):
self.mod["hosts"].insert(len(self.mod["hosts"]),(c["id"]+"-"+str(i+1)+"/"+c["module"]))
else:
self.mod["hosts"]= arg.hosts

def set_playbook(self, arg):
"""Sets the =playbook variable"""
self.mod["playbook"]= arg.playbook

#Set handler functions for the sub-commands
parser_hosts.set_defaults(func=set_mod)
parser_playbook.set_defaults(func=set_playbook)

@cmd2.with_argparser(set_parser)
def do_set(self, args):
"""Set the variables for the module"""
func = getattr(args, 'func', None)
if func is not None:
# Call whatever sub-command function was selected
func(self, args)
else:
# No sub-command was provided, so call help
self.do_help('help')

def do_add(self,args):
"""Adds c2 module to the project """
global module
module = self.mod
if self.mod["hosts"]:
module = self.mod
return True
else:
print("The hosts can not be None!")
if self.mod["playbook"]:
module = self.mod
return True
else:
print("The playbook can not be None!")

# Command categories
CMD_CAT_GENERAL = 'General (type help <command>)'
CMD_CAT_MODULE = 'Module (type help <command>)'

cmd2.categorize((do_add,do_set), CMD_CAT_MODULE)
cmd2.categorize(do_info, CMD_CAT_GENERAL)

def randomString(stringLength=6):
"""Generate a random string of fixed length """
letters = string.ascii_uppercase
return ''.join(random.choice(letters) for i in range(stringLength))
Loading