Alternate Methods

/dev/tcp

File Transfer

Client (sending)

cat file.txt > /dev/tcp/10.10.10.1/1111

Listener (receiving)

nc -l -p 1111 > file.txt

/dev/udp

/dev/udp is like the /dev/tcp except to interact with the udp stack.

OpenSSL

Erick Veil has a great write up on this. See the link here.

https://erickveil.github.io/openssl,/ssl,/encryption,/socket,/network,/bash,/linux/2021/01/21/How-to-Send-Encrypted-Messages-Using-OpenSSL-on-the-Command-Line.html

Connect to localhost:

openssl s_client -connect 127.0.0.1:30001

Ncat

Encrypted Transfer

ncat --ssl <ip> <port> < <file>

Ncat Options

-c (--sh-exec) [] = Executes the given command via /bin/sh

-e (--exec) [] = Executes the given command

-k (--keep-open) = To keep TCP port open for other connections.

-l (--listen) = Bind and listen for incoming connections

-t (--telnet) = Answer Telnet negotiations

-u (--udp) = use UDP (TCP default). Cannot be used with --keep-open.

-v (--verbose) = Set verbosity level (can be used several times)

-w (--wait) = Connect timeout

-z = Zero-I/O mode, report connection status only

--chat = Start a simple Ncat chat server

--sctp = SCTP, the Stream Control Transmission Protocol, is a newer reliable protocol. Ncat uses a TCP-compatible subset of SCTP features, not including multiple streams per connection or message boundaries. SCTP may be combined with SSL.

--ssl = Connect or listen with SSL. Works with TCP or SCTP.

Last updated

Was this helpful?