LinuxCommandLibrary

netexec

Automate network enumeration and remote execution

TLDR

View documentation for the original command

$ tldr nxc
copy

SYNOPSIS

netexec [options] [hostname] [port]

PARAMETERS

-s
    Run in server mode, listening on the specified port.

-u
    Use UDP protocol instead of TCP (the default).

-p port
    Specify the port number to listen on (server mode) or connect to (client mode). Required unless listening on stdin/stdout.

[hostname]
    The hostname or IP address of the server to connect to (client mode). If omitted, it defaults to stdin/stdout.

[port]
    The port number of the server to connect to (client mode). Required unless listening on stdin/stdout.

DESCRIPTION

The netexec command is a versatile tool designed for network testing and debugging. It facilitates the creation of simple client-server connections using either TCP or UDP protocols. One instance acts as a server, listening on a specified port, while another acts as a client, connecting to that port. This allows you to send and receive data, effectively testing network connectivity, bandwidth, and packet loss.

netexec is valuable for identifying network issues such as firewall restrictions, routing problems, and name resolution failures. By sending specific data patterns, you can also measure data transfer rates. The command's simplicity makes it a quick and effective tool for verifying basic network functionality before deploying more complex applications.

netexec is a small utility that can be used to debug network issues, especially for testing TCP or UDP connectivity between two endpoints. Its a good tool to see if a firewall is blocking any ports, or test bandwidth.

TYPICAL USAGE

To start a server listening on port 12345:
netexec -s -p 12345

To connect to the server from another machine:
netexec server_ip 12345

SEE ALSO

netcat(1), ping(8), traceroute(8), tcpdump(1)

Copied to clipboard