In computing, <code>net</code> is a command in IBM OS/2 (including eComStation and ArcaOS), Microsoft Windows, and ReactOS used to manage and configure the operating system from the command-line. It is also part of the IBM PC Network Program for DOS.
The command is primarily used to manage network resources. It is an external command implemented as <code>net.exe</code>. When used in a batch file, the <code>/Y</code> or <code>/N</code> switches can be used to unconditionally answer Yes or No to questions returned by the command. The <code>net</code> command has several sub-commands that can differ from one implementation or operating system version to another.
On Windows CE .NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0, it is available as an external command stored in . This version only supports the use and view sub-commands.
The <code>net use</code> command has several network-related functions.
<code>net use</code> can control mounting ("mapping" in Microsoft terminology) drive shares and connecting shared printers in a network environment. This command makes use of the SMB (server message block) and the NetBIOS protocol on port 139 or 445. The basic Windows XP configuration enables this functionality by default. Thus users can connect to and disconnect from shared resources such as computers, printers and drives.
<code>net use</code> can display a list of network-connection information on shared resources.
<code>net use</code> also connects to the IPC$ (interprocess communication share). This is the so-called null session connection, which allows unauthenticated users. The basic syntax for connecting anonymously is:
For example, typing at the command prompt:
attempts to connect to the share IPC$ of the network 192.168.1.101 as an anonymous user with blank password. If successfully connected to the target machine, a lot of information can be gathered such as shares, users, groups, registry keys and more. This would provide a hacker with a lot of information about a remote user. This has changed in Windows NT 4.0 SP6 already. In Windows 2000 "null session connections" could have been enabled after changes of the system-configuration.