diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f747ec587d..4661533cc0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,12 +4,14 @@ name: Lint Python code with ruff on: push: workflow_dispatch: + pull_request_review: + types: [submitted] jobs: lint: runs-on: ubuntu-latest if: - github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + github.event_name == 'push' || github.event.review.state == 'APPROVED' || github.event_name == 'workflow_dispatch' steps: - uses: actions/checkout@v4 diff --git a/nxc/modules/recent_files.py b/nxc/modules/recent_files.py index 0a1059e069..d7a7771842 100644 --- a/nxc/modules/recent_files.py +++ b/nxc/modules/recent_files.py @@ -18,7 +18,7 @@ def options(self, context, module_options): def on_admin_login(self, context, connection): lnks = [] - for directory in connection.conn.listPath("C$", "Users\\*"): + for directory in connection.conn.listPath("C$", "Users\\*"): if directory.get_longname() not in self.false_positive and directory.is_directory(): context.log.highlight(f"C:\\{directory.get_longname()}") recent_files_dir = f"Users\\{directory.get_longname()}\\AppData\\Roaming\\Microsoft\\Windows\\Recent\\" diff --git a/nxc/protocols/smb.py b/nxc/protocols/smb.py index dcbd77a301..4d107e3174 100755 --- a/nxc/protocols/smb.py +++ b/nxc/protocols/smb.py @@ -2,7 +2,6 @@ import binascii import os import re -from io import StringIO from Cryptodome.Hash import MD4 from impacket.smbconnection import SMBConnection, SessionError @@ -818,9 +817,8 @@ def execute(self, payload=None, get_output=False, methods=None) -> str: if (self.args.execute or self.args.ps_execute): self.logger.success(f"Executed command via {current_method}") if output: - output_lines = StringIO(output).readlines() - for line in output_lines: - self.logger.highlight(line.strip()) + for line in output.split("\n"): + self.logger.highlight(line) return output else: self.logger.fail(f"Execute command failed with {current_method}")