Ncat

Description

Ncat or netcat is a feature-packed networking utility which reads and writes data across networks from the command line. it was written for the Nmap Project and is the culmination of the currently splintered family of Netcat incarnations. It is designed to be a reliable back-end tool to instantly provide network connectivity to other applications and users. it will not only work with IPv4 and IPv6 but provides the user with a virtually limitless number of potential uses. it is also known as : THE SWISS ARMY KNIFE. we can write ncat or nc while running the command options. So dont be confuse if i will use different name of ncat. simply we can understand What netcat does it opens the connection between two machines and give back two streams.

Usage

Syntax

ncat [options] [hostname] [port]

Options

Options taking a time assume seconds. Append 'ms' for milliseconds,
's' for seconds, 'm' for minutes, or 'h' for hours (e.g. 500ms).
  -4                         Use IPv4 only
  -6                         Use IPv6 only
  -U, --unixsock             Use Unix domain sockets only
  -C, --crlf                 Use CRLF for EOL sequence
  -c, --sh-exec <command>    Executes the given command via /bin/sh
  -e, --exec <command>       Executes the given command
      --lua-exec <filename>  Executes the given Lua script
  -g hop1[,hop2,...]         Loose source routing hop points (8 max)
  -G <n>                     Loose source routing hop pointer (4, 8, 12, ...)
  -m, --max-conns <n>        Maximum <n> simultaneous connections
  -h, --help                 Display this help screen
  -d, --delay <time>         Wait between read/writes
  -o, --output <filename>    Dump session data to a file
  -x, --hex-dump <filename>  Dump session data as hex to a file
  -i, --idle-timeout <time>  Idle read/write timeout
  -p, --source-port port     Specify source port to use
  -s, --source addr          Specify source address to use (doesn't affect -l)
  -l, --listen               Bind and listen for incoming connections
  -k, --keep-open            Accept multiple connections in listen mode
  -n, --nodns                Do not resolve hostnames via DNS
  -t, --telnet               Answer Telnet negotiations
  -u, --udp                  Use UDP instead of default TCP
      --sctp                 Use SCTP instead of default TCP
  -v, --verbose              Set verbosity level (can be used several times)
  -w, --wait <time>          Connect timeout
      --append-output        Append rather than clobber specified output files
      --send-only            Only send data, ignoring received; quit on EOF
      --recv-only            Only receive data, never send anything
      --allow                Allow only given hosts to connect to Ncat
      --allowfile            A file of hosts allowed to connect to Ncat
      --deny                 Deny given hosts from connecting to Ncat
      --denyfile             A file of hosts denied from connecting to Ncat
      --broker               Enable Ncat's connection brokering mode
      --chat                 Start a simple Ncat chat server
      --proxy <addr[:port]>  Specify address of host to proxy through
      --proxy-type <type>    Specify proxy type ("http" or "socks4")
      --proxy-auth <auth>    Authenticate with HTTP or SOCKS proxy server
      --ssl                  Connect or listen with SSL
      --ssl-cert             Specify SSL certificate file (PEM) for listening
      --ssl-key              Specify SSL private key (PEM) for listening
      --ssl-verify           Verify trust and domain name of certificates
      --ssl-trustfile        PEM file containing trusted SSL certificates
      --version              Display Ncat's version information and exit

See the ncat(1) manpage for full options, descriptions and usage examples

Example

1. open ncat

cyborg@cyborg:~$ sudo ncat -lvvp 300
N cat: Version 6.40 
N cat: Listening on :::300
N cat: Listening on 0.0.0.0:300
^C

Listening on any TCP/UDP port  – Some command option which we are going to use here

-l option will help it work in listen mode.

-p option will mention which port to listen.

-v option will make it interactive.

Syntax – ncat –lvvp port

       Ex – ncat –lvvp 25

 

2. Open another system on same network and try to connect this server on port 300

Ex type server ip : 300 in this case 192.168.1.8:300

this will not do any affect on communication and for the sake of establising communication purpose only.

3.Connection Establishment :

 

cyborg@cyborg:~$ sudo ncat -lvvp 300
N cat: Version 6.40 ( http://nmap.org/ncat )
N cat: Listening on :::300
N cat: Listening on 0.0.0.0:300
N cat: Connection from 192.168.1.4.
N cat: Connection from 192.168.1.4:58776.
GET / HTTP/1.1
Host: 192.168.1.8:300
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8



		
		
0 Comments

Leave a reply

CONTACT US

We're are building as a community and a team. Be a part of it.

Sending

©2017 Ztrela Knowledge Solutions Pvt. Ltd

Log in with your credentials

Forgot your details?