[UPDATE] - TP 05

This commit is contained in:
Prof Isen 2022-05-02 21:09:49 +02:00
parent 8fd4776f92
commit 2ff5c979b5
6 changed files with 18 additions and 32 deletions

BIN
doc/monithor-client.1.gz Normal file

Binary file not shown.

View File

@ -7,7 +7,7 @@ date: 20220320
# SYNOPSIS # SYNOPSIS
`/usr/local/bin/monithor-client [start/stop]` `/etc/init.d/monithor-c [start/stop]`
`/etc/init.d/monithor-c [start/stop]` `/etc/init.d/monithor-c [start/stop]`
@ -40,8 +40,6 @@ le service peut être démarré et arrêté via system V
`$ cat etc/monithor-client/service.cfg ` `$ cat etc/monithor-client/service.cfg `
`RemoteIp=10.10.10.3:1666 `
`LocalPassword='Evil@MonitoR-666'` `LocalPassword='Evil@MonitoR-666'`
`Crypted=no` `Crypted=no`
@ -52,8 +50,6 @@ le service peut être démarré et arrêté via system V
`WebPort=80` `WebPort=80`
* RemoteIp : correspond au couple adresse IP/Port de l'interface réseau utilisée
* LocalPassword : correspond au mot de passe utilisé pour chiffré la connexion si Crypted est à "yes" * LocalPassword : correspond au mot de passe utilisé pour chiffré la connexion si Crypted est à "yes"
* Crypted : si la valeur est à "yes" le binnaire crypcat est utilisé, si non netcat est utilisé * Crypted : si la valeur est à "yes" le binnaire crypcat est utilisé, si non netcat est utilisé

BIN
doc/monithor-server.1.gz Normal file

Binary file not shown.

View File

@ -30,7 +30,10 @@ GitVersion() {
} }
CpArchName() { CpArchName() {
cp -Rf monithor-${1} /tmp/monithor-${1}_${2}_all
rm -Rf /tmp/monithor-*
cp -Rf ${Wai}/monithor-${1} /tmp/monithor-${1}_${2}_all
} }
@ -46,6 +49,7 @@ BuildDeb(){
[[ $Dist == "ubuntu" ]] && Compress=' -Z gzip -S fixed ' [[ $Dist == "ubuntu" ]] && Compress=' -Z gzip -S fixed '
dpkg-deb ${Compress} --build --root-owner-group monithor-${1}_${2}_all &> /dev/null dpkg-deb ${Compress} --build --root-owner-group monithor-${1}_${2}_all &> /dev/null
[[ "$?" -eq "0" ]] && echo "OK" || echo "FAILED" [[ "$?" -eq "0" ]] && echo "OK" || echo "FAILED"
cp monithor-*deb ${Wai}/build
} }
@ -57,18 +61,10 @@ CleanTemp() {
ManPage() { ManPage() {
if [[ $2 == "create" ]] mkdir -p /tmp/monithor-${1}_${2}_all/usr/share/man/man1/
then
pandoc -s -t man ${Wai}/doc/monithor-${1}.md -o ${Wai}/doc/monithor-${1}.1 pandoc -s -t man ${Wai}/doc/monithor-${1}.md -o /tmp/monithor-${1}_${2}_all/usr/share/man/man1/monithor-${1}.1
[[ -f ${Wai}/doc/monithor-${1}.1.gz ]] && rm -f ${Wai}/doc/monithor-${1}.1.gz gzip /tmp/monithor-${1}_${2}_all/usr/share/man/man1/monithor-${1}.1
gzip ${Wai}/doc/monithor-${1}.1
cp ${Wai}/doc/monithor-${1}.1.gz ${Wai}/monithor-${1}/usr/share/man/man1/
fi
if [[ $2 == "delete" ]]
then
rm ${Wai}/monithor-${1}/usr/share/man/man1/*gz
rm ${Wai}/doc/monithor-${1}.1.gz
fi
} }
[[ ! -z $1 ]] && usage [[ ! -z $1 ]] && usage
@ -77,13 +73,11 @@ CheckDep
GitVersion GitVersion
CpArchName server $NewTag CpArchName server $NewTag
CpArchName client $NewTag
SedControl server $NewTag SedControl server $NewTag
SedControl client $NewTag ManPage server $NewTag
ManPage client create
ManPage server create
BuildDeb client $NewTag
BuildDeb server $NewTag BuildDeb server $NewTag
ManPage client delete
ManPage server delete CpArchName client $NewTag
CleanTemp SedControl client $NewTag
ManPage client ${NewTag}
BuildDeb client $NewTag

View File

@ -1,12 +1,10 @@
#!/bin/bash #!/bin/bash
source /etc/monithor-client/service.cfg source /etc/monithor-client/service.cfg
Ip=$(echo $RemoteIp| cut -d":" -f1)
Exit () { Exit () {
[[ "$1" == "root" ]] && echo "You have to be root ..." [[ "$1" == "root" ]] && echo "You have to be root ..."
[[ "$1" == "Config" ]] && echo "Ip configuration will failed"
exit exit
} }
@ -16,8 +14,6 @@ if [[ $(id -u) != "0" ]]
Exit root Exit root
fi fi
[[ ! -z $(ifconfig | grep inet | awk '{print $2}' | grep $Ip) ]] && Exit Config
if [[ "$1" == "start" ]] if [[ "$1" == "start" ]]
then then
[[ -f /tmp/endmonitor ]] && rm -f /tmp/endmonitor [[ -f /tmp/endmonitor ]] && rm -f /tmp/endmonitor

View File

@ -1,6 +1,6 @@
Package: monithor-client Package: monithor-server
Version: 1.0 Version: 1.0
Architecture: all Architecture: all
Dependsd:netcat,cryptcat,screen,python,netcat,cryptcat,elinks Dependsd:netcat,cryptcat,screen,python,netcat,cryptcat,elinks
Maintainer: Guillaume Astier <guillaume@gastier.net> Maintainer: Guillaume Astier <guillaume@gastier.net>
Description: monithor client (with simple http server python) Description: monithor server (netcat & snort)