Difference between revisions of "Netcat"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 21: Line 21:
 
  Connection to 5x.253.51.xxx 4501 port [udp/*] succeeded!
 
  Connection to 5x.253.51.xxx 4501 port [udp/*] succeeded!
 
  -u Use UDP
 
  -u Use UDP
  -v verbose
+
  [[nc -v|-v]] verbose
 
  -z  specifies that nc should just scan for listening daemons, without sending any data to them
 
  -z  specifies that nc should just scan for listening daemons, without sending any data to them
  
Line 29: Line 29:
 
  nc -zv google.com 443
 
  nc -zv google.com 443
 
  Connection to google.com 443 port [tcp/https] succeeded!
 
  Connection to google.com 443 port [tcp/https] succeeded!
 +
 +
[[UDP]] (-u)
 +
nc -u XXXXX
  
 
== Related commands ==
 
== Related commands ==
Line 40: Line 43:
 
* {{netcat}}
 
* {{netcat}}
 
* {{nmap}}
 
* {{nmap}}
*{{Security}}
 
  
 
[[Category:Linux]]
 
[[Category:Linux]]

Latest revision as of 12:45, 12 December 2023

Netcat is the swiss army knife of the hackers. Netcat is used for file (exploit) transfer, finding open ports & remote administration (Bind & Reverse Shells). You can manually connect to any network service like HTTP using netcat. Another utility is to listen on any UDP/TCP ports on your machine for any incoming connections.

  • Windows: ncat.exe
  • Linux:


nc examples[edit]

  • echo "text to send" | nc IP port
  • echo "text to send" | nc 10.10.10.10 54
  • Forward port (see also socat):
nc -l -p ORIGIN_PORT -c 'nc DESTINATION_IP DESTINATIO_PORT'
nc -l -p 2222 -c 'nc 10.10.10.4 8888'
nc <IPaddress or FQDN> <port number>


nc -vnzu  5x.253.51.xxx 4501
Connection to 5x.253.51.xxx 4501 port [udp/*] succeeded!
-u Use UDP
-v verbose
-z  specifies that nc should just scan for listening daemons, without sending any data to them
nc -zv google.com 80
Connection to google.com 80 port [tcp/http] succeeded!
nc -zv google.com 443
Connection to google.com 443 port [tcp/https] succeeded!
UDP (-u)
nc -u XXXXX

Related commands[edit]

See also[edit]

Advertising: