-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecure_recieve_test.sh
81 lines (80 loc) · 1.93 KB
/
secure_recieve_test.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
#!/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
#
echo "Enter Key"
read -s key
lport=777
host_ip=`cat config/remote_host.txt`
sound=`cat config/sound.txt`
function Atone(){
aplay $1
#echo -e "\07"
}
function showdate(){
date=$(date) # +%Y-%m-%d
data="Date Is: $date"
#output=${data} | openssl enc -d -des3 -base64 -pass pass:$1 -pbkdf2
echo $data
}
function cmmd(){
localip=`cat config/ip.txt`
#/bin/bash -i >& /dev/tcp/$localip/$port 0>&1
#
sudo nc -l -p $lport > config/rmsg.txt #&& cat config/rmsg.txt
#while ! echo exit | sudo nc -l -p $port > config/rmsg.txt 13; do sleep 10; done
valuec=`cat config/rmsg.txt`
#decode:
echo "${$valuec}" | openssl enc -d -des3 -base64 -pass pass:$key -pbkdf2
#echo $valuec
}
while true;
do
echo -en "\e[92m "
#clear
echo "Previous Message: "
echo ""
cat config/decrypted.txt
echo "Waiting For New Message"
echo ""
sudo nc -l -w 550 -p 776 > config/rmsg.txt &&
cat config/rmsg.txt | openssl enc -d -des3 -base64 -pass pass:$key -pbkdf2 > config/decrypted.txt
cat config/decrypted.txt
sleep 0.006 # this is work
#echo "All Done!"
#echo -en"\e[94m \c"
# #clear
# bash synth.sh
# cat decrypted.txt
cat config/decrypted.txt >> config/all_messages.txt
Atone $sound
data=`cat config/decrypted.txt`
if [[ $data = *#Date* ]];
then
echo "Admin Command Recieved"
echo $data
# Function Test!
showdate "$key"
elif [[ $data = *#Cmd* ]];
then
echo "Admin Command Recieved"
echo $data
cmmd
elif [[ $data = *#Alert* ]];
then
echo "Admin Command Recieved"
echo $data
Atone $sound
else
echo $data
fi
echo -en "\e[70m \c"
sleep 5
#bash recieve.sh
done
exit
#bash recieve.sh
#