Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
NeffIsBack committed Feb 26, 2025
1 parent b14830f commit 6120249
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions nxc/modules/powershell_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ def on_admin_login(self, context, connection):
connection.conn.getFile("C$", file_path, buf.write)
buf.seek(0)
file_content = buf.read().decode("utf-8", errors="ignore")
# Use temporary lowercase version for searching
file_content_lower = file_content.lower()
keywords = [keyword.upper() for keyword in self.sensitive_keywords if keyword.lower() in file_content_lower]
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 6120249

Please sign in to comment.