Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
241ee2385f | ||
|
|
6beee1e2ba | ||
|
|
5d89ac6417 | ||
|
|
c4801fa8dc | ||
|
|
44e406c80f | ||
|
|
06caf72a34 | ||
| 19accb4c0e | |||
| 5718426164 |
@ -6,7 +6,7 @@ MoniThor is a simple monitoring tools in bash.
|
|||||||
|
|
||||||
You can use it with netcat or cryptcat
|
You can use it with netcat or cryptcat
|
||||||
|
|
||||||
You can see result on the client from a web page (self hosted python web server)
|
You can see result on the client from a web page (self hosted python3 web server)
|
||||||
|
|
||||||
|
|
||||||
## Server Configuration
|
## Server Configuration
|
||||||
@ -160,7 +160,7 @@ sudo /etc/init.d/monithor-c start/stop
|
|||||||
|
|
||||||
### WEB
|
### WEB
|
||||||
|
|
||||||
The client start a python sumple http server on localhost on `WebPort`
|
The client start a python3 sumple http server on localhost on `WebPort`
|
||||||
|
|
||||||
```
|
```
|
||||||
/usr/local/bin/monithor-client.d/MoniThorWebServer
|
/usr/local/bin/monithor-client.d/MoniThorWebServer
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: monithor-server
|
title: monithor-client
|
||||||
section: 1
|
section: 1
|
||||||
author: Guillaume Astier Ruiz
|
author: Guillaume Astier Ruiz
|
||||||
date: 20220320
|
date: 20220320
|
||||||
@ -9,9 +9,6 @@ date: 20220320
|
|||||||
|
|
||||||
`/etc/init.d/monithor-c [start/stop]`
|
`/etc/init.d/monithor-c [start/stop]`
|
||||||
|
|
||||||
`/etc/init.d/monithor-c [start/stop]`
|
|
||||||
|
|
||||||
|
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
|
|
||||||
monithor-client(1) permet de surveiller votre système d'information
|
monithor-client(1) permet de surveiller votre système d'information
|
||||||
@ -20,7 +17,7 @@ monithor-client(1) permet de surveiller votre système d'information
|
|||||||
|
|
||||||
- il peut aussi utiliser cryptcat (chiffré)
|
- il peut aussi utiliser cryptcat (chiffré)
|
||||||
|
|
||||||
- un serveur web en python est lancé sur votre machine de monitoring
|
- un serveur web en python3 est lancé sur votre machine de monitoring
|
||||||
|
|
||||||
# INIT.D
|
# INIT.D
|
||||||
|
|
||||||
@ -32,7 +29,7 @@ le service peut être démarré et arrêté via system V
|
|||||||
|
|
||||||
- Arrêt
|
- Arrêt
|
||||||
|
|
||||||
`/etc/init.d/monithor-c start`
|
`/etc/init.d/monithor-c stop`
|
||||||
|
|
||||||
# CONFIGURATION SERVICE
|
# CONFIGURATION SERVICE
|
||||||
|
|
||||||
@ -58,7 +55,7 @@ le service peut être démarré et arrêté via system V
|
|||||||
|
|
||||||
* TimeOut : correspond à la valeur en seconde (float) du temps maximal d'éxécution de chaque sonde
|
* TimeOut : correspond à la valeur en seconde (float) du temps maximal d'éxécution de chaque sonde
|
||||||
|
|
||||||
* WebPort : correpond au port utilisé pour lancer le serveur web python
|
* WebPort : correpond au port utilisé pour lancer le serveur web python3
|
||||||
|
|
||||||
# CONFIGURATION SONDE
|
# CONFIGURATION SONDE
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,9 @@ date: 20220320
|
|||||||
|
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
|
|
||||||
`/usr/local/bin/monithor-server [start/stop]`
|
`/usr/local/bin/monithor-d [start/stop]`
|
||||||
|
|
||||||
`/etc/init.d/monithor-c [start/stop]`
|
`/etc/init.d/monithor-d [start/stop]`
|
||||||
|
|
||||||
|
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
@ -26,17 +26,17 @@ le service peut être démarré et arrêté via system V
|
|||||||
|
|
||||||
- Démarrage
|
- Démarrage
|
||||||
|
|
||||||
`/etc/init.d/monithor-c start`
|
`/etc/init.d/monithor-d start`
|
||||||
|
|
||||||
- Arrêt
|
- Arrêt
|
||||||
|
|
||||||
`/etc/init.d/monithor-c start`
|
`/etc/init.d/monithor-d stop`
|
||||||
|
|
||||||
# CONFIGURATION SERVICE
|
# CONFIGURATION SERVICE
|
||||||
|
|
||||||
- Le fichier responsable de la gestion IP/PORT est : service.cfg
|
- Le fichier responsable de la gestion IP/PORT est : service.cfg
|
||||||
|
|
||||||
`LocalIp=10.10.10.4`
|
`RemoteIp=10.10.10.4`
|
||||||
|
|
||||||
`LocalPort=1666`
|
`LocalPort=1666`
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ le service peut être démarré et arrêté via system V
|
|||||||
|
|
||||||
`LocalPassword='Evil@MonitoR-666'`
|
`LocalPassword='Evil@MonitoR-666'`
|
||||||
|
|
||||||
* LocalIp : correspond à l'adresse IP de l'interface réseau en écoute
|
* RemoteIp : correspond à l'adresse IP de l'interface réseau en écoute du client de monitoring
|
||||||
|
|
||||||
* LocalPort : correspond au port de communication du client monithor
|
* LocalPort : correspond au port de communication du client monithor
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Package: monithor-client
|
Package: monithor-client
|
||||||
Version: 1.0
|
Version: 1.0
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Dependsd:netcat,cryptcat,screen,python,netcat,cryptcat,elinks
|
Dependsd:netcat,cryptcat,screen,python3,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 client (with simple http server python3)
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
# Provides: monithor-c
|
# Provides: monithor-c
|
||||||
# Default-Start: 2 3 4 5
|
# Default-Start: 2 3 4 5
|
||||||
# Default-Stop:
|
# Default-Stop:
|
||||||
# Short-Description: MoniThor Server
|
# Short-Description: MoniThor client
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@ -21,15 +21,20 @@ case "$1" in
|
|||||||
logger "monithor-client is running ..."
|
logger "monithor-client is running ..."
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
logger "Starting MoniThor Server"
|
logger "Starting MoniThor client "
|
||||||
/usr/local/bin/monithor-client start
|
/usr/local/bin/monithor-client start
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
logger "Stoping MoniThor server" "monithor-c" || true
|
logger "Stoping MoniThor client " "monithor-c" || true
|
||||||
/usr/local/bin/monithor-client stop
|
/usr/local/bin/monithor-client stop
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
logger "status MoniThor client " "monithor-c" || true
|
||||||
|
[ $(ps axf| grep MoniThor | grep SCREEN | wc -l) -gt 1 ] && echo "monithor-c is running" || echo "montihor-c is dead"
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Usage: /etc/init.d/monithor-c {start|stop|status}" || true
|
echo "Usage: /etc/init.d/monithor-c {start|stop|status}" || true
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
RemoteIp=10.10.10.3:1666
|
|
||||||
LocalPassword='Evil@MonitoR-666'
|
LocalPassword='Evil@MonitoR-666'
|
||||||
Crypted=no
|
Crypted=no
|
||||||
Rotation=1
|
Rotation=1
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
10.10.10.3:1666#file#/tmp/coucou
|
|
||||||
10.10.10.3:1666#file#/tmp/nop
|
|
||||||
10.10.10.3:1666#file#
|
|
||||||
10.10.10.3:1666#NotRealSondeName#reboot
|
|
||||||
10.10.10.4:1666#file#/tmp/coucou
|
|
||||||
10.10.10.4:1666#file#/tmp/nop
|
|
||||||
10.10.10.4:1666#file#
|
|
||||||
10.10.10.4:1666#NotRealSondeName#reboot
|
|
||||||
@ -29,7 +29,7 @@ fi
|
|||||||
|
|
||||||
if [[ "$1" == "stop" ]]
|
if [[ "$1" == "stop" ]]
|
||||||
then
|
then
|
||||||
killall python &> /dev/null
|
killall python3 &> /dev/null
|
||||||
rm /tmp/Monithor* &> /dev/null
|
rm /tmp/Monithor* &> /dev/null
|
||||||
touch /tmp/endmonitor
|
touch /tmp/endmonitor
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ CheckAllEnd() {
|
|||||||
echo '
|
echo '
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>MoniThor on '${RemoteIp}' </title>
|
<title>MoniThor on '$(hostname)' </title>
|
||||||
<meta http-equiv="refresh" content="1" />
|
<meta http-equiv="refresh" content="1" />
|
||||||
</head>
|
</head>
|
||||||
<title>MONITHOR</title>
|
<title>MONITHOR</title>
|
||||||
|
|||||||
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
pushd /var/www/html/monithor
|
pushd /var/www/html/monithor
|
||||||
source /usr/local/bin/monithor-client.d/MoniThorFnct
|
source /usr/local/bin/monithor-client.d/MoniThorFnct
|
||||||
python -m SimpleHTTPServer ${1} &
|
python3 -m http.server ${1} &
|
||||||
|
|
||||||
|
|
||||||
echo '<html>
|
echo '<html>
|
||||||
<head>
|
<head>
|
||||||
<title>MoniThor on '${RemoteIp}' </title>
|
<title>MoniThor on '$(hostname)' </title>
|
||||||
<meta http-equiv="refresh" content="1" />
|
<meta http-equiv="refresh" content="1" />
|
||||||
</head>
|
</head>
|
||||||
<title>MONITHOR</title>
|
<title>MONITHOR</title>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Package: monithor-server
|
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,python3,netcat,cryptcat,elinks
|
||||||
Maintainer: Guillaume Astier <guillaume@gastier.net>
|
Maintainer: Guillaume Astier <guillaume@gastier.net>
|
||||||
Description: monithor server (netcat & snort)
|
Description: monithor server (netcat & snort)
|
||||||
|
|||||||
@ -30,6 +30,13 @@ case "$1" in
|
|||||||
/usr/local/bin/monithor-server stop
|
/usr/local/bin/monithor-server stop
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
logger "status MoniThor server" "monithor-d" || true
|
||||||
|
[ "$(ps axf| grep '/usr/local/bin/monithor-server'|grep -v grep)" ] && echo "monithor-d is running" || echo "montihor-d is dead"
|
||||||
|
|
||||||
|
;;
|
||||||
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Usage: /etc/init.d/monithor-d {start|stop|status}" || true
|
echo "Usage: /etc/init.d/monithor-d {start|stop|status}" || true
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
LocalIp=10.10.10.4
|
RemoteIp=10.10.10.4
|
||||||
LocalPort=1666
|
LocalPort=1666
|
||||||
########
|
########
|
||||||
Crypted=no
|
Crypted=no
|
||||||
|
|||||||
@ -8,7 +8,7 @@ source /etc/monithor-server/service.cfg
|
|||||||
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"
|
#[[ "$1" == "Config" ]] && echo "Ip configuration will failed"
|
||||||
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@ -18,17 +18,17 @@ if [[ $(id -u) != "0" ]]
|
|||||||
Exit root
|
Exit root
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $LocalIp) ]] && Exit Config
|
#[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $RemoteIp) ]] && Exit Config
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort} " || NcCmd="nc -l ${LocalIp} ${LocalPort}"
|
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort} " || NcCmd="nc -l ${RemoteIp} -p ${LocalPort}"
|
||||||
|
|
||||||
if [[ "${1}" == "start" ]]
|
if [[ "${1}" == "start" ]]
|
||||||
then
|
then
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
#coproc cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort}
|
#coproc cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort}
|
||||||
coproc eval ${NcCmd}
|
coproc eval ${NcCmd}
|
||||||
while read -r cmd; do
|
while read -r cmd; do
|
||||||
logger "Running $cmd"
|
logger "Running $cmd"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user