본문 바로가기

Syllabus/웹보안(웹해킹)

NC tool - How to use NC tool on Windows

C:\Tools\nc11nt>nc /?

/?: forward host lookup failed: h_errno 11001: HOST_NOT_FOUND


C:\Tools\nc11nt>nc -help

[v1.10 NT]

connect to somewhere:   nc [-options] hostname port[s] [ports] ...

listen for inbound:     nc -l -p port [options] [hostname] [port]

options:

        -d              detach from console, stealth 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

        -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]


C:\Tools\nc11nt>nc -nv 192.168.2.11 80

(UNKNOWN) [192.168.2.11] 80 (?) open

HEAD / HTTP/1.1

host:192.168.2.11


HTTP/1.1 200 OK

Server: Microsoft-IIS/5.0

Date: Wed, 01 Jun 2016 02:40:25 GMT

Content-Length: 865

Content-Type: text/html

Set-Cookie: ASPSESSIONIDQADRQDDR=IPOHFPBDCIGJIOCMFPMFPBDD; path=/

Cache-control: private


TRACE / HTTP/1.1

host:192.168.2.11

content-length 7


HTTP/1.1 200 OK

Server: Microsoft-IIS/5.0

Date: Wed, 01 Jun 2016 02:43:02 GMT

Content-Type: message/http

Content-Length: 35


TRACE / HTTP/1.1

host:192.168.2.11

HTTP/1.1 400 Bad Request

Server: Microsoft-IIS/5.0

Date: Wed, 01 Jun 2016 02:43:02 GMT

Content-Type: text/html

Content-Length: 87


<html><head><title>Error</title></head><body>The parameter is incorrect. </body>

</html>


C:\Tools\nc11nt>nc -nv 192.168.2.11 80

(UNKNOWN) [192.168.2.11] 80 (?) open

PUT http://192.168.2.11/board/upload/hack.html HTTP/1.1

host:192.168.2.11


HTTP/1.1 411 Length Required

Server: Microsoft-IIS/5.0

Date: Wed, 01 Jun 2016 02:44:41 GMT

Connection: close

Content-Type: text/html

Content-Length: 50


<body><h2>HTTP/1.1 411 Length Required</h2></body>



C:\Tools\nc11nt>nc -nv 192.168.2.11 80

(UNKNOWN) [192.168.2.11] 80 (?) open

DELETE http://192.168.2.11/board/upload/hack.html HTTP/1.1

host:192.168.2.11


HTTP/1.1 404 Resource Not Found

Server: Microsoft-IIS/5.0

Date: Wed, 01 Jun 2016 02:45:56 GMT

Connection: close

Content-Type: text/html

Content-Length: 3937


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<html dir=ltr>


<head>

<style>  a:link                  {font:9pt/11pt 굴림; color:FF0000} a:visited

         {font:9pt/11pt 굴림; color:FF0000} a:visited

</style>


<META NAME="ROBOTS" CONTENT=" NOINDEX">


<title> 이 페이지를 찾을 수 없습니다.</title>


<META HTTP-EQUIV="Content-Type" Content=" text-html; charset=ks_c_5601-1987">

</head>


<script>

function Homepage(){

<!--

// in real bits, urls get returned to our script like this:

// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm


        //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.m

icrosoft.com/bar.htm"

        DocURL = document.URL;


        //this is where the http or https will be, as found by searching for ://

 but skipping the res://

        protocolIndex=DocURL.indexOf("://",4);


        //this finds the ending slash for the domain server

        serverIndex=DocURL.indexOf("/",protocolIndex + 3);


                //for the href, we need a valid URL to the domain. We search for

 the # symbol to find the begining

        //of the true URL, and add 1 to skip it - this is the BeginURL value. We

 use serverIndex as the end marker.

        //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);

        BeginURL=DocURL.indexOf("#",1) + 1;


        urlresult=DocURL.substring(BeginURL,serverIndex);


        //for display, we need to skip after http://, and go to the next slash

        displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);


        InsertElementAnchor(urlresult, displayresult);

}


function HtmlEncode(text)

{

    return text.replace(/&/g, '&amp').replace(/'/g, '&quot;').replace(/</g, '&lt

;').replace(/>/g, '&gt;');

}


function TagAttrib(name, value)

{

    return ' '+name+'="'+HtmlEncode(value)+'"';

}


function PrintTag(tagName, needCloseTag, attrib, inner){

    document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );

    if (needCloseTag) document.write( '</' + tagName +'>' );

}


function URI(href)

{

    IEVer = window.navigator.appVersion;

    IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );


    return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?

        encodeURI(href) :

        escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');

}


function InsertElementAnchor(href, text)

{

    PrintTag('A', true, TagAttrib('HREF', URI(href)), text);

}


//-->

</script>


<body bgcolor="FFFFFF">


<table width="410" cellpadding="3" cellspacing="5">


  <tr>

    <td align="left" valign="middle" width="360">

        <h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem--> 이 페이

지를 찾을 수 없습니다.</h1>

    </td>

  </tr>


  <tr>

    <td width="400" colspan="2"> <font style="COLOR:000000; FONT: 9pt/11pt 굴림"

>찾고 있는 페이지가 삭제되었거나 이름이 변경되었거나 일시적으로 사용할 수 없습니

다.</font></td>

  </tr>


  <tr>

    <td width="400" colspan="2"> <font style="COLOR:000000; FONT: 9pt/11pt 굴림"

>


        <hr color="#C0C0C0" noshade>


<p> 다음을 시도해 보십시오.</p>


        <ul>

      <li>주소 표시줄에 페이지 주소를 입력했다면 주소를 정확히 입력했는지 확인해

 보십시오.<br>

      </li>


      <li>



<script>

          <!--

          if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navi

gator.appVersion.charAt(0) == "2")))

          {

                Homepage();

          }

          //-->

           </script>


            홈 페이지를 연 다음 원하는 정보에 대한 링크를 찾으십시오.</li>


      <li> <a href="javascript:history.back(1)">뒤로</a> 단추를 클릭하여 다른 링

크를 시도해 보십시오.</li>

    </ul>


    <h2 style="font:9pt/11pt 굴림; color:000000">HTTP 404 - 파일을 찾을 수 없음<

br> Internet Information Services<BR></h2>


        <hr color="#C0C0C0" noshade>


        <p> 기술 정보(지원 인력용)</p>


<ul>

<li> 자세한 정보:<br> <a href="http://www.microsoft.com/ContentRedirect.asp?prd=

iis&sbp=&pver=5.0&pid=&ID=404&cat=web&os=&over=&hrd=&Opt1=&Opt2=&Opt3=" target="

_blank">Microsoft 기술 지원</a>

</li>

</ul>


    </font></td>

  </tr>


</table>

</body>

</html>


C:\Tools\nc11nt>