-
Notifications
You must be signed in to change notification settings - Fork 0
/
rx.sh
67 lines (66 loc) · 1.46 KB
/
rx.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
#!/bin/bash
# Netcat Bash Loop Line Code
#
# https://jnet.forumotion.com/t1744-secure-chat-bash-app#2702
#
prog="nc" # LocalNet is /dev/tcp/ip/port
port=`cat config/port.txt` # port 21112
sound=`cat config/sound.txt`
#
echo "Enter Key"
read -s key
#
echo "Listening For Data..."
echo ""
#
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 $output
}
function cmmd(){
localip=`cat config/ip.txt`
#/bin/bash -i >& /dev/tcp/$localip/$port 0>&1
#
sudo nc -l -p $port > config/rmsg.txt
cat config/rmsg.txt
valuec=`cat config/rmsg.txt`
#decode:
echo "${$valuec}" | openssl enc -d -des3 -base64 -pass pass:$key -pbkdf2
#echo $valuec
}
#sh
while true;
do
#nc -l $port
echo ""
data=$(nc -l -v -q 2 -p $port);
echo "${data}" | openssl enc -d -des3 -base64 -pass pass:$key -pbkdf2 > config/output.txt
data=`cat config/output.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 ""
done