An open API service indexing awesome lists of open source software.

https://github.com/8dcc/snc

Simple netcat(1) and ncat(1) alternative over TCP
https://github.com/8dcc/snc

c cli network productivity sockets

Last synced: 4 months ago
JSON representation

Simple netcat(1) and ncat(1) alternative over TCP

Awesome Lists containing this project

README

        

#+TITLE: snc
#+AUTHOR: 8dcc
#+OPTIONS: toc:nil
#+STARTUP: showeverything

Simple =netcat(1)= and =ncat(1)= alternative over TCP.

See also my [[https://8dcc.github.io/programming/netref.html][C Network Programming Reference]].

* Building

To build the project, simply clone the repository and run =make=.

#+begin_src console
$ git clone https://github.com/8dcc/snc
$ cd snc
$ make clean all
...
#+end_src

Optionally, if you want to install the program in your system, use the =install=
target.

#+begin_src console
$ sudo make install
...
#+end_src

* Usage

The help can be shown with the =--help= option.

#+begin_src console
$ snc --help
Usage: snc [OPTION...]

Mode arguments
-r, --receive Receive data from incoming transmitters.
-t, --transmit=DESTINATION Transmit data into the DESTINATION receiver.

Optional arguments
-p, --port=PORT Specify the port for receiving or transferring
data.

--print-interfaces When receiving data, print the list of local
interfaces, along with their addresses. Useful
when receiving data over a LAN.
--print-peer-info When receiving data, print the peer information
whenever a connection is accepted.
--print-progress Print the size of the received or transmitted data
to 'stderr'.

-?, --help Give this help list
--usage Give a short usage message

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to <[email protected]>.
#+end_src

To receive data from another machine, start the program in /receive/ mode. It will
start to listen, and print received data to =stdout=.

#+begin_src console
$ snc --receive
...

$ snc -r > output.txt
#+end_src

To transmit data to another machine, start the program in /transmit/ mode. It will
read data from =stdin=, transmit it to the specified IP address.

#+begin_src console
$ snc --transmit "IP"
Type stuff here!
...
It will send it to the receiver.

$ snc -t "IP" < input.txt
#+end_src

You may specify a port when receiving and transmitting data, so you can connect
to an [[https://nmap.org/ncat/][ncat]] instance by using its port (by default 31337).