239 words
1 minutes
nc_Netcat

link#

현재 열린 포트 검색 가능#

  • 20 ~ 1,000 열린 포트 검색
$ nc -z -v 127.0.0.1 20-1000
nc: connectx to 127.0.0.1 port 20 (tcp) failed: Connection refused
nc: connectx to 127.0.0.1 port 21 (tcp) failed: Connection refused
nc: connectx to 127.0.0.1 port 22 (tcp) failed: Connection refused
nc: connectx to 127.0.0.1 port 23 (tcp) failed: Connection refused
nc: connectx to 127.0.0.1 port 24 (tcp) failed: Connection refused
nc: connectx to 127.0.0.1 port 25 (tcp) failed: Connection refused
nc: connectx to 127.0.0.1 port 26 (tcp) failed: Connection refused
nc: connectx to 127.0.0.1 port 27 (tcp) failed: Connection refused

UDP 연결을 설정#

nc -u host port

Examples#

$ nc -p 31337 -w 5 host.example.com 42
  • Open a UDP connection to port 53 of host.example.com:
$ nc -u host.example.com 53
  • Open a TCP connection to port 42 of host.example.com using 10.1.2.3 as the IP for the local end of the connection:
$ nc -s 10.1.2.3 host.example.com 42
  • Create and listen on a Unix Domain Socket:
$ nc -lU /var/tmp/dsocket
  • Connect to port 42 of host.example.com via an HTTP proxy at 10.2.3.4, port 8080. This example could also be used by ssh(1); see the ProxyCommand directive in ssh_config(5) for more information.
$ nc -x10.2.3.4:8080 -Xconnect host.example.com 42 
nc_Netcat
https://younghakim7.github.io/blog/posts/nc_netcat/
Author
YoungHa
Published at
2024-01-03