Skip to content

Commit bd7202d

Browse files
committed
Fix test suite
1 parent 63a78cb commit bd7202d

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

netexec.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ a = Analysis(
6767
'dploot.triage.browser',
6868
'dploot.triage.credentials',
6969
'dploot.triage.masterkeys',
70+
'dploot.triage.mobaxterm',
7071
'dploot.triage.backupkey',
7172
'dploot.triage.wifi',
7273
'dploot.triage.sccm',

tests/e2e_commands.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS -M spooler
135135
netexec smb TARGET_HOST -u '' -p '' -M zerologon
136136
netexec smb TARGET_HOST -u '' -p '' -M petitpotam
137137
##### SMB Auth File
138-
netexec smb TARGET_HOST -u TEST_USER_FILE -p TEST_PASSWORD_FILE--no-bruteforce
139-
netexec smb TARGET_HOST -u TEST_USER_FILE -p TEST_PASSWORD_FILE--no-bruteforce --continue-on-success
138+
netexec smb TARGET_HOST -u TEST_USER_FILE -p TEST_PASSWORD_FILE --no-bruteforce
139+
netexec smb TARGET_HOST -u TEST_USER_FILE -p TEST_PASSWORD_FILE --no-bruteforce --continue-on-success
140140
netexec smb TARGET_HOST -u TEST_USER_FILE -p tests/data/test_passwords.txt
141141
##### WMI
142142
netexec wmi TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS # need an extra space after this command due to regex

tests/e2e_tests.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,25 @@ def get_cli_args():
8484
parser.add_argument(
8585
"--test-user-file",
8686
required=False,
87-
default=f"{script_dir}/data/test_users.txt",
87+
default=abspath(f"{script_dir}/data/test_users.txt"),
8888
help="Path to the file containing test usernames",
8989
)
9090
parser.add_argument(
9191
"--test-password-file",
9292
required=False,
93-
default=f"{script_dir}/data/test_passwords.txt",
93+
default=abspath(f"{script_dir}/data/test_passwords.txt"),
9494
help="Path to the file containing test passwords",
9595
)
9696
parser.add_argument(
9797
"--amsi-bypass-file",
9898
required=False,
99-
default=f"{script_dir}/data/test_amsi_bypass.txt",
99+
default=abspath(f"{script_dir}/data/test_amsi_bypass.txt"),
100100
help="Path to the file containing AMSI bypasses",
101101
)
102102
parser.add_argument(
103103
"--test-normal-file",
104104
required=False,
105-
default=f"{script_dir}/data/test_file.txt",
105+
default=abspath(f"{script_dir}/data/test_file.txt"),
106106
help="Path to file to upload/download"
107107
)
108108
parser.add_argument(
@@ -137,6 +137,8 @@ def generate_commands(args):
137137
if i + 1 in flattened_list:
138138
if line.startswith("#"):
139139
continue
140+
if "#" in line:
141+
line = line.split("#")[0]
140142
line = line.strip()
141143
if args.protocols:
142144
if line.split()[1] in args.protocols:
@@ -147,6 +149,8 @@ def generate_commands(args):
147149
for line in file:
148150
if line.startswith("#"):
149151
continue
152+
if "#" in line:
153+
line = line.split("#")[0]
150154
line = line.strip()
151155
if args.protocols:
152156
if line.split()[1] in args.protocols:

0 commit comments

Comments
 (0)