Skip to content

Commit

Permalink
Merge branch 'github_builder' of github.com:Pennyw0rth/NetExec into g…
Browse files Browse the repository at this point in the history
…ithub_builder
  • Loading branch information
Marshall-Hallenbeck committed Sep 19, 2023
2 parents a825ef8 + 6978af1 commit 9b76759
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 45 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/netexec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ jobs:
name: NetExec Tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: NetExec tests on ${{ matrix.os }}
- name: NetExec set up python on ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data/nxc.db
hash_spider_default.sqlite3
*.bak
*.log
.venv
Expand Down
46 changes: 36 additions & 10 deletions netexec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,58 @@ a = Analysis(
('./nxc/modules', 'nxc/modules')
],
hiddenimports=[
'nxc.protocols.mssql.mssqlexec',
'nxc.connection',
'impacket.examples.secretsdump',
'impacket.dcerpc.v5.lsat',
'impacket.dcerpc.v5.transport',
'impacket.dcerpc.v5.lsad',
'impacket.dcerpc.v5.gkdi',
'impacket.dcerpc.v5.rprn',
'impacket.dpapi_ng',
'impacket.tds',
'impacket.version',
'impacket.ldap.ldap',
'nxc.connection',
'nxc.servers.smb',
'nxc.protocols.smb.wmiexec',
'nxc.protocols.smb.atexec',
'nxc.protocols.smb.smbexec',
'nxc.protocols.smb.mmcexec',
'nxc.protocols.smb.smbspider',
'nxc.protocols.smb.passpol',
'nxc.protocols.mssql.mssqlexec',
'nxc.helpers.bash',
'nxc.helpers.bloodhound',
'nxc.helpers.msada_guids',
'paramiko',
'pypsrp.client',
'pywerview.cli.helpers',
'impacket.tds',
'impacket.version',
'nxc.helpers.bash',
'pylnk3',
'pypykatz',
'masky',
'msldap',
'msldap.connection',
'lsassy',
'win32timezone',
'impacket.tds',
'impacket.ldap.ldap',
'impacket.tds'
],
'lsassy.dumper',
'lsassy.parser',
'lsassy.session',
'lsassy.impacketfile',
'dns',
'dns.name',
'dns.resolver',
'dploot',
'dploot.triage',
'dploot.triage.rdg',
'dploot.triage.vaults',
'dploot.triage.browser',
'dploot.triage.credentials',
'dploot.triage.masterkeys',
'dploot.triage.backupkey',
'dploot.triage.wifi',
'dploot.lib.target',
'dploot.lib.smb',
'pyasn1_modules.rfc5652',
'unicrypto.backends.pycryptodomex',
],
hookspath=['./nxc/.hooks'],
runtime_hooks=[],
excludes=[],
Expand Down
6 changes: 6 additions & 0 deletions nxc/.hooks/hook-pypykatz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PyInstaller.utils.hooks import collect_all

datas, binaries, hiddenimports = collect_all("pypykatz")
3 changes: 2 additions & 1 deletion nxc/modules/drop-sc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

import ntpath
import tempfile


class NXCModule:
Expand Down Expand Up @@ -45,7 +46,7 @@ def options(self, context, module_options):

self.file_path = ntpath.join("\\", f"{self.filename}.searchConnector-ms")
if not self.cleanup:
self.scfile_path = f"/tmp/{self.filename}.searchConnector-ms"
self.scfile_path = f"{tempfile.gettempdir()}/{self.filename}.searchConnector-ms"
scfile = open(self.scfile_path, "w")
scfile.truncate(0)
scfile.write('<?xml version="1.0" encoding="UTF-8"?>')
Expand Down
48 changes: 20 additions & 28 deletions nxc/modules/nanodump.py

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions nxc/modules/procdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import base64
import re
import sys

from pypykatz.pypykatz import pypykatz

import pypykatz
from nxc.helpers.bloodhound import add_user_bh


Expand Down
3 changes: 2 additions & 1 deletion nxc/modules/webdav.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def on_login(self, context, connection):
except SessionError as e:
if e.getErrorCode() == nt_errors.STATUS_OBJECT_NAME_NOT_FOUND:
pass

elif e.getErrorCode() in nt_errors.ERROR_MESSAGES:
context.log.fail(f"Error enumerating WebDAV: {e.getErrorString()[0]}", color="magenta")
else:
raise e

0 comments on commit 9b76759

Please sign in to comment.