-
Notifications
You must be signed in to change notification settings - Fork 0
/
secure_send.sh
85 lines (83 loc) · 1.85 KB
/
secure_send.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# (c) J~NET 2021
# jnet.sytes.net
#
# https://jnet.forumotion.com/t1729-jnet-multi-tool-2021#2677
# https://jnet.forumotion.com/t1744-secure-chat-bash-app#2702
#
RED="\e[31m"
GREEN="\e[92m"
YELLOW="\e[33m"
echo "Enter Key"
read -s key
#host_ip=`cat config/remote_host.txt`
readarray -t host_ip < config/remote_host.txt
dig @resolver4.opendns.com myip.opendns.com +short > config/ip.txt
local_ip=`cat config/ip.txt`
alias=`cat config/alias.txt`
port=`cat config/port.txt`
#
echo "Current Port Set To $port"
if test -z "$key"
then
key_icon="🔓 No Key"
else
key_icon="🔒 Locked!"
fi
echo "Remote Host IP $host_ip Or type #quit"
while true;
do
#
echo "$key_icon"
echo ""
input="$@"
if [ -z "$*" ];
then
echo -e "${GREEN}Enter Text To Send: Or type #quit"
read input;
fi
#
while ! [ "$input" ];
do
echo -e "${RED}Warning!"
echo -e "${YELLOW}PLEASE NO EMPTY MESSAGES!"
echo ""
echo "Enter Text To Send: Or type #quit"
read input;
done
#
echo -en "\e[92m"
if [[ $input = *#quit* ]];
then
exit ;
fi
#
echo "$alias@$local_ip: $input" > config/msg.txt
Edata=$(cat config/msg.txt | openssl enc -e -des3 -base64 -pass pass:$key -pbkdf2)
echo -en "\e[92mPress Ctrl + C To Stop Sending New Secure Message! $input \c"
#sleep 0.2
for i in "${host_ip[@]}"
do
echo $Edata | ncat --ssl "$i" "$port" #& sleep 1 ; #kill $!
clear
echo "Message Sent."
done
count=0
total=34
pstr="[=======================================================================]"
while [ $count -lt $total ];
do
sleep 0.006
count=$(( $count + 1 ))
pd=$(( $count * 73 / $total ))
printf "\r%3d.%1d%% %.${pd}s" $(( $count * 100 / $total )) $(( ($count * 1000 / $total) % 10 )) $pstr
done
echo "Message Sent!, Please Wait 5 Seconds..."
#
sleep 5
#clear
echo "Last Message Sent"
cat config/msg.txt
done
trap "sh secure_send.sh; exit;" SIGINT SIGTERM;
sh send.sh