0% found this document useful (0 votes)
491 views

Netcat Manual

Netcat is a networking utility that can be used for tasks like port scanning, file transfer, banner grabbing, and simple messaging. It supports both TCP and UDP and can be used to read and write across network connections. Some key features include acting as a client or server, supporting TCP or UDP, and executing programs on an inbound connection. Netcat is useful for tasks like transferring files, port scanning, banner grabbing, and simple network debugging and exploration.

Uploaded by

Ritcher Hardy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
491 views

Netcat Manual

Netcat is a networking utility that can be used for tasks like port scanning, file transfer, banner grabbing, and simple messaging. It supports both TCP and UDP and can be used to read and write across network connections. Some key features include acting as a client or server, supporting TCP or UDP, and executing programs on an inbound connection. Netcat is useful for tasks like transferring files, port scanning, banner grabbing, and simple network debugging and exploration.

Uploaded by

Ritcher Hardy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

How to use Netcat What is Netcat?

Netcat is a network utillity for reading and writing network connection that support TCP and UDP protocol.Netcat is a Trojan that uses to open TCP or UDP ports on a target system,and hacker use it with telnet to gain shell access to the target system. What you will Learn... You can use netcat for scan P address You can use Netcat for simple !anner gra!!ing You can use netcat for an "C messanger What you should know You must knowing a!out TCP# P and UDP protocol netcat $riginally released in %&&',and often referred to as a ()wiss *rmy knife( utility, and for good reason.Netcat can !e port scanning, transferring files, gra!!ing !anners, port listening and redirection, and a !ackdoor.netcat is a +erion of cat program,,ust as cat reads and writes information to files, Netcat reads and writes information across network connections.Netcat $riginally coded for UN -,!ut can !e run in many operation system.for download netcat go to netcat.sourceforge.net or http.##nc%%/.sourceforge.net# .some of Netcat features are .
Outbound or inbound connections, TCP or UDP, to or from any ports Full DNS forward/reverse c ec!in", wit appropriate warnin"s #bility to use any local source port #bility to use any locally$confi"ured networ! source address %uilt$in port$scannin" capabilities, wit randomi&er %uilt$in loose source$routin" capability Can read command line ar"uments from standard input Slow$send mode, one line every N seconds 'e( dump of transmitted and received data Optional ability to let anot er pro"ram service establis ed connections Optional telnet$options responder

n the 0//',www.insecure.org 1Nmap hacker2 detect netcat as the second )trongest network utillity and in 0//3 and 0//' it 4ained fourth place. *fter downloading Netcat,to confirm that Netcat installed correctly, type nc h or netcat h to display the help screen.

5igure %.Netcat help in 6indows 7etween 4NU#8inu9 +ersion and 6indows +ersion some difference is e9ist,for e9ample :8 in windows +ersion,show a persistent listening mode and in 8inu9 this parameter use for tunneling mode.*lso, the 8inu9 +ersion includes ;< that displays +ersion information !ut in 6indows this parametre not e9ist.

5igure 0.Netcat help in 8inu9 n this article we e9plore more useful command that Do you need it most.these option for 4NU=8inu9 +ersion and 6indows +ersion are the same. 5or put netcat into ser+er or listening mode,use nc l command and nc *lone run Netcat in client mode. 5or close at end of file 1>$52 from standard input 1stdin2 use :c option and this option only a+aila!le in the 8inu9.to run netcat at the !ackground use :d option. $ne of the most powerful commands is ;e prog.This option, a+aila!le only in ser+er mode and help you to run the specific program when a client connects to it.Please see flowing commands .
nc l p 12345 e c d.e!e "Windows# nc l p 12345 e $%in$%ash "Linu!# 7oth commands are similar,!ut on different systems. The first command e9ecutes Netcat in ser+er mode on port %03?@ and e9ecute cmd.e9e,the second command like first command !ut e9ecutes a !ash shell in 8inu9.To test this option, start Netcat in ser+er mode .

5igure 3.Netcat in ser+er mode then open second window and run netcat in client mode .

5igure ?.netcat in client mode now hit enter,you see Aicrosoft !anner information and a new command prompt !ut it may!e seem a !it o!scure !ut donBt worry,youCre running a command prompt through Netcat.ok,type >9it and you will see that the Netcat ser+er closes in the first window. To start Netcat in ser+er mode on a 8inu9 !o9 type nc l p 12345 e $%in$%ash. Now open a command prompt in 6indows and start Netcat in client mode.

5igure @."esult of e9ecute Netcat To configure netcat for use source routing,use :g or :4 option,7ut note most routers !lock

source:routed packets,so this options )lightly o!solete. *s we said earlier ,for display help use :h switch.use the i option to set a delay,this option my !e useful for scanning ports with rate limiting. To place Netcat in listening mode or ser+er mode use the l option.!y defult netcat is a single: use program and when connection is closed,netcat closed.:l option reopens Netcat with the same command line after the original connection is closed.
nc l p 12345 e c d.e!e &L

use the n option To allow numeric:only P addresses,6ithout n, Netcat will display forward and re+erse name and address lookup for the specified host.

Figure 6:Execute Netcat with n Option

Figue 7:Execute Netcat with v Option

To specify a special port use :p port,8ike !elow . nc l p 12345 at the top e9ample Netcat is run in ser+er mode and listening a connections on port %03?@. to specify more than one port for Netcat you can use comma for seperate or e+en use range of port and common port names. Netcat can also scan ports in client mode that the ;p option is not necessary. f you specify a range of ports Netcat starts at the top and go to the !ottom.for e9ample if you ask netcat for scan ports %/;3/,it will start at 3/ and !ackwards to %/. to scan randomiDe port use the ;r option.for spoofing the ___location you can use ;s option to change the source address of a packet. You can use netcat as a telnet ser+er,To configure Netcat to answer Telnet,use the ser+er:specific ;t command. 7y defult netcat use TCP,for UDP configured use the ;u switch.)ince UDP is a connectionless protocol, it is recommended that you use timeouts with this option. Using netcat as )imple Chat nterface *s we said earlier Netcat is a networking program designed to read and write data across connections.easiest way to understand how Netcat work is set up a ser+er and client. n one terminal window, start the ser+er. nc l p 12345 n a second window, connect to the ser+er with the client.

nc localhost 12345 when you enter a te9t n one of the window and hit enter,your te9t send to another window.see !elow figure.

5igure E.Netcat as messenger 'ort (cannin) with Netcat for port scanning with netcat use flowing synta9 . nc *options+ hostna e *ports+ *s we said,you scan use range,commas and name of port for scanning.in !elow we show you some e9ample . nc , 1-2.1./.1.4 210 /10 443 nc , 1-2.1./.1.4 1&211 nc , 1-2.1./.1.4 http 2rans3errin) 4iles with netcat pulling file $ne application of netcat is transferring files.netcat can pull and push files.see !low e9ample for understand . nc l p 12345 5 te!t3ile n the a!o+e e9ample,Netcat is started in ser+er mode on local port %03?@, and is offering te9tfile.* client who connects to this ser+er is pulling the file from the ser+er, and will recei+e te9tfile . nc 1-2.1./.1.4 12345 6 te!t3ile pushing file netcat can also !e used to push files.please see !elow e9ample . start Netcat in ser+er mode.

nc l p 12345 6 te!t3ile push the file !y starting Netcat in client mode. nc 1-2.1./.1.4 12345 5 te!t3ile 7anner 8ra%%in) finally,$ne of the main netcat features is !anner gra!!ing.7anner gra!!ing is a techniFue to determine the !rand, +ersion, operating system and ser+ice or application.use !elow synta9 . nc &, 9' port when you hit enter,*fter a few seconds you see some information a!out your P address and port num!er,then write GET / 'TTP/)*) and hit enter and see some information a!out your +ictim.

5igure &.7anner gra!!ing Send an email with netcat please make a te9t file and write your message like this . 8isting %.Aessage )ynta9
'+,O ost*e(ample*com -#., F/O-01test2 ost*e(ample*com3 /CPT TO01bob2e(ample*com3 D#T# From0 4#lice5 1alice2"ee!*com3 To0 1bob2e(ample*com3 Date0 -on, )6 #pr 67)7 )806)069 $7877 Sub:ect0 Test -essa"e 'i t ere; T is is supposed to be a real email*** 'ave a "ood day; #lice * <U.T

Now feed this te9t file to the netcat program as follows. 8isting 0.5eed message to Netcat nc smtp.___domain.com 0@ G #tmp#message
667 6=7 6=7 6=7 >=8 6=7 66) @ myrelay*___domain*com +S-TP myrelay*___domain*com sender 1alice2 ac!er*com3 o! recipient 1bob2secure*net3 o! "o a ead o!0 -essa"e 666667?76 accepted myrelay*___domain*com

your email has !een sent.


:sin) Netcat as a 'ort (canner 6e can say,Netcat is not the most powerful port:scanning tool and Nmap can !e !etter for port scanning !ut Netcat can defiantly handle the task.in !elow ta!le you can see port scanning .
Option i secs r u v ! .arget #ort'range Description Delay interval for each port scanned Rando i!e source and destination ports "D# ode ode *doesn+t a,e a full connection$er%ose &ero'()O .arget (#)/ost #ort nu %er or range to scan

Netcat option for port scanning


You can use flowing synta9 .
nc $v $& tar"et port$ran"e

;onnect to an 9<; ser,er with netcat you can use Netcat for connect to "C network.it is +ery easy and you only need to create a !atch file.create a !atch file and write flowing command in it. Hecho off echo Connecting you to "C irc.0'//.net nc :+ 0/E.%%%[email protected]@ '''I U)>" Nc Nick YourNickJere re3erence = Netcat Power Tools Jackers 7eware : Defending Your Network 5rom The 6iley Jacker NetCat Jacker Aanual * Jandy Pocket 4uide for Your Cat en.wikipedia.org#wiki#Netcat http.##nc%%/.sourceforge.net#

You might also like