nxc-nfs
Manage NFS shares for LXC containers
TLDR
Detect the version of a remote NFS server
List the available NFS shares
Enumerate the exposed shares recursively to the specified depth
Download the specified remote file
Upload the specified local file to the remote share
SYNOPSIS
nxc nfs target(s) [ NFS_OPTIONS ] [ GLOBAL_OPTIONS ]
PARAMETERS
target(s)
One or more targets specified as an IP address, CIDR range (e.g., 192.168.1.0/24), hostname, or a path to a file containing a list of targets.
--shares
Lists all exported NFS shares on the target(s) and displays their respective options. This is the primary enumeration option.
--port
Specifies the NFS port to connect to. Defaults to 2049.
--rpc-port
Specifies the RPC port (portmapper) to connect to. Defaults to 111.
--show-versions
Displays the supported NFS versions on the target system.
--show-info
Shows additional NFS server information, often including mount points and other details.
-v, --verbose
Increases verbosity of output, showing more details about the operations.
--threads
Specifies the number of concurrent threads to use for scanning multiple targets. Defaults to 10.
--timeout
Sets the connection timeout in seconds for target hosts. Defaults to 20.
DESCRIPTION
nxc-nfs is a module within the NetExec (formerly CrackMapExec) framework, a powerful post-exploitation tool primarily used by penetration testers for auditing large networks. While NetExec is best known for its Windows/SMB/Active Directory capabilities, the nfs module specifically targets Network File System (NFS) services.
This module allows users to enumerate NFS exports on target systems, identify accessible shares, and gather information that could potentially lead to unauthorized access or data exposure. It's commonly used to discover weakly configured NFS shares, such as those with anonymous access (no_root_squash, insecure shares) or wide-open permissions, which are common vulnerabilities in network environments. It helps security professionals quickly assess the security posture of NFS implementations.
CAVEATS
The `nxc-nfs` command is not a standalone Linux utility but a module within the `netexec` framework. It requires NetExec to be installed. It is primarily a penetration testing and security auditing tool; improper use may lead to unauthorized access or disruption of services. Always ensure you have explicit authorization before scanning any network or system.
INSTALLATION AND USAGE
To use `nxc nfs`, NetExec must first be installed. It can typically be installed via `pipx install nxc` or through package managers like `apt` (for Kali Linux) if available. After installation, the common usage pattern is `nxc nfs
SECURITY IMPLICATIONS
NFS shares, if misconfigured (e.g., world-readable, no_root_squash, or exported to untrusted networks), can pose significant security risks. `nxc nfs` is instrumental in identifying these misconfigurations, allowing administrators to secure their environments before they are exploited by malicious actors.
HISTORY
The `nxc` (NetExec) tool evolved from `CrackMapExec` (CME), a widely used penetration testing framework. The NFS module was integrated to provide comprehensive network service auditing capabilities beyond its initial focus on SMB/AD. Its development is community-driven, continually adding new modules and features to address various network protocols and vulnerabilities, including NFS.