1 | 1 |
Date: Fri, 27 Dec 2019 09:25:49 +0100
|
2 | 2 |
Subject: change-database-location
|
3 | 3 |
|
|
4 |
Last-Update: 2020-06-10
|
4 | 5 |
---
|
5 | 6 |
empire | 18 +++++++++++++++++-
|
6 | 7 |
lib/common/__init__.py | 4 +++-
|
|
12 | 13 |
7 files changed, 47 insertions(+), 27 deletions(-)
|
13 | 14 |
|
14 | 15 |
diff --git a/empire b/empire
|
15 | |
index 3fc5175..584669b 100755
|
|
16 |
index 4132fc0..b20fbe4 100755
|
16 | 17 |
--- a/empire
|
17 | 18 |
+++ b/empire
|
18 | |
@@ -9,6 +9,22 @@ import hashlib
|
|
19 |
@@ -12,6 +12,22 @@ import hashlib
|
19 | 20 |
from OpenSSL import SSL
|
20 | 21 |
import ssl
|
21 | 22 |
import ast
|
|
38 | 39 |
|
39 | 40 |
# Empire imports
|
40 | 41 |
from lib.common import empire, helpers, users
|
41 | |
@@ -45,7 +61,7 @@ def database_connect():
|
42 | |
"""
|
43 | |
try:
|
|
42 |
@@ -76,7 +92,7 @@ def database_connect():
|
|
43 |
sqlite3.register_adapter(datetime, adapt_datetime)
|
|
44 |
sqlite3.register_converter("timestamp", convert_timestamp)
|
44 | 45 |
# set the database connectiont to autocommit w/ isolation level
|
45 | |
- conn = sqlite3.connect('./data/empire.db', check_same_thread=False)
|
46 | |
+ conn = sqlite3.connect(os.path.join(DB_PATH, 'empire.db'), check_same_thread=False)
|
|
46 |
- conn = sqlite3.connect('./data/empire.db', check_same_thread=False, detect_types=sqlite3.PARSE_DECLTYPES)
|
|
47 |
+ conn = sqlite3.connect(os.path.join(DB_PATH, 'empire.db'), check_same_thread=False, detect_types=sqlite3.PARSE_DECLTYPES)
|
47 | 48 |
conn.text_factory = str
|
48 | 49 |
conn.isolation_level = None
|
49 | 50 |
return conn
|
|
70 | 71 |
conn.isolation_level = None
|
71 | 72 |
return conn
|
72 | 73 |
diff --git a/lib/common/agents.py b/lib/common/agents.py
|
73 | |
index a104962..6e21b67 100644
|
|
74 |
index 700cfe9..9b29bb1 100644
|
74 | 75 |
--- a/lib/common/agents.py
|
75 | 76 |
+++ b/lib/common/agents.py
|
76 | 77 |
@@ -87,6 +87,7 @@ class Agents(object):
|
|
144 | 145 |
f.write(task)
|
145 | 146 |
f.close()
|
146 | 147 |
return pk
|
147 | |
@@ -1952,8 +1953,8 @@ class Agents(object):
|
|
148 |
@@ -1951,8 +1952,8 @@ class Agents(object):
|
148 | 149 |
elif responseName == "TASK_CMD_JOB":
|
149 | 150 |
#check if this is the powershell keylogging task, if so, write output to file instead of screen
|
150 | 151 |
if keyLogTaskID and keyLogTaskID == taskID:
|
|
156 | 157 |
message = "[!] WARNING: agent {} attempted skywalker exploit!".format(self.sessionID)
|
157 | 158 |
signal = json.dumps({
|
158 | 159 |
diff --git a/lib/common/empire.py b/lib/common/empire.py
|
159 | |
index d41e7e5..1aeb5d9 100644
|
|
160 |
index a7794a7..caef7e3 100755
|
160 | 161 |
--- a/lib/common/empire.py
|
161 | 162 |
+++ b/lib/common/empire.py
|
162 | |
@@ -182,7 +182,7 @@ class MainMenu(cmd.Cmd):
|
|
163 |
@@ -187,7 +187,7 @@ class MainMenu(cmd.Cmd):
|
163 | 164 |
|
164 | 165 |
# if --debug X is passed, log out all dispatcher signals
|
165 | 166 |
if self.args.debug:
|
|
168 | 169 |
debug_file.write("%s %s : %s\n" % (helpers.get_datetime(), sender, signal))
|
169 | 170 |
|
170 | 171 |
if self.args.debug == '2':
|
171 | |
@@ -316,7 +316,8 @@ class MainMenu(cmd.Cmd):
|
|
172 |
@@ -321,7 +321,8 @@ class MainMenu(cmd.Cmd):
|
172 | 173 |
"""
|
173 | 174 |
try:
|
174 | 175 |
# set the database connectiont to autocommit w/ isolation level
|
|
179 | 180 |
self.conn.isolation_level = None
|
180 | 181 |
return self.conn
|
181 | 182 |
diff --git a/lib/common/helpers.py b/lib/common/helpers.py
|
182 | |
index 6942283..9dc8058 100644
|
|
183 |
index 18ece4e..b227baa 100644
|
183 | 184 |
--- a/lib/common/helpers.py
|
184 | 185 |
+++ b/lib/common/helpers.py
|
185 | 186 |
@@ -594,7 +594,7 @@ def get_config(fields):
|
|
248 | 249 |
+ rm -rf ~/.local/powershell-empire/downloads/
|
249 | 250 |
fi
|
250 | 251 |
diff --git a/setup/setup_database.py b/setup/setup_database.py
|
251 | |
index 9453037..d8f62a4 100755
|
|
252 |
index 76091ca..44971b7 100755
|
252 | 253 |
--- a/setup/setup_database.py
|
253 | 254 |
+++ b/setup/setup_database.py
|
254 | 255 |
@@ -60,7 +60,7 @@ OBFUSCATE_COMMAND = r'Token\All\1'
|