Skip to content

Commit 6cfb52c

Browse files
committed
Just directly use arg and formatting
1 parent 931f281 commit 6cfb52c

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

nxc/protocols/smb.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,21 +1990,20 @@ def add_sam_hash(sam_hash, host_id):
19901990
add_sam_hash.sam_hashes = 0
19911991

19921992
if self.remote_ops and self.bootkey:
1993-
history = getattr(self.args, "history", False)
19941993
if self.args.sam == "regdump":
19951994
SAM = RegSecretsSAMHashes(
19961995
self.bootkey,
19971996
remoteOps=self.remote_ops,
19981997
perSecretCallback=lambda secret: add_sam_hash(secret, host_id),
1999-
history=history,
1998+
history=self.args.history,
20001999
)
20012000
else:
20022001
SAM_file_name = self.remote_ops.saveSAM()
20032002
SAM = SAMHashes(
20042003
SAM_file_name,
20052004
self.bootkey,
20062005
isRemote=True,
2007-
history=history,
2006+
history=self.args.history,
20082007
perSecretCallback=lambda secret: add_sam_hash(secret, host_id),
20092008
)
20102009

nxc/protocols/smb/proto_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ def proto_args(parser, parents):
3434
cred_gathering_group.add_argument("--sam", choices={"regdump", "secdump"}, nargs="?", const="regdump", help="dump SAM hashes from target systems")
3535
cred_gathering_group.add_argument("--lsa", choices={"regdump", "secdump"}, nargs="?", const="regdump", help="dump LSA secrets from target systems")
3636
ntds_arg = cred_gathering_group.add_argument("--ntds", choices={"vss", "drsuapi"}, nargs="?", const="drsuapi", help="dump the NTDS.dit from target DCs using the specifed method")
37+
cred_gathering_group.add_argument("--history", action="store_true", help="Also retrieve password history (NTDS.dit or SAM)")
3738
# NTDS options
3839
kerb_keys_arg = cred_gathering_group.add_argument("--kerberos-keys", action=get_conditional_action(_StoreTrueAction), make_required=[], help="Also dump Kerberos AES and DES keys from target DC (NTDS.dit)")
3940
exclusive = cred_gathering_group.add_mutually_exclusive_group()
40-
cred_gathering_group.add_argument("--history", action=get_conditional_action(_StoreTrueAction), make_required=[], help="Also retrieve password history (NTDS.dit or SAM)")
4141
enabled_arg = exclusive.add_argument("--enabled", action=get_conditional_action(_StoreTrueAction), make_required=[], help="Only dump enabled targets from DC (NTDS.dit)")
4242
kerb_keys_arg.make_required = [ntds_arg]
4343
enabled_arg.make_required = [ntds_arg]

0 commit comments

Comments
 (0)