16

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
  • 262
  • 1
  • 2
  • 8
  • [ncat](https://nmap.org/ncat/) is available for Windows. Download and install that. – n8te Sep 08 '17 at 08:14
  • Ok, thank you. (I just thought that would be something Putty is capable doing) – Emolga Sep 08 '17 at 08:15
  • I installed it, what should I do now? the commands still do not work. The new application "Nmap - Zenmap GUI" with the above command just shows me that the server is running and the port 9000 is open, but I can't see how to send inputs to the program that the server is running. – Emolga Sep 08 '17 at 08:35
  • Nmap is something different (it's a port scanner). To use ncat is virtually no different than using nc in Linux. From command prompt type out `ncat pwnable.kr 9000` – n8te Sep 08 '17 at 08:38

3 Answers3

8

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 
Tim Menapace
  • 199
  • 1
  • 1
  • 8
    No. `Test-NetConnection` will attempt to open a socket and report whether that succeeded. `nc` or `netcat` will give the user an open connection to that socket, so they can enter data that will be sent to the server. – CodeCaster Dec 01 '21 at 19:01
  • Generally you're right @CodeCaster. But a lot of admins use nc to check if a connection / port is reachable or open via nc -vz . This behavior can be replicated on a windows client via the command described above. – Tim Menapace Apr 10 '23 at 08:50
7

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
  • 86
  • 1
  • 2
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
  • 2
    Thanks, but this was already posted in a comment, and seemingly does not give the required functionality?... – Emolga Jan 31 '22 at 12:41