nc(netcat)을 이용하여 socket 동작 확인 방법

This topic contains 1 reply, has 2 voices, and was last updated by  cefm**** 2018-07-10 16:43.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #259

    technote
    Keymaster

    nc — arbitrary TCP and UDP connections and listens

    DESCRIPTION
    The nc (or netcat) utility is used for just about anything under the sun involving TCP, UDP,
    or UNIX-domain sockets. It can open TCP connections, send UDP packets, listen on arbitrary
    TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. Unlike telnet(1), nc
    scripts nicely, and separates error messages onto standard error instead of sending them to
    standard output, as telnet(1) does with some.

    udp socket 을 구현하여 그 동작을 확인하기 위한 목적으로 nc를 사용하였다.

    ~$ nc 192.168.1.1 6667 -u

    위와 같이 실행하여 입력하면 바로 sendto 가 가능하고 거기에 대한 recvfrom로 즉각 확인이 가능하다.

    • This topic was modified 6 months, 2 weeks ago by  technote.
    • This topic was modified 3 weeks, 6 days ago by  technote.

    #917

    cefm****
    Participant

    위와 같이  client로 nc를 쓸수 도 있지만 server로 사용도 가능합니다.

    https://fabianlee.org/2016/09/26/ubuntu-simulating-a-web-server-using-netcat/

     

    nc -vl PORT

    -l 은 listen

    -v 는 vervose

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.