Skip to content

Commit

Permalink
Change decoding option name
Browse files Browse the repository at this point in the history
  • Loading branch information
NeffIsBack committed Sep 21, 2023
1 parent 7de9fcc commit 09c869d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nxc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def gen_cli_args():
default=[],
help="password(s) or file(s) containing passwords",
)
std_parser.add_argument("--ignore-decoding-errors", action="store_true", help="Ignore non UTF-8 characters when decoding the password file")
std_parser.add_argument("--ignore-pw-decoding", action="store_true", help="Ignore non UTF-8 characters when decoding the password file")
std_parser.add_argument("-k", "--kerberos", action="store_true", help="Use Kerberos authentication")
std_parser.add_argument("--no-bruteforce", action="store_true", help="No spray when using file for username and password (user1 => password1, user2 => password2")
std_parser.add_argument("--continue-on-success", action="store_true", help="continues authentication attempts even after successes")
Expand Down
4 changes: 2 additions & 2 deletions nxc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,13 @@ def parse_credentials(self):
for password in self.args.password:
if isfile(password):
try:
with open(password, 'r', errors = ('ignore' if self.args.ignore_decoding_errors else 'strict')) as password_file:
with open(password, 'r', errors = ('ignore' if self.args.ignore_pw_decoding else 'strict')) as password_file:
for line in password_file:
secret.append(line.strip())
cred_type.append('plaintext')
except UnicodeDecodeError as e:
self.logger.error(f"{type(e).__name__}: Could not decode password file. Make sure the file only contains UTF-8 characters.")
self.logger.error("You can ignore non UTF-8 characters with the option '--ignore-decoding-errors'")
self.logger.error("You can ignore non UTF-8 characters with the option '--ignore-pw-decoding'")
exit(1)

else:
Expand Down

0 comments on commit 09c869d

Please sign in to comment.