Skip to content

Commit

Permalink
Merge pull request #575 from Mercury0/powershell_history_fix
Browse files Browse the repository at this point in the history
Refactored powershell_history module to fix case sensitivity
  • Loading branch information
NeffIsBack authored Feb 26, 2025
2 parents a53a1ce + 6120249 commit c97e562
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nxc/modules/powershell_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def on_admin_login(self, context, connection):
buf = BytesIO()
connection.conn.getFile("C$", file_path, buf.write)
buf.seek(0)
file_content = buf.read().decode("utf-8", errors="ignore").lower()
keywords = [keyword.upper() for keyword in self.sensitive_keywords if keyword in file_content]
file_content = buf.read().decode("utf-8", errors="ignore")
keywords = [keyword.upper() for keyword in self.sensitive_keywords if keyword.lower() in file_content.lower()]
if len(keywords):
context.log.highlight(f"C:\\{file_path} [ {' '.join(keywords)} ]")
else:
Expand Down

0 comments on commit c97e562

Please sign in to comment.