Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nxc/modules/recent_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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\\"
Expand Down
6 changes: 2 additions & 4 deletions nxc/protocols/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}")
Expand Down