Netcat 사용법
Netcat 사용법 
    - 네트워크 전송, 스캔 유틸리티 
https://nc110.sourceforge.io/ 
//------------------------------------- 
* 다운로드 
    - 리눅스  
https://sourceforge.net/projects/nc110/ (2007) 
    - 윈도우  
http://eternallybored.org/misc/netcat/ 
     netcat 1.11  (2010) 
     netcat 1.12 : -c 옵션 추가 
https://joncraton.org/blog/46/netcat-for-windows/ (2004) 
    nc111nt_safe.zip :  위험하다는 -e 옵션 제외된 버전 (그래도 바이러스 백신에 걸림 ㅜ.ㅜ)
//------------------------------------- 
< 사용법 > 
* telnet port 접속 테스트 
nc 127.0.0.1 23 
* 웹서버 접속 
echo -e "HEAD / HTTP/1.0\n\n" | nc 127.0.0.1 80 
* 포트 스캔 
nc -n -v -z -w 1 127.0.0.1 70-80 
//------------------------------------- 
* 채팅 
    - 서버 
nc -l -p 8080 
    - 클라이언트 
nc 서버IP 8080 
//------------------------------------- 
* 파일 전송 
    - 파일을 받는 곳(클라이언트)
nc -l -p 1234 > out.file 
    - 보내는 곳(서버)
nc -w 3 받는곳IP 1234 < out.file 
//------------------------------------- 
* 백도어 쉘 (Backdoor Shell) 
    - 리눅스 
nc -l -p 포트 -e /bin/bash 
    - 윈도우 
nc -l -p 포트 -e cmd.exe 
//----------------------------------------------------------------------------- 
> nc -h  
[v1.12 NT http://eternallybored.org/misc/netcat/] 
connect to somewhere:   nc [-options] hostname port[s] [ports] ... 
listen for inbound:     nc -l -p port [options] [hostname] [port] 
options: 
        -d              detach from console, background mode 
        -e prog         inbound program to exec [dangerous!!] 
        -g gateway      source-routing hop point[s], up to 8 
        -G num          source-routing pointer: 4, 8, 12, ... 
        -h              this cruft 
        -i secs         delay interval for lines sent, ports scanned 
        -l              listen mode, for inbound connects   - 외부로 파일 전송에도 사용 가능 
        -L              listen harder, re-listen on socket close 
        -n              numeric-only IP addresses, no DNS  
        -o file         hex dump of traffic 
        -p port         local port number 
        -r              randomize local and remote ports 
        -s addr         local source address 
        -t              answer TELNET negotiation 
        -c              send CRLF instead of just LF 
        -u              UDP mode 
        -v              verbose [use twice to be more verbose] 
        -w secs         timeout for connects and final net reads 
        -z              zero-I/O mode [used for scanning]  - 데이터 전송 안함, 스캐닝 모드에서 사용 
port numbers can be individual or ranges: m-n [inclusive]