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: 8 months ago
JSON representation
Simple netcat(1) and ncat(1) alternative over TCP
- Host: GitHub
- URL: https://github.com/8dcc/snc
- Owner: 8dcc
- License: gpl-3.0
- Created: 2023-07-16T11:26:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-06T16:34:17.000Z (12 months ago)
- Last Synced: 2025-07-20T03:18:05.068Z (11 months ago)
- Topics: c, cli, network, productivity, sockets
- Language: C
- Homepage:
- Size: 119 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
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 <8dcc.git@gmail.com>.
#+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).