[UPDATE] add crypt version

This commit is contained in:
Prof Isen 2022-03-16 10:58:46 +01:00
parent ec039ce26a
commit 852c50002d
4 changed files with 11 additions and 3 deletions

View File

@ -6,12 +6,14 @@ cd $(dirname $0)/conf-client/
SondeFile=$(pwd)/sonde.cfg
source service.cfg
[[ "${Crypted}" == "yes" ]] && NcCmd="timeout 0.1 cryptcat -k ${LocalPassword} ${RemoteIp} ${RemotePort} ${Udp}" || NcCmd="timeout 0.1 nc ${RemoteIp} ${RemotePort}"
while read DATA
do
Cmd=$(echo $DATA| cut -d"#" -f1)
Arg=$(echo $DATA| cut -d"#" -f2)
Res=$(echo -e "${Cmd}#${Arg}" | timeout 0.1 cryptcat -k ${LocalPassword} ${RemoteIp} ${RemotePort} 2> /dev/null)
Res=$( echo -e "${Cmd}#${Arg}" | eval ${NcCmd} 2> /dev/null)
if [[ -z $Res ]]
then
echo "5|No sonde $Cmd on serveur $RemoteIp"

View File

@ -1,4 +1,6 @@
RemoteIp=127.0.0.1
RemotePort=8080
LocalPassword='Evil@MonitoR-666'
Crypted=no

View File

@ -6,10 +6,12 @@ ScriptDir=$(pwd)/scripts/
SondeFile=$(pwd)/sonde.cfg
source service.cfg
echo "coproc cryptcat -k "${LocalPassword}" -l ${LocalIp} ${LocalPort}"
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort} " || NcCmd="nc -l ${LocalIp} ${LocalPort}"
while true
do
coproc cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort}
#coproc cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort}
coproc eval ${NcCmd}
while read -r cmd; do
logger "Running $cmd"
cpt=0

View File

@ -1,3 +1,5 @@
LocalIp=127.0.0.1
LocalPort=8080
#########
Crypted=no
LocalPassword='Evil@MonitoR-666'