Secure-netcat is a client/server application implemented using Netcat, featuring RSA-encrypted communication and password protection.
⚠️ Note: These scripts must be run on an environment where FIFOs (named pipes) are supported.
You can simply install the release version here.
First, clone the repository using git.
git clone https://github.com/Horizon-NTH/Secure-netcat.git
There are two scripts provided: one for the server and one for the client, allowing you to establish a secure connection.
The script server.sh
starts the server. If it's the first time running it, you will be prompted to create a
password for the server; otherwise, it will start without any prompts.
$ ./server.sh
>>>Initialization
Please enter the password:
Please retype the password:
>>>Password changed
>>>Server initialized
The server notifies when users connect or disconnect.
@server:Wed Feb 28 04:55:36 PM CET 2024! User connected
@server:Wed Feb 28 05:05:12 PM CET 2024! User disconnected
Here are the available arguments for the server script:
Options | Usage |
---|---|
n | Create a new password for the server |
i | Set the server's IP address |
p | Set the server's port |
The script client.sh
allows you to connect to an existing server.
If the server is down or the connection is impossible, the script will terminate.
$ ./client.sh
>>>The server is down
If the server is running, you will be prompted for the password before gaining access to the server's CLI.
./client.sh
>>>The server is up
>>>Connecting
__ __ _
\ \ / /__| | ___ ___ _ __ ___ ___
\ \ /\ / / _ \ |/ __/ _ \|\'_ ` _ \ / _ \
\ V V / __/ | (_| (_) | | | | | | __/
\_/\_/ \___|_|\___\___/|_| |_| |_|\___|
Please enter the password:
>>>Connected
@user:Wed Feb 28 04:55:35 PM CET 2024$
Here are the available arguments for the client script:
Options | Usage |
---|---|
i | Set the IP address of the server you want to connect to |
p | Set the port of the server you want to connect to |
Once the client is connected to a server, the user can execute any command as if they were directly on the server:
@user:Wed Feb 28 05:07:59 PM CET 2024$ ls
client.sh
LICENSE
README.md
server.sh
@user:Wed Feb 28 05:08:00 PM CET 2024$ cd .. && ls
Secure-netcat
Note: All communications between the server and the client are encrypted.
-
netcat: Used for communication. Make sure to use the OpenBSD version for compatibility.
-
openssl: Used for encryption.
-
figlet [Optional]: Used for displaying a welcome message.
This project is licensed under the MIT license.