What is the Windows equivalent of the command "nc [server_name] [port]"?

On linux, one can connect to a server by typing nc pwnable.kr 9000 on a terminal.

On windows, this does not work in Powershell nor cmd, and also Putty when using Telnet looks at first like it connected, and then whenever I enter something it exits, which is not the behaviour on Linux. So what is the correct way to access this server on Windows and send commands to it?

4

3 Answers

You may download a portable version of ncat from this site: It's a beta version (). If you prefer, you may also use the nmap command for windows provided on this site too.

The Windows equivalent is Test-NetConnection - it will test if the connection to the destination works and show certain debug output.

Test-NetConnection -ComputerName superuser.com -Port 443 ComputerName : superuser.com RemoteAddress : 151.101.193.69 RemotePort : 443 InterfaceAlias : LAN-Connection* 12 SourceAddress : 10.254.93.150 TcpTestSucceeded : True 
1

You can use "tnc" as shortening of Test-NetConnection in Windows Powershell. Legacy Windows command shell doesn't have any equivalent of nc (except third parties).

For example:

PS C:\Windows\system32> tnc haruncetin.com.tr -p 80 ComputerName : haruncetin.com.tr RemoteAddress : 172.67.208.143 RemotePort : 80 InterfaceAlias : Ethernet 1 SourceAddress : 192.168.215.119 TcpTestSucceeded : True 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like