Skip to content

Commit

Permalink
Fix EOFError in sam plugin on empty lm/nt hash
Browse files Browse the repository at this point in the history
  • Loading branch information
JazzCore committed Dec 9, 2023
1 parent 8bb86ca commit 9f33dd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dissect/target/plugins/os/windows/sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ def sam(self) -> Iterator[SamRecord]:
u_lmpw = v_data[v.lmpw_ofs : v.lmpw_ofs + v.lmpw_len]
u_ntpw = v_data[v.ntpw_ofs : v.ntpw_ofs + v.ntpw_len]

lm_hash = decrypt_single_hash(f.rid, samkey, u_lmpw, almpassword).hex()
nt_hash = decrypt_single_hash(f.rid, samkey, u_ntpw, antpassword).hex()
lm_hash = decrypt_single_hash(f.rid, samkey, u_lmpw, almpassword).hex() if u_lmpw else ''
nt_hash = decrypt_single_hash(f.rid, samkey, u_ntpw, antpassword).hex() if u_ntpw else ''

yield SamRecord(
rid=f.rid,
Expand Down

0 comments on commit 9f33dd4

Please sign in to comment.