Skip to content

Commit

Permalink
Added malleable profiles repo (#24)
Browse files Browse the repository at this point in the history
* added malleable profile repo to empire

* updated changelog

* fixed preobfuscate
  • Loading branch information
Cx01N authored Jan 14, 2021
1 parent 65a4141 commit 738a3c7
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 31 deletions.
6 changes: 5 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "data/profiles"]
path = data/profiles
url = https://github.com/BC-SECURITY/Malleable-C2-Profiles

[submodule "cli"]
path = cli
url = https://github.com/BC-SECURITY/Empire-Cli
url = https://github.com/BC-SECURITY/Empire-Cli
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To install and run:
```sh
git clone --recursive https://github.com/BC-SECURITY/Empire.git
cd Empire
sudo ./install.sh
sudo ./setup/install.sh
sudo poetry install
sudo poetry run python empire
```
Expand Down
1 change: 1 addition & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Version 3.7.0 Master Release
- Revamped backend database from SQL to SQLAlchemy (@Cx01N, @Vinnybod)
- Added new Empire CLI to packaging (@Vinnybod)
- Added malleable C2 profiles to empire directory: /data/profiles (@Cx01N)
- Added --teamserver option to launcher (@Cx01N)
- Added support for logging into Empire from multiple locations (@Vinnybod)
- Added Invoke-WireTap (@Cx01N)
Expand Down
1 change: 1 addition & 0 deletions data/profiles
Submodule profiles added at 7b97eb
5 changes: 0 additions & 5 deletions data/profiles/comfoo.txt

This file was deleted.

5 changes: 0 additions & 5 deletions data/profiles/fiesta.txt

This file was deleted.

5 changes: 0 additions & 5 deletions data/profiles/pitty_tiger.txt

This file was deleted.

5 changes: 0 additions & 5 deletions data/profiles/zeus.txt

This file was deleted.

8 changes: 4 additions & 4 deletions lib/common/empire.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ def do_preobfuscate(self, line):

# Preobfuscate a selected module_source file
else:
module_source_fullpath = self.installPath + 'data/module_source/' + module
module_source_fullpath = self.installPath + '/data/module_source/' + module
if not os.path.isfile(module_source_fullpath):
print(helpers.color("[!] The module_source file:" + module_source_fullpath + " does not exist."))
return
Expand All @@ -978,9 +978,9 @@ def do_preobfuscate(self, line):
if obfuscate_all:
files = [file for file in helpers.get_module_source_files()]
else:
files = ['data/module_source/' + module]
files = ['/data/module_source/' + module]
for file in files:
file = self.installPath + file
file = self.installPath + '/' + file
if reobfuscate or not helpers.is_obfuscated(file):
message = "[*] Obfuscating {}...".format(os.path.basename(file))
signal = json.dumps({
Expand Down Expand Up @@ -1216,7 +1216,7 @@ def complete_list(self, text, line, begidx, endidx):

def complete_preobfuscate(self, text, line, begidx, endidx):
"Tab-complete an interact command"
options = [(option[len('data/module_source/'):]) for option in helpers.get_module_source_files()]
options = [(option[len('/data/module_source/'):]) for option in helpers.get_module_source_files()]
options.append('all')

mline = line.partition(' ')[2]
Expand Down
4 changes: 2 additions & 2 deletions lib/common/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ def obfuscate(installPath, psScript, obfuscationCommand):
print(color("[!] PowerShell is not installed and is required to use obfuscation, please install it first."))
return ""
# When obfuscating large scripts, command line length is too long. Need to save to temp file
toObfuscateFilename = installPath + "data/misc/ToObfuscate.ps1"
obfuscatedFilename = installPath + "data/misc/Obfuscated.ps1"
toObfuscateFilename = installPath + "/data/misc/ToObfuscate.ps1"
obfuscatedFilename = installPath + "/data/misc/Obfuscated.ps1"
toObfuscateFile = open(toObfuscateFilename, 'w')
toObfuscateFile.write(psScript)
toObfuscateFile.close()
Expand Down
2 changes: 1 addition & 1 deletion lib/database/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
choice = input("\n [>] Would you like to reset your Empire instance? [y/N]: ")
if choice.lower() == "y":
Base.metadata.drop_all(engine)
subprocess.call("./reset.sh")
subprocess.call("./setup/reset.sh")
else:
pass

Expand Down
4 changes: 2 additions & 2 deletions install.sh → setup/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ sudo pip3 install -r "$Pip_file"
# Generate a cert
./cert.sh

cd ..

# Set up the database schema
python3 ./setup_database.py

cd ..

echo -e '\n [*] Setup complete!\n'
7 changes: 7 additions & 0 deletions reset.sh → setup/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ fi

IFS='/' read -a array <<< pwd

if [[ "$(pwd)" != *setup ]]
then
cd ./setup
fi

cd ..

# remove the debug file if it exists
if [ -e empire.debug ]
then
Expand Down
File renamed without changes.

0 comments on commit 738a3c7

Please sign in to comment.