18

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?

Emolga
  • 282

3 Answers3

12

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

10

You may download a portable version of ncat from this site: https://nmap.org/ncat/ It's a beta version (http://nmap.org/dist/ncat-portable-5.59BETA1.zip). If you prefer, you may also use the nmap command for windows provided on this site too.

Zvonko
  • 116
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