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
- Host: GitHub
- URL: https://github.com/8dcc/snc
- Owner: 8dcc
- License: gpl-3.0
- Created: 2023-07-16T11:26:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T12:27:10.000Z (5 months ago)
- Last Synced: 2025-02-23T12:14:31.997Z (4 months ago)
- Topics: c, cli, network, productivity, sockets
- Language: C
- Homepage:
- Size: 93.8 KB
- Stars: 1
- 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: showeverythingSimple =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_srcOptionally, 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 messageMandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.Report bugs to <[email protected]>.
#+end_srcTo 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_srcTo 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_srcYou 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).