View Issue Details

IDProjectCategoryView StatusLast Update
0008533Kali LinuxQueued Tool Additionpublic2024-05-30 09:51
ReporterNeffIsBack Assigned Todaniruiz  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Fixed in Version2024.2 
Summary0008533: NetExec - The network execution tool for pentesting
Description

Name: NetExec
Version: v1.1.0
Homepage: https://github.com/Pennyw0rth/NetExec
Wiki: https://www.netexec.wiki/
Download: https://github.com/Pennyw0rth/NetExec/releases/tag/v1.1.0
Author: mpgn_x64, zblurx, Marshall-Hallenbeck, NeffIsBack
Licence: BSD 2-Clause "Simplified" License, https://github.com/Pennyw0rth/NetExec/blob/main/LICENSE
Description:
This tool is used for penetration testing (mainly Active Directory) and allows not only authentication across multiple implemented protocols, but also execution of commands on multiple targets at once. In addition, community-built modules allow further exploitation, vulnerability scanning or credential harvesting using various techniques. This tool is the actively maintained fork of the well-known "CrackMapExec" tool, which is now inactive. The latest version of crackmapexec in the kali repositories is version 5.4.0. A lot of features have been added since then, not only in the new NetExec repository, but also features that were already on the crackmapexec github, but not updated in the kali repositories.
Dependencies: Only the python packages specified in the pyproject.toml file.
Similar tools: CrackMapExec, which is no longer maintained.
Activity: This project started in mid-September, has now had two releases and is in active development.
How to install: Either install NetExec using the github release tag, or use the appropriate binary from the release page.
How to use examples:
-Scan a range for open SMB ports: nxc smb [ip-range]
-Brute-force credentials over ssh: nxc ssh [ip] -u user_list -p password_list

Activities

g0tmi1k

g0tmi1k

2023-12-01 16:40

administrator   ~0018655

@kali-team, please could this be packaged up.
@author, If you want to help the packaging process, you can check the documentation here ~ https://www.kali.org/docs/development/public-packaging

kzb

kzb

2024-01-27 23:12

reporter   ~0018857

@g0tmi1k bump

Any updates on that? Would be nice to just install/update it via apt install NetExec (or apt-get). The old project (crackmapexec) is dead anyways. Recent pen testing and red team manuals refer to the new tool

Arszilla

Arszilla

2024-03-06 11:35

reporter   ~0019002

Last edited: 2024-03-12 15:54

I've packaged dploot, one of the dependencies needed to package/use netexec: https://github.com/zblurx/dploot

Arszilla

Arszilla

2024-03-09 14:51

reporter   ~0019005

Last edited: 2024-03-11 22:39

I have updated dploot from 2.1.4 to 2.6.0

Arszilla

Arszilla

2024-03-11 22:41

reporter   ~0019008

Last edited: 2024-03-12 16:40

EDITED - OUTDATED COMMENT

Arszilla

Arszilla

2024-03-12 15:53

reporter   ~0019009

Last edited: 2024-03-12 16:40

EDITED - OUTDATED COMMENT

Arszilla

Arszilla

2024-03-12 18:51

reporter   ~0019010

netexec is packaged :) - https://gitlab.com/Arszilla/netexec

However, it should be noted that:

  1. There seems to be an error/problem with python3-sqlalchemy. Despite the latest version of python3-sqlalchemy being 2.0.19+ds1-1 from Debian (https://salsa.debian.org/python-team/packages/sqlalchemy), the version in Kali is 1.4.50+ds1-1. netexec requires 2.0.4+.

As a result of this, I believe the following error is caused when executing/running netexec (perhaps only for the first time):

$ netexec -h
[*] First time use detected
[*] Creating home directory structure
[*] Creating missing folder logs
[*] Creating missing folder modules
[*] Creating missing folder protocols
[*] Creating missing folder workspaces
[*] Creating missing folder obfuscated_scripts
[*] Creating missing folder screenshots
[*] Creating default workspace
Traceback (most recent call last):
  File "/usr/bin/netexec", line 5, in <module>
    from nxc.netexec import main
  File "/usr/lib/python3/dist-packages/nxc/netexec.py", line 14, in <module>
    from nxc.config import nxc_config, nxc_workspace, config_log, ignore_opsec
  File "/usr/lib/python3/dist-packages/nxc/config.py", line 16, in <module>
    first_run_setup()
  File "/usr/lib/python3/dist-packages/nxc/first_run.py", line 32, in first_run_setup
    initialize_db()
  File "/usr/lib/python3/dist-packages/nxc/database.py", line 97, in initialize_db
    create_workspace("default")
  File "/usr/lib/python3/dist-packages/nxc/database.py", line 71, in create_workspace
    protocol_object = p_loader.load_protocol(protocols[protocol]["dbpath"])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/nxc/loaders/protocolloader.py", line 16, in load_protocol
    loader.exec_module(protocol)
  File "/usr/lib/python3/dist-packages/nxc/protocols/ftp/database.py", line 5, in <module>
    from sqlalchemy.exc import (
ImportError: cannot import name 'IllegalStateChangeError' from 'sqlalchemy.exc' (/usr/lib/python3/dist-packages/sqlalchemy/exc.py)
  1. Both dploot/python3-dploot and netexec seem to suffer from a SyntaxWarning warning, which I have shared with both repositories under https://github.com/zblurx/dploot/issues/16 and https://github.com/Pennyw0rth/NetExec/issues/200. Assuming these are fixable, expect a small version bump/fix on my repositories.

CC: @kali-team

Arszilla

Arszilla

2024-03-12 22:36

reporter   ~0019012

So, while chatting with @NeffIsBack a few issues were pointed out and will require them to be solved before netexec is moved to kali-dev:

  1. python3-sqlalchemy problem (pointed out in https://bugs.kali.org/view.php?id=8533#c19010)
  2. Instead of python3-impacket, netexec requires https://github.com/Pennyw0rth/impacket/tree/gkdi (Their fork of python3-impacket - gkdi branch)
  3. python3-oscrypto is has a critical bug - as a result https://github.com/Pennyw0rth/oscrypto must be used until https://github.com/wbond/oscrypto/issues/78 is solved by the maintainer/owner of oscrypto
Arszilla

Arszilla

2024-03-13 07:53

reporter   ~0019014

It was pointed out to me by Steev that Arnauld and Sophie have shared a patch with Debian upstream for oscrypto/python3-oscrypto, dealing with https://github.com/wbond/oscrypto/issues/78 - (Patch: https://salsa.debian.org/python-team/packages/oscrypto/-/blob/debian/latest/debian/patches/Make_OpenSSL_version_regexes_more_robust.patch?ref_type=heads)

I will test this later to ensure that the patch is working as intended for netexec.

Arszilla

Arszilla

2024-03-13 16:45

reporter   ~0019016

I have thought of packaging Pennyw0rth's fork of impacket as python3-impacket-netexec and using it instead of python3-impacket - maybe with a Conflicts: or Replaces: header (otherwise Python might have a hard time distinguishing between both).

While reviewing the reverse dependencies of impacket via apt-cache rdepends python3-impacket, I have noticed that 0000030:0000022 packages depend on python3-impacket, 4 of which are dependencies of netexec. Thus, my initial idea is out the window and sadly, I can't think of another solution where both packages could potentially co-exist within Kali etc.

As a result, I fear netexec's packaging might have hitten a standstill for now - either until a better solution could be figured out or if Fortra merges the netexec team's PR/MR requests to impacket.

Lastly: I have opened a ticket regarding sqlalchemy: https://bugs.kali.org/view.php?id=8667 regarding the point mentioned in https://bugs.kali.org/view.php?id=8533#c19010

Arszilla

Arszilla

2024-03-14 07:44

reporter   ~0019021

Opened https://github.com/Pennyw0rth/NetExec/issues/205 as a requirement to package netexec. Once that is solved, the only obstacle might be the sqlalchemy version discrepancy, which is not something that netexec team can fix, but Kali/Debian.

Arszilla

Arszilla

2024-03-15 09:04

reporter   ~0019028

Had to republish dploot - as I fixed some stuff regarding licenses etc. and I've submitted a bug report for it to be added to the Kali repos: https://bugs.kali.org/view.php?id=8671

Arszilla

Arszilla

2024-03-17 20:24

reporter   ~0019048

So, for netexec to work, Pennyw0rth/impacket (https://github.com/Pennyw0rth/impacket has to be packaged (the gdki branch, specifically). However, there is an issue: It will use the /usr/lib/python3/dist-packages/impacket directory if it's packaged as it is, which conflicts with python3-impacket.

After some discussions with @NeffIsBack and the other NetExec devs/maintainers, there seems to be only one option left to facilitate this: use patches for both python3-impacket-nxc (provisional name for the forked version of impacket) and netexec to rename all occurrences of impacket to impacket_nxc.

Currently, I have a provisional package for the impacket fork, so I will be working on packaging that.

However, I have also noticed that nearly a dozen packages require version bumps (both on Kali and Debian side) in order to package netexec, as seen here: https://github.com/Pennyw0rth/NetExec/issues/211

@NeffIsBack and the others will see if these packages could be downgraded to the versions available in Kali and Debian to facilitate the ease of packaging. For those that cannot be packaged, a ticket for upgrade will be opened on each respective OS.

Arszilla

Arszilla

2024-04-25 16:26

reporter   ~0019199

Great news everyone. After nearly 1.5-2 months of sorting out dependencies, NetExec is ready for Kali: https://gitlab.com/Arszilla/netexec

Please note that Kali will have to use the kali-packaging branch, due to dependency hell, but initial testing conducted by @NeffIsBack seems to be promising. From what I can tell, it seems like we are finally ready to move the package to Kali.

Arszilla

Arszilla

2024-04-25 16:27

reporter   ~0019200

The images failed to upload, retrying.

Arszilla

Arszilla

2024-04-25 16:28

reporter   ~0019201

netexec-1.png (730,335 bytes)
Arszilla

Arszilla

2024-04-25 16:28

reporter   ~0019202

netexec-2.png (387,191 bytes)
NeffIsBack

NeffIsBack

2024-04-25 21:40

reporter   ~0019205

@Arszilla thanks a lot for all the work with packaging!
@kali-team please wait with the upload until we publish version 1.2.0 soon. There are some bug-fix and feature PRs we would like to have in the release, so version 1.2.0 and therefore also the kali version is as stable as possible: https://github.com/Pennyw0rth/NetExec/milestone/3
I will reach out when we do the release.

daniruiz

daniruiz

2024-04-29 11:54

manager   ~0019215

I've pushed netexec 1.1.0 to kali-experimental repository so we can test the package before releasing it. Let us know when 1.2.0 is ready to be packaged for kali and I'll push the changes to kali-rolling

daniruiz

daniruiz

2024-04-29 11:54

manager   ~0019216

Link to the package info
https://pkg.kali.org/pkg/netexec

Arszilla

Arszilla

2024-04-29 11:55

reporter   ~0019217

I will be submitting a few MRs to the repository later today as there has been some minor adjustments that @NeffIsBack implemented based on my discussion with him on DIscord. It is nothing major or such but QoL things.

daniruiz

daniruiz

2024-05-30 09:51

manager   ~0019337

Netexec 1.2.0 is now packaged from the kali branch

Issue History

Date Modified Username Field Change
2023-11-16 21:51 NeffIsBack New Issue
2023-12-01 16:39 g0tmi1k Status new => acknowledged
2023-12-01 16:39 g0tmi1k Category New Tool Requests => Queued Tool Addition
2023-12-01 16:40 g0tmi1k Note Added: 0018655
2024-01-27 23:12 kzb Note Added: 0018857
2024-03-06 11:35 Arszilla Note Added: 0019002
2024-03-06 11:36 Arszilla Note Edited: 0019002
2024-03-09 14:51 Arszilla Note Added: 0019005
2024-03-09 14:51 Arszilla Note Edited: 0019005
2024-03-11 22:39 Arszilla Note Edited: 0019002
2024-03-11 22:39 Arszilla Note Edited: 0019005
2024-03-11 22:41 Arszilla Note Added: 0019008
2024-03-12 15:53 Arszilla Note Added: 0019009
2024-03-12 15:54 Arszilla Note Edited: 0019002
2024-03-12 16:25 Arszilla Note Edited: 0019008
2024-03-12 16:25 Arszilla Note Edited: 0019009
2024-03-12 16:40 Arszilla Note Edited: 0019008
2024-03-12 16:40 Arszilla Note Edited: 0019009
2024-03-12 18:51 Arszilla Note Added: 0019010
2024-03-12 22:36 Arszilla Note Added: 0019012
2024-03-13 07:53 Arszilla Note Added: 0019014
2024-03-13 16:45 Arszilla Note Added: 0019016
2024-03-14 07:44 Arszilla Note Added: 0019021
2024-03-15 09:04 Arszilla Note Added: 0019028
2024-03-17 20:24 Arszilla Note Added: 0019048
2024-04-25 16:26 Arszilla Note Added: 0019199
2024-04-25 16:27 Arszilla Note Added: 0019200
2024-04-25 16:28 Arszilla Note Added: 0019201
2024-04-25 16:28 Arszilla File Added: netexec-1.png
2024-04-25 16:28 Arszilla Note Added: 0019202
2024-04-25 16:28 Arszilla File Added: netexec-2.png
2024-04-25 21:40 NeffIsBack Note Added: 0019205
2024-04-26 10:13 daniruiz Assigned To => daniruiz
2024-04-26 10:13 daniruiz Status acknowledged => assigned
2024-04-29 11:54 daniruiz Note Added: 0019215
2024-04-29 11:54 daniruiz Note Added: 0019216
2024-04-29 11:55 Arszilla Note Added: 0019217
2024-05-30 09:51 daniruiz Note Added: 0019337
2024-05-30 09:51 daniruiz Status assigned => resolved
2024-05-30 09:51 daniruiz Resolution open => fixed
2024-05-30 09:51 daniruiz Fixed in Version => 2024.2