snetcat (Secure NetCat) 사용법

Reference

nc (netcat) 사용법 (윈도우용 nc 포함)

Secure netcat – http://snetcat.sourceforge.net/ 

옵션

usage: snetcat [OPTIONS] [<host> <port>]

-u              use UDP instead of TCP

-g              bind to INADDR_ANY

-o file         hexdump passed traffic to a file

-d Act as listening server, forking childs

-s certif Wrap the connection into SSL, using given certificate file

-l localport    listen on localport

-e prog         redirect stdin/stdout to program

 

사용

Fetch web page

% echo -e “GET /index.html HTTP/1.0\n\n” | snetcat www.yahoo.com 80

Fetch web page via HTTPS

% echo -e “GET /index.html HTTP/1.0\n\n” | snetcat -s “” www.yahoo.com 80

Run port forwarder

% snetcat -l local_port remote_host remote_port

Turn web server on your machine to be HTTPS web server

% snetcat -l 443 -s CERTIFICATE.PEM -d 127.0.0.1 80

Mail client (sh script)

sendmail

Simple web server (sh script)

httpd

 

 

>>>>> HTTP를 통해 페이지 가져오기

– 기본 페이지
echo -e “GET / HTTP/1.0\n\n” | snetcat www.stearns.org 80

HTTP/1.1 200 OK

Date: Wed, 14 May 2014 07:35:12 GMT

Server: Apache/2.2.3 (CentOS)

Last-Modified: Wed, 19 Mar 2008 20:10:46 GMT

ETag: “23c1a8-64ce-448cfd92edd80”

Accept-Ranges: bytes

Content-Length: 25806

Connection: close

Content-Type: text/html; charset=UTF-8

<html>

<head>

<title>Bill Stearns’ web site</title>

</head>

 

<body>

</body>

</html>

– 특정 페이지

echo -e “GET http://www.stearns.org/doc/nc-intro.v0.9.html HTTP/1.0\n\n” | snetcat www.stearns.org 80

HTTP/1.1 200 OK

Date: Wed, 14 May 2014 07:36:46 GMT

Server: Apache/2.2.3 (CentOS)

Last-Modified: Thu, 18 Dec 2003 20:31:26 GMT

ETag: “23c369-2ecf-3cec71b8a6380”

Accept-Ranges: bytes

Content-Length: 11983

Connection: close

Content-Type: text/html; charset=UTF-8

 

<html>

<head>

<title>Netcat – network connections made easy</title>

</head>

<body>

</body>

</html>

출처:  http://blog.naver.com/PostView.nhn?blogId=kiros33&logNo=130191150448

답글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.