Skip to content

Commit 9e16436

Browse files
authored
Merge pull request Pennyw0rth#541 from termanix/update-exe-nxc-data
Updated exe files while putting for evasion
2 parents 3f06ea9 + 97fb011 commit 9e16436

5 files changed

Lines changed: 21 additions & 3 deletions

File tree

nxc/modules/handlekatz.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import base64
66
import re
77
import sys
8-
8+
from datetime import datetime
99
from nxc.helpers.bloodhound import add_user_bh
1010
from pypykatz.pypykatz import pypykatz
1111

@@ -34,6 +34,8 @@ def options(self, context, module_options):
3434
self.handlekatz_path = "/tmp/"
3535
self.dir_result = self.handlekatz_path
3636
self.useembeded = True
37+
# Add some random binary data to defeat AVs which check the file hash
38+
self.handlekatz_embeded += datetime.now().strftime("%Y%m%d%H%M%S").encode()
3739

3840
if "HANDLEKATZ_PATH" in module_options:
3941
self.handlekatz_path = module_options["HANDLEKATZ_PATH"]

nxc/modules/impersonate.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from base64 import b64decode
77
from os import path
88
import sys
9-
9+
from datetime import datetime
1010
from nxc.paths import DATA_PATH
1111

1212

@@ -29,8 +29,13 @@ def options(self, context, module_options):
2929
self.impersonate = "Impersonate.exe"
3030
self.useembeded = True
3131
self.token = self.cmd = ""
32+
3233
with open(path.join(DATA_PATH, ("impersonate_module/impersonate.bs64"))) as impersonate_file:
3334
self.impersonate_embedded = b64decode(impersonate_file.read())
35+
36+
# Add some random binary data to defeat AVs which check the file hash
37+
self.impersonate_embedded += datetime.now().strftime("%Y%m%d%H%M%S").encode()
38+
3439
if "EXEC" in module_options:
3540
self.cmd = module_options["EXEC"]
3641

nxc/modules/nanodump.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def options(self, context, module_options):
5151
self.nano = "nano.exe"
5252
self.nano_path = ""
5353
self.useembeded = True
54+
# Add some random binary data to defeat AVs which check the file hash
55+
padding = datetime.now().strftime("%Y%m%d%H%M%S").encode()
56+
self.nano_embedded64 += padding
57+
self.nano_embedded32 += padding
5458

5559
if "NANO_PATH" in module_options:
5660
self.nano_path = module_options["NANO_PATH"]

nxc/modules/pi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from base64 import b64decode
22
from sys import exit
33
from os.path import abspath, join, isfile
4-
4+
from datetime import datetime
55
from nxc.paths import DATA_PATH, TMP_PATH
66

77

@@ -25,9 +25,13 @@ def options(self, context, module_options):
2525
self.pi = "pi.exe"
2626
self.useembeded = True
2727
self.pid = self.cmd = ""
28+
2829
with open(join(DATA_PATH, ("pi_module/pi.bs64"))) as pi_file:
2930
self.pi_embedded = b64decode(pi_file.read())
3031

32+
# Add some random binary data to defeat AVs which check the file hash
33+
self.pi_embedded += datetime.now().strftime("%Y%m%d%H%M%S").encode()
34+
3135
if "EXEC" in module_options:
3236
self.cmd = module_options["EXEC"]
3337

nxc/modules/procdump.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from nxc.helpers.bloodhound import add_user_bh
99
from nxc.paths import TMP_PATH
1010
from os.path import abspath, join
11+
from datetime import datetime
1112

1213

1314
class NXCModule:
@@ -34,6 +35,8 @@ def options(self, context, module_options):
3435
self.procdump_path = abspath(TMP_PATH)
3536
self.dir_result = self.procdump_path
3637
self.useembeded = True
38+
# Add some random binary data to defeat AVs which check the file hash
39+
self.procdump_embeded += datetime.now().strftime("%Y%m%d%H%M%S").encode()
3740

3841
if "PROCDUMP_PATH" in module_options:
3942
self.procdump_path = module_options["PROCDUMP_PATH"]

0 commit comments

Comments
 (0)