diff --git a/client/Client.sh b/client/Client.sh index 347e053..f969161 100755 --- a/client/Client.sh +++ b/client/Client.sh @@ -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" diff --git a/client/conf-client/service.cfg b/client/conf-client/service.cfg index 305fa77..37b6fd4 100644 --- a/client/conf-client/service.cfg +++ b/client/conf-client/service.cfg @@ -1,4 +1,6 @@ RemoteIp=127.0.0.1 RemotePort=8080 LocalPassword='Evil@MonitoR-666' +Crypted=no + diff --git a/server/Daemon.sh b/server/Daemon.sh index 9314bd1..25feaaf 100755 --- a/server/Daemon.sh +++ b/server/Daemon.sh @@ -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 diff --git a/server/conf-server/service.cfg b/server/conf-server/service.cfg index c27ccbf..c30893e 100644 --- a/server/conf-server/service.cfg +++ b/server/conf-server/service.cfg @@ -1,3 +1,5 @@ LocalIp=127.0.0.1 LocalPort=8080 +######### +Crypted=no LocalPassword='Evil@MonitoR-666'