Netcat

Connecting to a TCP/UDP Port

Let's begin by using Netcat (nc) to check if TCP port 110 (the POP3 mail service) is open on one of the lab machines. We will supply several arguments: the -n option to skip DNS name resolution; - v to add some verbosity; the dest ination IP address; and the destination port number

kali@kali:~$ nc -nv 10,11,8,22 118

kali@kali:-$ nc -nv 10.11.e.22 118
(UNKNOWN) [10.11.0.22) 110 (pop3) open
+OK POP3 server lab ready <b>
USER kali
+OK kali welcome here
PASS kali
-ERR unable to tock mail box
quit
+OK POP3 server lab signing off.
kali@kali:-$

Listening on a TCP/UDP Port

C:\Users\G37YSY73M> nc -nlvp 4444

Transferring Files with Netcat

nc - nlvp 4444 > incoming.exe

nc -nv 10.11.0.22 4444 < /usr/share/windows-resources/binaries/wget.exe

Last updated